Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
Upgrade Tempo to 2.4.0 with adjusting config properties/defaults (#74)
Browse files Browse the repository at this point in the history
Co-authored-by: Pietro Pasotti <starfire.daemon@gmail.com>
  • Loading branch information
mmkay and PietroPasotti authored Mar 1, 2024
1 parent d994e34 commit 19e4523
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ To manually test and develop tempo:

charmcraft pack
charmcraft pack -p ./tests/integration/tester/
j deploy ./tempo-k8s_ubuntu-22.04-amd64.charm tempo --resource tempo-image=grafana/tempo:1.5.0
j deploy ./tempo-k8s_ubuntu-22.04-amd64.charm tempo --resource tempo-image=grafana/tempo:2.4.0

you need to always deploy at least 2 units of tester:

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ juju deploy tempo-k8s # --trust (use when cluster has RBAC enabled)

## OCI Images

This charm, by default, deploys `grafana/tempo:1.5.0`.
This charm, by default, deploys `grafana/tempo:2.4.0`.

## Contributing

Expand Down
4 changes: 2 additions & 2 deletions lib/charms/tempo_k8s/v2/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def __init__(self, *args):

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 0
LIBPATCH = 1

PYDEPS = ["pydantic"]

Expand Down Expand Up @@ -577,7 +577,7 @@ def relations(self) -> List[Relation]:
"""All v2 relations active on this endpoint."""
return [r for r in self._charm.model.relations[self._relation_name] if self.is_v2(r)]

def publish_receivers(self, receivers: Iterable[RawReceiver]):
def publish_receivers(self, receivers: Sequence[RawReceiver]):
"""Let all requirers know that these receivers are active and listening."""
if not self._charm.unit.is_leader():
raise RuntimeError("only leader can do this")
Expand Down
2 changes: 1 addition & 1 deletion metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ resources:
description: OCI image for Tempo
# Included for simplicity in integration tests
# see https://hub.docker.com/r/grafana/tempo/tags
upstream-source: grafana/tempo:1.5.0
upstream-source: grafana/tempo:2.4.0

provides:
profiling-endpoint:
Expand Down
2 changes: 1 addition & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def _update_tracing_relations(self):
requested_receivers = self._requested_receivers()
# publish requested protocols to all v2 relations
self._tracing.publish_receivers(
((p, self.tempo.receiver_ports[p]) for p in requested_receivers)
[(p, self.tempo.receiver_ports[p]) for p in requested_receivers]
)

# if the receivers have changed, we need to reconfigure tempo
Expand Down
9 changes: 4 additions & 5 deletions src/tempo.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ def get_config(self, receivers: Sequence[ReceiverProtocol]) -> str:
return yaml.safe_dump(
{
"auth_enabled": False,
"search_enabled": True,
"server": {
"http_listen_port": self.tempo_port,
"grpc_listen_port": self.receiver_ports["tempo_grpc"],
Expand All @@ -108,7 +107,7 @@ def get_config(self, receivers: Sequence[ReceiverProtocol]) -> str:
"ingester": {
"trace_idle_period": "10s",
"max_block_bytes": 100,
"max_block_duration": "5m",
"max_block_duration": "30m",
},
"compactor": {
"compaction": {
Expand All @@ -118,7 +117,7 @@ def get_config(self, receivers: Sequence[ReceiverProtocol]) -> str:
"max_compaction_objects": 1000000,
"block_retention": "1h",
"compacted_block_retention": "10m",
"flush_size_bytes": 5242880,
"v2_out_buffer_bytes": 5242880,
}
},
# see https://grafana.com/docs/tempo/latest/configuration/#storage
Expand All @@ -134,8 +133,8 @@ def get_config(self, receivers: Sequence[ReceiverProtocol]) -> str:
},
"pool": {
# number of traces per index record
"max_workers": 100,
"queue_depth": 10000,
"max_workers": 400,
"queue_depth": 20000,
},
}
},
Expand Down

0 comments on commit 19e4523

Please sign in to comment.