Start using otel in storage/unified/resource (#102616)

* Start using otel storage/unified/resource

* make update-workspace

* Go mod build owners

* Make workspace-update

* Update pkg/storage/unified/resource/access.go

Co-authored-by: maicon <maiconscosta@gmail.com>

* Add introduced pkg/apis to dependabot file

* Revert "Update pkg/storage/unified/resource/access.go"

This reverts commit f50e29d0394e48d5cd5bfbab154cb83da0b2f8b2.

* Revert "Update pkg/storage/unified/resource/access.go"

This reverts commit f50e29d0394e48d5cd5bfbab154cb83da0b2f8b2.

* Use traceid only

---------

Co-authored-by: maicon <maiconscosta@gmail.com>
This commit is contained in:
Leonor Oliveira
2025-03-31 09:58:01 -03:00
committed by GitHub
co-authored by maicon
parent f7af15eb33
commit c3b039f3a2
5 changed files with 16 additions and 12 deletions
+2 -3
View File
@@ -14,7 +14,6 @@ import (
"go.opentelemetry.io/otel/trace/noop"
claims "github.com/grafana/authlib/types"
"github.com/grafana/grafana/pkg/infra/tracing"
"github.com/grafana/grafana/pkg/services/authn/grpcutils"
)
@@ -149,7 +148,7 @@ func (c authzLimitedClient) Check(ctx context.Context, id claims.AuthInfo, req c
}
resp, err := c.client.Check(ctx, id, req)
if err != nil {
c.logger.Error("Check", "group", req.Group, "resource", req.Resource, "error", err, "duration", time.Since(t), "traceid", tracing.TraceIDFromContext(ctx, false))
c.logger.Error("Check", "group", req.Group, "resource", req.Resource, "error", err, "duration", time.Since(t), "traceid", trace.SpanContextFromContext(ctx).TraceID().String())
c.metrics.errorsTotal.WithLabelValues(req.Group, req.Resource, req.Verb).Inc()
span.SetStatus(codes.Error, fmt.Sprintf("check failed: %v", err))
span.RecordError(err)
@@ -199,7 +198,7 @@ func (c authzLimitedClient) Compile(ctx context.Context, id claims.AuthInfo, req
}
checker, err := c.client.Compile(ctx, id, req)
if err != nil {
c.logger.Error("Compile", "group", req.Group, "resource", req.Resource, "error", err, "traceid", tracing.TraceIDFromContext(ctx, false))
c.logger.Error("Compile", "group", req.Group, "resource", req.Resource, "error", err, "traceid", trace.SpanContextFromContext(ctx).TraceID().String())
c.metrics.errorsTotal.WithLabelValues(req.Group, req.Resource, req.Verb).Inc()
span.SetStatus(codes.Error, fmt.Sprintf("compile failed: %v", err))
span.RecordError(err)