Skip to content

feat: Add option to run tempo-vulture in validation mode - #5605

Merged
zalegrala merged 36 commits into
mainfrom
feature/add-option-to-run-once-and-exit
Oct 8, 2025
Merged

feat: Add option to run tempo-vulture in validation mode#5605
zalegrala merged 36 commits into
mainfrom
feature/add-option-to-run-once-and-exit

Conversation

@davidham

@davidham davidham commented Sep 3, 2025

Copy link
Copy Markdown
Contributor

What this PR does:
This PR adds a validation mode to tempo-vulture that allows it to be used as a post-deployment validation test. It does similar work to tempo-vulture, but instead of running continuously and reporting its results as metrics, it will create n traces (determined by the --validation-cycles flag) and attempt to read them back by ID, and query for them, and then exit. It will exit 0 if all operations succeed and exit 1 if any fail.

I tested this against the example/docker-compose/distributed Docker Compose file. The search validations did not pass but I intend to try them against our federal dev environment and see if they work there.

Which issue(s) this PR fixes:
Relates to grafana/deployment_tools#294598.

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]
@CLAassistant

CLAassistant commented Sep 3, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@davidham
davidham force-pushed the feature/add-option-to-run-once-and-exit branch from 93a50aa to 4f0331a Compare September 4, 2025 19:04
@davidham
davidham marked this pull request as ready for review September 4, 2025 21:59
@davidham davidham changed the title feat: Add option to run once and exit Sep 4, 2025
@davidham
davidham marked this pull request as draft September 5, 2025 21:13
@davidham

davidham commented Sep 5, 2025

Copy link
Copy Markdown
Contributor Author

Changing back to draft so I can add basic auth.

@davidham
davidham force-pushed the feature/add-option-to-run-once-and-exit branch from 5074b3d to 021cc90 Compare September 9, 2025 15:10
@davidham
davidham marked this pull request as ready for review September 9, 2025 15:33

@zalegrala zalegrala 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.

Overall this is looking reasonable. I left a few thoughts.

Comment thread cmd/tempo-vulture/main.go Outdated
Comment thread cmd/tempo-vulture/main.go
Comment thread cmd/tempo-vulture/main.go Outdated
Comment thread cmd/tempo-vulture/main.go Outdated
Comment thread cmd/tempo-vulture/validation.go Outdated
@davidham
davidham force-pushed the feature/add-option-to-run-once-and-exit branch from 021cc90 to efa491b Compare September 10, 2025 22:23

@zalegrala zalegrala 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.

This is looking reasonable. I left a few more thoughts.

Comment thread cmd/tempo-vulture/validation.go Outdated
) int {
accessPolicyToken := os.Getenv("TEMPO_ACCESS_POLICY_TOKEN")
if accessPolicyToken == "" {
logger.Error("TEMPO_ACCESS_POLICY_TOKEN environment variable is required in validation mode")

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.

Consider making this optional for use and testing without auth.

Comment thread cmd/tempo-vulture/mocks.go
Comment thread cmd/tempo-vulture/validation.go
Comment thread cmd/tempo-vulture/main_test.go
Comment thread cmd/tempo-vulture/validation.go Outdated
Comment thread cmd/tempo-vulture/validation.go Outdated
Comment thread integration/util/util.go Outdated
Comment thread integration/util/util.go
Comment thread pkg/util/trace_info.go Outdated
@davidham
davidham force-pushed the feature/add-option-to-run-once-and-exit branch from a76462b to 79d00a3 Compare September 29, 2025 21:04

@zalegrala zalegrala 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.

This looks reasonable to me. Thanks for addressing some of the comments.

@zalegrala
zalegrala merged commit 4ef9e15 into main Oct 8, 2025
22 checks passed
@zalegrala
zalegrala deleted the feature/add-option-to-run-once-and-exit branch October 8, 2025 14:50
This was referenced Jan 21, 2026
mattdurham pushed a commit to mattdurham/tempo that referenced this pull request Jun 18, 2026
* feat: Read/write validation working, simple search

* feat: WIP on adding search for each trace

* feat: exposed port 4317

* feat: Extracted write, read, search into separate methods

* feat: Updated to use new service code

* feat: Added MockClock; fixed an error in a prev mock

* feat: Added tests for the three parts of the validation

* feat: Added runValidation test

* docs: Updated changelog

* docs: CHANGELOG.md without Prettier LOL

* fix: Updates for linter

* fix: more linter changes

* feat: Added new methods to create OTLP exporters with auth enabled

Also updated old functions to call the new, for backward compatibility

* feat: Added TempoBasicAuthToken to ValidationConfig

* feat: Updated to use new auth-enabled versions

* feat: Added EmitBatchesWithContext

* feat: Moved validationConfig setup to its own function

* chore: lowercase errors

* feat: Added context-aware methods

* feat: Added methods to mocks

* fix: return 1 rather than exit

* renamed sleep method

* fix: linter issue

* WIP on validateTraceSearch

* feat: Set ingester rf to 3; formatting

* feat: Test updates

* fix: linter issues

* fix: moar linter issues

* feat: Made TEMPO_ACCESS_POLICY_TOKEN a const

* feat: Also moved defer() statement

* feat: PR comment fixes

- Use debug level in that debug function
- return err instead of ctx.Err()
- Update vs.sleepWithContext to use the vs.clock so it's faster in tests

* feat: Add constants for headers

* feat: Refactor for withContext

Merged all of my new 'withContext' metjods with their originals, and updated all the callers to pass in context.Background() so it would compile

* feat: Update to use the new const

* docs: Changelog formatting

* feat: rename header
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants