Skip to content

tempo-cli: add migrate config command for 2.x to 3.0 migration - #6982

Merged
mapno merged 11 commits into
grafana:mainfrom
mapno:tempo-cli-migrate-config
May 4, 2026
Merged

tempo-cli: add migrate config command for 2.x to 3.0 migration#6982
mapno merged 11 commits into
grafana:mainfrom
mapno:tempo-cli-migrate-config

Conversation

@mapno

@mapno mapno commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

What this PR does:

Adds a tempo-cli migrate config command that takes a Tempo 2.x configuration file and outputs a valid 3.0 configuration. This eliminates the most error-prone step of the migration — manually editing config files.

tempo-cli migrate config [--kafka-address=<addr>] [--kafka-topic=<topic>] [--mode=<monolithic|microservices>] <2.x-config.yaml>

The command migrates the config by:

  • Removing v2.x-only blocks ingester, ingester_client, compactor, metrics_generator_client
  • (Distributed mode) Adds ingest.kafka.{address,topic}
  • Removes local_blocks processor config and local-blocks from processors lists
  • Verifies overrides aren't in legacy format
  • Sets overrides.defaults.compaction.compaction_disabled: true (part of the migration)

Which issue(s) this PR fixes:
Fixes #6979

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]
Copilot AI review requested due to automatic review settings April 16, 2026 13:43
mapno added 2 commits April 16, 2026 15:48
Query all blocks regardless of replication factor for non-metrics paths
(search, tags, trace-by-ID). Metrics queries continue to filter RF1-only.

The rf1_after config field is kept but deprecated for YAML backward
compatibility. Proto fields are marked deprecated for wire compatibility.

Fixes grafana#6960
@mapno
mapno force-pushed the tempo-cli-migrate-config branch from 9830218 to 9b970d6 Compare April 16, 2026 13:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new tempo-cli migrate config command to help migrate Tempo 2.x YAML configs to a Tempo 3.0-compatible config, and it removes/deprecates the rf1_after / RF1After filtering behavior across HTTP/API, frontend sharding, and backend block selection so non-metrics query paths now query all blocks regardless of replication factor.

Changes:

  • Add tempo-cli migrate config implementation, test suite, and YAML fixtures.
  • Deprecate/ignore query_frontend.rf1_after and stop parsing/propagating rf1After across HTTP APIs, frontend sharders, and tempodb searches.
  • Update docs/examples/integration configs and tests to reflect the new “query all blocks” behavior.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tempodb/tempodb.go Removes RF1After-based block filtering in backend searches.
tempodb/tempodb_test.go Updates unit tests for new includeBlock/includeCompactedBlock signatures.
tempodb/encoding/common/interfaces.go Removes RF1After from SearchOptions.
pkg/tempopb/tempo.proto Marks RF1After fields deprecated in protobuf requests.
pkg/tempopb/tempo.pb.go Regenerates protobuf Go code reflecting deprecated RF1After.
pkg/api/http.go Removes rf1After query param support and updates request validation/building.
pkg/api/http_test.go Updates validation tests for the new return signature (no rf1After).
pkg/api/search_tags.go Removes rf1After parsing from tag/tag-values request parsing.
modules/querier/querier.go Stops copying RF1After into backend search options for TraceByID.
modules/querier/http.go Stops accepting/logging/propagating rf1After in TraceByID handlers.
modules/frontend/util.go Replaces RF-based block filter with acceptAllBlocks.
modules/frontend/search_sharder.go Removes RF1After-based filtering of blocks for search sharding.
modules/frontend/search_sharder_test.go Removes RF1After-specific sharder test.
modules/frontend/tag_sharder.go Removes RF1After logic from tag/tag-values sharding.
modules/frontend/tag_sharder_test.go Removes RF1After method from fake request used in tests.
modules/frontend/traceid_sharder.go Stops propagating rf1After into sharded TraceByID requests.
modules/frontend/traceid_handlers.go Updates request validation call signature (no rf1After).
modules/frontend/search_handlers_test.go Updates expected job/block metrics due to querying all blocks.
modules/frontend/frontend.go Removes RF1After propagation into sharder config; updates filterFn comment.
modules/frontend/config.go Marks rf1_after config as deprecated/ignored (omitempty + comment).
cmd/tempo/app/config.go Adds startup warning when query_frontend.rf1_after is set.
cmd/tempo-vulture/main.go Removes vulture rhythm-rf1-after flag and query param injection.
integration/util/config-base.yaml Removes query_frontend.rf1_after from integration base config.
example/docker-compose/*/tempo.yaml Removes query_frontend.rf1_after from example configs.
docs/sources/tempo/configuration/manifest.md Removes rf1_after from the generated manifest snippet.
cmd/tempo-cli/main.go Wires new tempo-cli migrate config subcommand.
cmd/tempo-cli/cmd-migrate-config.go Implements the new migrate-config command.
cmd/tempo-cli/cmd-migrate-config_test.go Adds unit + end-to-end style tests for migrate-config logic.
cmd/tempo-cli/test-data/migrate-config/*.yaml Adds input fixtures for migrate-config tests.
CHANGELOG.md Adds a changelog entry related to rf1_after deprecation.
Comment thread cmd/tempo-cli/cmd-migrate-config.go Outdated
Comment thread cmd/tempo-cli/cmd-migrate-config_test.go
Comment thread CHANGELOG.md
Comment thread cmd/tempo-cli/cmd-migrate-config.go Outdated
Comment thread cmd/tempo-cli/cmd-migrate-config.go
@mapno
mapno force-pushed the tempo-cli-migrate-config branch from 9b970d6 to 029920c Compare April 16, 2026 15:29
@knylander-grafana

Copy link
Copy Markdown
Contributor

This is great! We'll definitely need to mention this in the docs.

Adds a new CLI command that takes a Tempo 2.x configuration file and
outputs a valid 3.0 configuration, working at the map[string]interface{}
level to preserve unknown fields and env var references.

The command detects deployment mode (monolithic vs microservices),
removes 2.x-only blocks (ingester, compactor, etc.), adds Kafka ingest
config for microservices mode, sets compaction_disabled in overrides,
and strips the removed local-blocks metrics generator processor.
Copilot AI review requested due to automatic review settings April 20, 2026 11:40
@mapno
mapno force-pushed the tempo-cli-migrate-config branch from 029920c to 9f48348 Compare April 20, 2026 11:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new tempo-cli migrate config command to help users migrate Tempo 2.x config files to a Tempo 3.0-compatible configuration, alongside docs, tests, and changelog updates.

Changes:

  • Introduces tempo-cli migrate config to transform 2.x YAML configs (remove obsolete blocks, add ingest Kafka config in microservices mode, adjust overrides, strip local-blocks processor).
  • Adds end-to-end and unit tests plus YAML fixtures covering common migration scenarios (env vars, legacy overrides detection, local-blocks cleanup).
  • Updates docs (upgrade guide + tempo-cli reference) and adds a changelog entry for the new CLI command.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
docs/sources/tempo/set-up-for-tracing/setup-tempo/upgrade.md Links the upgrade guide to the new tempo-cli migrate config command.
docs/sources/tempo/operations/tempo_cli.md Documents the new migrate config command, flags, and caveats.
cmd/tempo-cli/test-data/migrate-config/with-per-tenant-override-config-input.yaml Fixture covering per_tenant_override_config warning behavior.
cmd/tempo-cli/test-data/migrate-config/with-local-blocks-input.yaml Fixture covering removal of local_blocks config + local-blocks processor entry.
cmd/tempo-cli/test-data/migrate-config/with-env-vars-input.yaml Fixture covering ${VAR} preservation / validation skip behavior.
cmd/tempo-cli/test-data/migrate-config/no-target-input.yaml Fixture covering default mode detection when target is absent.
cmd/tempo-cli/test-data/migrate-config/monolithic-basic-input.yaml Fixture for basic monolithic migration inputs.
cmd/tempo-cli/test-data/migrate-config/microservices-basic-input.yaml Fixture for basic microservices migration inputs (Kafka required).
cmd/tempo-cli/test-data/migrate-config/legacy-overrides-input.yaml Fixture for legacy overrides detection erroring out.
cmd/tempo-cli/main.go Wires the new migrate config subcommand into tempo-cli.
cmd/tempo-cli/cmd-migrate-config_test.go Adds unit + end-to-end tests for config migration helpers.
cmd/tempo-cli/cmd-migrate-config.go Implements the migrate config command and helper functions.
CHANGELOG.md Adds a [FEATURE] entry for the new command.
Comment thread cmd/tempo-cli/cmd-migrate-config.go
Comment thread docs/sources/tempo/operations/tempo_cli.md Outdated
Comment thread docs/sources/tempo/set-up-for-tracing/setup-tempo/upgrade.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 20, 2026 12:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new tempo-cli migrate config subcommand intended to help operators migrate Tempo 2.x YAML configs to a Tempo 3.0-compatible config, and documents it in the upgrade guide and CLI docs.

Changes:

  • Introduces tempo-cli migrate config command that rewrites a 2.x config at the YAML-map level (drop removed blocks, add ingest.kafka in microservices mode, adjust overrides, remove local-blocks processor) and then validates against Tempo’s 3.0 config.
  • Adds end-to-end and unit tests plus YAML fixtures for common migration scenarios (env vars, local-blocks, legacy overrides, etc.).
  • Updates docs (upgrade guide + tempo-cli docs) and adds a changelog entry for the new command.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
docs/sources/tempo/set-up-for-tracing/setup-tempo/upgrade.md Mentions the new CLI command in the 3.0 upgrade breaking-changes list.
docs/sources/tempo/operations/tempo_cli.md Documents tempo-cli migrate config usage, behavior, and warnings.
cmd/tempo-cli/main.go Wires the new migrate config command into the CLI.
cmd/tempo-cli/cmd-migrate-config.go Implements config migration + validation for 2.x → 3.0.
cmd/tempo-cli/cmd-migrate-config_test.go Unit + end-to-end tests for migration behavior.
cmd/tempo-cli/test-data/migrate-config/*.yaml Migration fixtures for test coverage.
CHANGELOG.md Adds release note entry for the new CLI command.
Comment thread cmd/tempo-cli/cmd-migrate-config.go Outdated
Comment thread cmd/tempo-cli/cmd-migrate-config.go
Comment thread docs/sources/tempo/set-up-for-tracing/setup-tempo/upgrade.md Outdated
Comment thread docs/sources/tempo/operations/tempo_cli.md Outdated
Comment thread cmd/tempo-cli/cmd-migrate-config_test.go
@mapno
mapno marked this pull request as ready for review April 20, 2026 14:44
Copilot AI review requested due to automatic review settings April 20, 2026 14:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new tempo-cli migrate config command intended to automate much of the Tempo 2.x → 3.0 configuration migration workflow, plus accompanying docs, test coverage, and changelog entry.

Changes:

  • Introduces tempo-cli migrate config to transform a 2.x YAML config into a 3.0-compatible config map (remove obsolete sections, add ingest.kafka in microservices mode, adjust overrides, remove local-blocks MG config).
  • Adds end-to-end and unit tests plus YAML fixtures for common migration scenarios (env vars, legacy overrides, local-blocks, etc.).
  • Documents the command and references it from the 3.0 upgrade guide; adds a changelog entry.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
docs/sources/tempo/set-up-for-tracing/setup-tempo/upgrade.md Mentions using tempo-cli migrate config during 3.0 upgrade and clarifies ingest.kafka expectations.
docs/sources/tempo/operations/tempo_cli.md Adds documentation section for the new migrate config command.
cmd/tempo-cli/test-data/migrate-config/with-per-tenant-override-config-input.yaml Fixture for external per-tenant override config warning path.
cmd/tempo-cli/test-data/migrate-config/with-local-blocks-input.yaml Fixture covering local_blocks removal and processor list cleanup.
cmd/tempo-cli/test-data/migrate-config/with-env-vars-input.yaml Fixture ensuring ${VAR} placeholders survive migration.
cmd/tempo-cli/test-data/migrate-config/no-target-input.yaml Fixture for defaulting to monolithic when target is absent.
cmd/tempo-cli/test-data/migrate-config/monolithic-basic-input.yaml Fixture for basic monolithic migration behavior.
cmd/tempo-cli/test-data/migrate-config/microservices-basic-input.yaml Fixture for microservices mode and required Kafka flags.
cmd/tempo-cli/test-data/migrate-config/legacy-overrides-input.yaml Fixture ensuring legacy overrides format is rejected.
cmd/tempo-cli/main.go Wires the new subcommand into the CLI.
cmd/tempo-cli/cmd-migrate-config_test.go Adds unit + end-to-end tests for migration helpers and behavior.
cmd/tempo-cli/cmd-migrate-config.go Implements the migration command and helper functions.
CHANGELOG.md Adds a [FEATURE] entry for the new command.
Comment thread cmd/tempo-cli/cmd-migrate-config.go
Comment thread cmd/tempo-cli/cmd-migrate-config.go
Comment thread cmd/tempo-cli/cmd-migrate-config.go
Comment thread docs/sources/tempo/set-up-for-tracing/setup-tempo/upgrade.md Outdated
@mapno
mapno force-pushed the tempo-cli-migrate-config branch from 1c8a3fa to c0d21f9 Compare April 21, 2026 09:08
Comment on lines +27 to +34
tag := t.Field(i).Tag.Get("yaml")
if tag == "" || tag == "-" || tag == ",inline" {
continue
}
name, _, _ := strings.Cut(tag, ",")
if name != "" {
fields[name] = struct{}{}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "" and ",inline" are already covered by name != "" after split

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Simplified to just check tag == "-" and rely on name != "" from the split.

Comment thread cmd/tempo-cli/cmd-migrate-config.go Outdated
Comment on lines +138 to +141
ovrMap, ok := overridesRaw.(map[string]interface{})
if !ok {
return nil
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to add a warning that format is not correct?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed. Added an asMap helper and warn when a per-tenant override entry is not a map (the main case where this could indicate malformed user input). Also replaced the repeated raw, ok := m[k]; if ok { v, ok := raw.(map[string]any); if ok { ... } } patterns with a shared extractNestedMap helper — see the other reply thread.

}

// 2. Detect deployment mode
mode := detectMode(m, cmd.Mode, &warnings)

@ruslan-mikhailov ruslan-mikhailov Apr 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think having a structure with methods instead of functions, that can store shared vars like warning list would simplify code a bit

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opted to keep the plain functions for now since each one takes the root map, but I did reduce repetition by factoring out extractNestedMap, asMap, and consolidating removeLocalBlocksProcessorConfig. Happy to revisit the struct+methods approach in a follow-up if you feel strongly — the current structure still shares state via the warnings *[]string param.

Comment thread cmd/tempo-cli/cmd-migrate-config.go Outdated
Comment on lines +261 to +276
mgRaw, ok := m[mgKey]
if !ok {
return
}
mg, ok := mgRaw.(map[string]interface{})
if !ok {
return
}
procRaw, ok := mg["processor"]
if !ok {
return
}
proc, ok := procRaw.(map[string]interface{})
if !ok {
return
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit. This pattern is repetitive in the script.

Proposal for simplification:

func extractAsMap(m map[string]interface{}, nestedKeys []string) (map[string]interface{}, bool) {
	for _, key := range nestedKeys {
		v, ok := m[key]
		if !ok {
			return nil, ok
		}
		m, ok = v.(map[string]interface{})
		if !ok {
			return nil, ok
		}	
	}
	return m, true
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion. Added extractNestedMap(m, path...) (map[string]any, bool) which walks a key path and returns the deepest map. Used it in detectLegacyOverrides, cleanLocalBlocks, removeLocalBlocksProcessorConfig, and removeLocalBlocksFromProcessorList. Eliminated ~30 lines of repetitive cast code.

Comment thread cmd/tempo-cli/cmd-migrate-config.go Outdated
Comment on lines +363 to +365
// validTargets returns the list of valid Tempo 3.0 target values.
func validTargets() []string {
return []string{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can be just var []string or map[string]bool :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Changed yamlFieldNames to return map[string]bool (cleaner membership check with m[k] instead of _, ok := m[k]), and converted validTargets from a function returning []string to a package-level map[string]bool for O(1) lookup.

@@ -0,0 +1,14 @@
target: all

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For these test files, it would be also nice to have*-output.yaml and test that checks that output of an -input files matches it. These files will give clear expectation on how the script works and will be easier to check.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Added *-expected.yaml files for each input and rewrote TestMigrateConfigEndToEnd to run the full command pipeline (including validation) and compare stdout byte-for-byte against the expected file. Covered inputs: monolithic, microservices, no-target, with-local-blocks, with-per-tenant-override-config, with-env-vars, and scalable-single-binary. Error cases still assert on error strings.

# Conflicts:
#	docs/sources/tempo/set-up-for-tracing/setup-tempo/upgrade.md
Copilot AI review requested due to automatic review settings April 24, 2026 10:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new tempo-cli migrate config command to help users migrate Tempo 2.x YAML configs to a Tempo 3.0-compatible config, plus accompanying docs, tests, and changelog entry.

Changes:

  • Introduces tempo-cli migrate config with YAML-map-based rewriting (drop removed top-level blocks, add ingest.kafka in microservices mode, adjust overrides, remove local-blocks processor config) and strict validation.
  • Adds docs describing the new command and updates the upgrade guide to reference it.
  • Adds test data + unit tests for migration helper behavior, and a changelog entry.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
docs/sources/tempo/set-up-for-tracing/setup-tempo/upgrade.md Updates 3.0 upgrade notes and links to the new migrate-config command.
docs/sources/tempo/operations/tempo_cli.md Documents the new tempo-cli migrate config command, flags, and caveats.
cmd/tempo-cli/test-data/migrate-config/*.yaml Adds input fixtures for migration scenarios (monolithic/microservices, env vars, legacy overrides, etc.).
cmd/tempo-cli/main.go Registers the new migrate config subcommand.
cmd/tempo-cli/cmd-migrate-config_test.go Adds unit tests for migration helper functions and end-to-end map transformation.
cmd/tempo-cli/cmd-migrate-config.go Implements the migrate-config command + helpers and validation.
CHANGELOG.md Adds a release note entry for the new CLI command.
Comment thread CHANGELOG.md Outdated
Comment thread cmd/tempo-cli/cmd-migrate-config_test.go Outdated
Comment thread cmd/tempo-cli/cmd-migrate-config_test.go
Comment thread cmd/tempo-cli/cmd-migrate-config.go Outdated
Comment thread docs/sources/tempo/operations/tempo_cli.md Outdated
@knylander-grafana

Copy link
Copy Markdown
Contributor

@mapno Will this work for single binary?

Comment thread docs/sources/tempo/operations/tempo_cli.md Outdated
Comment thread docs/sources/tempo/operations/tempo_cli.md Outdated
Comment thread docs/sources/tempo/operations/tempo_cli.md Outdated
Comment thread docs/sources/tempo/operations/tempo_cli.md Outdated
Comment thread docs/sources/tempo/operations/tempo_cli.md Outdated
Comment thread docs/sources/tempo/operations/tempo_cli.md Outdated

@knylander-grafana knylander-grafana left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving the docs. Well done -- and delighted to see that both microservices and monolithic are included in the doc update.

The main suggestion I have is spelling out configuration instead of using config.

Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 27, 2026 06:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new tempo-cli migrate config command to help operators migrate Tempo 2.x YAML configs to a Tempo 3.0-compatible configuration, and documents the workflow as part of the 2.x→3.0 upgrade path.

Changes:

  • Introduces tempo-cli migrate config that rewrites/removes deprecated 2.x sections, injects ingest.kafka for microservices mode, adjusts overrides to disable compaction during parallel-run migration, and removes local_blocks/local-blocks metrics-generator settings.
  • Adds end-to-end and unit tests plus YAML fixtures for common migration scenarios (env vars, SSB target rewrite, legacy overrides detection, etc.).
  • Updates upgrade docs, CLI docs, and the changelog to reference the new migration command.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
docs/sources/tempo/set-up-for-tracing/setup-tempo/upgrade.md Updates 3.0 upgrade notes to mention config migration + the new CLI command.
docs/sources/tempo/operations/tempo_cli.md Documents tempo-cli migrate config usage, caveats, and examples.
cmd/tempo-cli/main.go Registers the new migrate config subcommand.
cmd/tempo-cli/cmd-migrate-config.go Implements the config migration pipeline, warnings, and validation.
cmd/tempo-cli/cmd-migrate-config_test.go Adds unit + end-to-end tests for migration behaviors.
cmd/tempo-cli/test-data/migrate-config/*.yaml Test fixtures for migration inputs/expected outputs.
CHANGELOG.md Adds a release note entry for the new CLI command.
Comment thread cmd/tempo-cli/cmd-migrate-config_test.go
Comment thread cmd/tempo-cli/cmd-migrate-config_test.go

Migrate a Tempo 2.x configuration file to a valid 3.0 configuration. The command removes obsolete configuration sections (such as `ingester`, `ingester_client`, and `compactor`), adds Kafka ingest configuration for microservices mode, disables compaction in overrides for parallel operation during migration, and strips the removed `local-blocks` metrics-generator processor.

The tool works at the YAML map level rather than rewriting the file from fully decoded Tempo structs, so environment variable references like `${VAR}` are preserved.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good thinking

@mapno
mapno merged commit d324fa9 into grafana:main May 4, 2026
32 checks passed
@mapno
mapno deleted the tempo-cli-migrate-config branch May 4, 2026 10:49
mattdurham pushed a commit to mattdurham/tempo that referenced this pull request Jun 18, 2026
…na#6982)

* Remove rf1_after from query frontend and query paths

Query all blocks regardless of replication factor for non-metrics paths
(search, tags, trace-by-ID). Metrics queries continue to filter RF1-only.

The rf1_after config field is kept but deprecated for YAML backward
compatibility. Proto fields are marked deprecated for wire compatibility.

Fixes grafana#6960

* fmt

* Add tempo-cli migrate config command for 2.x to 3.0 migration

Adds a new CLI command that takes a Tempo 2.x configuration file and
outputs a valid 3.0 configuration, working at the map[string]interface{}
level to preserve unknown fields and env var references.

The command detects deployment mode (monolithic vs microservices),
removes 2.x-only blocks (ingester, compactor, etc.), adds Kafka ingest
config for microservices mode, sets compaction_disabled in overrides,
and strips the removed local-blocks metrics generator processor.

* Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Handle SSB

* -)

* ups

* Fix test

* Address review feedback: extractNestedMap helper, snapshot tests, empty target rewrite

* Apply suggestions from code review

Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants