Skip to content

Commit

Permalink
fix(tempohandler): implement buildinfo handler
Browse files Browse the repository at this point in the history
  • Loading branch information
tdakkota committed May 27, 2024
1 parent 1b8ed9e commit e3ef2ef
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions internal/tempohandler/tempohandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"context"
"fmt"
"net/http"
"runtime"
"strings"
"time"

Expand Down Expand Up @@ -49,6 +50,22 @@ func NewTempoAPI(
}
}

// BuildInfo implements buildInfo operation.
//
// Returns Tempo buildinfo, in the same format as Prometheus `/api/v1/status/buildinfo`.
// Used by Grafana to check Tempo API version.
//
// GET /api/status/buildinfo
func (h *TempoAPI) BuildInfo(ctx context.Context) (*tempoapi.PrometheusVersion, error) {
// defaultTempoVersion is a default Tempo version used by Grafana, in
// case if buildinfo request fails.
const defaultTempoVersion = "2.1.0"
return &tempoapi.PrometheusVersion{
Version: defaultTempoVersion,
GoVersion: runtime.Version(),
}, nil
}

// Echo request for testing, issued by Grafana.
//
// GET /api/echo
Expand Down

0 comments on commit e3ef2ef

Please sign in to comment.