FrontendService: Add tracing to frontend service (#107236)

* FrontendService: Add tracing to frontend service

* wire gen

* fix test
This commit is contained in:
Josh Hunt
2025-07-09 19:21:31 +01:00
committed by GitHub
parent 9aaaa87bcf
commit 37bfea8685
6 changed files with 26 additions and 2 deletions
@@ -8,6 +8,7 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"go.opentelemetry.io/otel"
"github.com/grafana/dskit/services"
"github.com/grafana/grafana/pkg/infra/log"
@@ -15,6 +16,8 @@ import (
"github.com/grafana/grafana/pkg/setting"
)
var tracer = otel.Tracer("github.com/grafana/grafana/pkg/services/frontend")
type frontendService struct {
*services.BasicService
cfg *setting.Cfg
+3
View File
@@ -79,6 +79,9 @@ func NewIndexProvider(cfg *setting.Cfg, license licensing.Licensing) (*IndexProv
}
func (p *IndexProvider) HandleRequest(writer http.ResponseWriter, request *http.Request) {
_, span := tracer.Start(request.Context(), "frontend.index.HandleRequest")
defer span.End()
if request.Method != "GET" {
writer.WriteHeader(http.StatusMethodNotAllowed)
return