Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flesh out single-binary jsonnet a bit #1391

Merged
merged 3 commits into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* [CHANGE] Add warning threshold for TempoIngesterFlushes and adjust critical threshold [#1354](https://github.com/grafana/tempo/pull/1354) (@zalegrala)
* [CHANGE] Include lambda in serverless e2e tests [#1357](https://github.com/grafana/tempo/pull/1357) (@zalegrala)
* [CHANGE] Replace mixin TempoIngesterFlushes metric to only look at retries [#1354](https://github.com/grafana/tempo/pull/1354) (@zalegrala)
* [CHANGE] Update the jsonnet for single-binary to include clustering [#1391](https://github.com/grafana/tempo/pull/1391) (@zalegrala)
**BREAKING CHANGE** After this change, the port specification has moved under `$._config.tempo` to avoid global port spec.
* [FEATURE]: v2 object encoding added. This encoding adds a start/end timestamp to every record to reduce proto marshalling and increase search speed.
**BREAKING CHANGE** After this rollout the distributors will use a new API on the ingesters. As such you must rollout all ingesters before rolling the
distributors. Also, during this period, the ingesters will use considerably more resources and as such should be scaled up (or incoming traffic should be
Expand Down
34 changes: 19 additions & 15 deletions operations/jsonnet/single-binary/config.libsonnet
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
{
_images+:: {
tempo: 'grafana/tempo:latest',
tempo_query: 'grafana/tempo-query:latest',
tempo_vulture: 'grafana/tempo-vulture:latest',
},
_images+:: {
tempo: 'grafana/tempo:latest',
tempo_query: 'grafana/tempo-query:latest',
tempo_vulture: 'grafana/tempo-vulture:latest',
},

_config+:: {
port: 3200,
pvc_size: error 'Must specify a pvc size',
pvc_storage_class: error 'Must specify a pvc storage class',
receivers: error 'Must specify receivers',
ballast_size_mbs: '1024',
jaeger_ui: {
base_path: '/',
},
search_enabled: false,
_config+:: {
tempo: {
port: 3200,
replicas: 1,
headless_service_name: 'tempo-members',
},
pvc_size: error 'Must specify a pvc size',
pvc_storage_class: error 'Must specify a pvc storage class',
receivers: error 'Must specify receivers',
ballast_size_mbs: '1024',
jaeger_ui: {
base_path: '/',
},
search_enabled: false,
},
}
32 changes: 22 additions & 10 deletions operations/jsonnet/single-binary/configmap.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,40 @@
tempo_config:: {
search_enabled: $._config.search_enabled,
server: {
http_listen_port: $._config.port
http_listen_port: $._config.tempo.port,
},
distributor: {
receivers: $._config.receivers
receivers: $._config.receivers,
},
ingester: {
},
compactor: {
compaction: {
block_retention: "24h",
}
block_retention: '24h',
},
},
memberlist: {
abort_if_cluster_join_fails: false,
bind_port: 7946,
join_members: [
'%s:7946' % $._config.tempo.headless_service_name,
],
},
storage: {
trace: {
backend: "local",
backend: 'local',
wal: {
path: "/var/tempo/wal",
path: '/var/tempo/wal',
},
'local': {
path: "/tmp/tempo/traces"
path: '/tmp/tempo/traces',
},
}
},
},
querier: {
frontend_worker: {
frontend_address: 'tempo:9095',
},
},
},

Expand All @@ -45,7 +57,7 @@
configMap.new('tempo-query') +
configMap.withData({
'tempo-query.yaml': k.util.manifestYaml({
backend: 'localhost:%d' % $._config.port
})
backend: 'localhost:%d' % $._config.tempo.port,
}),
}),
}
42 changes: 25 additions & 17 deletions operations/jsonnet/single-binary/tempo.libsonnet
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(import 'configmap.libsonnet') +
(import 'config.libsonnet') +
(import 'config.libsonnet') +
{
local k = import 'ksonnet-util/kausal.libsonnet',
local container = k.core.v1.container,
Expand Down Expand Up @@ -37,9 +37,12 @@
tempo_container::
container.new('tempo', $._images.tempo) +
container.withPorts([
containerPort.new('prom-metrics', $._config.port),
containerPort.new('prom-metrics', $._config.tempo.port),
containerPort.new('memberlist', 9095),
containerPort.new('otlp', 4317),
]) +
container.withArgs([
'-target=scalable-single-binary',
'-config.file=/conf/tempo.yaml',
'-mem-ballast-size-mbs=' + $._config.ballast_size_mbs,
]) +
Expand All @@ -66,29 +69,34 @@

tempo_statefulset:
statefulset.new('tempo',
1,
[
$.tempo_container,
$.tempo_query_container,
],
self.tempo_pvc,
{ app: 'tempo' }) +
$._config.tempo.replicas,
[
$.tempo_container,
$.tempo_query_container,
],
self.tempo_pvc,
{ app: 'tempo' }) +
statefulset.mixin.spec.withServiceName('tempo') +
statefulset.mixin.spec.template.metadata.withAnnotations({
config_hash: std.md5(std.toString($.tempo_configmap.data['tempo.yaml'])),
}) +
statefulset.mixin.metadata.withLabels({ app: $._config.tempo.headless_service_name, name: 'tempo' }) +
statefulset.mixin.spec.selector.withMatchLabels({ name: 'tempo' }) +
statefulset.mixin.spec.template.metadata.withLabels({ name: 'tempo', app: $._config.tempo.headless_service_name }) +
statefulset.mixin.spec.template.spec.withVolumes([
volume.fromConfigMap(tempo_query_config_volume, $.tempo_query_configmap.metadata.name),
volume.fromConfigMap(tempo_config_volume, $.tempo_configmap.metadata.name),
]),

tempo_service:
k.util.serviceFor($.tempo_statefulset)
+ service.mixin.spec.withPortsMixin([
servicePort.newNamed(
name='http',
port=80,
targetPort=16686,
),
]),
k.util.serviceFor($.tempo_statefulset),

tempo_headless_service:
service.new(
$._config.tempo.headless_service_name,
{ app: $._config.tempo.headless_service_name },
[]
) +
service.mixin.spec.withClusterIP('None') +
service.mixin.spec.withPublishNotReadyAddresses(true),
}