Skip to content

Commit

Permalink
Add HTTP endpoint /api/echo to query-frontend
Browse files Browse the repository at this point in the history
The echo endpoint can be used by Grafana to test Tempo whether is reachable. #624
  • Loading branch information
yvrhdn committed May 27, 2021
1 parent cb551a3 commit 5627308
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
This change requires a specific rollout process to prevent dropped spans. First, rollout everything except distributors. After all ingesters have updated
you can then rollout distributors to the latest version. This is due to changes in the communication between ingesters <-> distributors.
* [ENHANCEMENT] Allow setting the bloom filter shard size with support dynamic shard count.[#644](https://github.com/grafana/tempo/pull/644)
* [ENHANCEMENT] Add a new endpoint `/api/echo` to test the query frontend is reachable. [#714](https://github.com/grafana/tempo/pull/714)
* [CHANGE] Fix Query Frontend grpc settings to avoid noisy error log. [#690](https://github.com/grafana/tempo/pull/690)
* [CHANGE] GCS SDK update v1.12.0 => v.15.0, ReadAllWithEstimate used in GCS/S3 backends. [#693](https://github.com/grafana/tempo/pull/693)

Expand Down
8 changes: 8 additions & 0 deletions cmd/tempo/app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ func (t *App) initQueryFrontend() (services.Service, error) {
// http query endpoint
t.server.HTTP.Handle(queryEndpoint(&t.cfg), tracesHandler)

t.server.HTTP.Handle("/api/echo", echoHandler())

return t.frontend, nil
}

Expand Down Expand Up @@ -274,3 +276,9 @@ func (t *App) setupModuleManager() error {
func queryEndpoint(cfg *Config) string {
return cfg.HTTPAPIPrefix + "/api/traces/{traceID}"
}

func echoHandler() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
http.Error(w, "echo", http.StatusOK)
}
}

0 comments on commit 5627308

Please sign in to comment.