-
Notifications
You must be signed in to change notification settings - Fork 510
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
Add HTTP endpoint /api/echo to query-frontend #714
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
cmd/tempo/app/modules.go
Outdated
@@ -274,3 +276,13 @@ func (t *App) setupModuleManager() error { | |||
func queryEndpoint(cfg *Config) string { | |||
return cfg.HTTPAPIPrefix + "/api/traces/{traceID}" | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me nit you just a bit more :)!
let's make a single method with some really basic tests:
func applyHTTPPrefix(cfg, path) {
}
Also let's use path.Join
instead of string concat.
Thanks for the work, we're almost there!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! I didn't add a unit test for addHTTPAPIPrefix
because the function is really small and not very error-prone (feel free to disagree on this!).
If we change this logic at some point, the e2e tests should break.
I did notice whoever that the e2e tests don't configure a prefix... What do you think, should I adapt one of the configs to use a prefix?
The echo endpoint can be used by Grafana to test Tempo whether is reachable. grafana#624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
What this PR does:
Adds a new endpoint
/api/echo
that always returns with 200 and a bodyecho
.Which issue(s) this PR fixes:
Closes #624
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]