Skip to content

Commit

Permalink
feat(otel): upgrade semconv to 1.27.0 (#1825)
Browse files Browse the repository at this point in the history
  • Loading branch information
hekike authored Nov 11, 2024
1 parent bdaf6d7 commit c59941c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/common/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
sdkmetric "go.opentelemetry.io/otel/sdk/metric"
"go.opentelemetry.io/otel/sdk/resource"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
semconv "go.opentelemetry.io/otel/semconv/v1.20.0"
semconv "go.opentelemetry.io/otel/semconv/v1.27.0"
"go.opentelemetry.io/otel/trace"

"github.com/openmeterio/openmeter/app/config"
Expand Down Expand Up @@ -52,7 +52,7 @@ func NewTelemetryResource(metadata Metadata) *resource.Resource {
resource.WithAttributes(
semconv.ServiceName(metadata.ServiceName),
semconv.ServiceVersion(metadata.Version),
semconv.DeploymentEnvironment(metadata.Environment),
semconv.DeploymentEnvironmentName(metadata.Environment),
),
)

Expand Down Expand Up @@ -209,7 +209,7 @@ func NewTelemetryRouterHook(meterProvider metric.MeterProvider, tracerProvider t

span := trace.SpanFromContext(r.Context())
span.SetName(routePattern)
span.SetAttributes(semconv.HTTPTarget(r.URL.String()), semconv.HTTPRoute(routePattern))
span.SetAttributes(semconv.URLPath(r.URL.String()), semconv.HTTPRoute(routePattern))

labeler, ok := otelhttp.LabelerFromContext(r.Context())
if ok {
Expand Down
2 changes: 1 addition & 1 deletion pkg/framework/pgdriver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/jackc/pgx/v5/pgxpool"
pgxstdlib "github.com/jackc/pgx/v5/stdlib"
"go.opentelemetry.io/otel/metric"
semconv "go.opentelemetry.io/otel/semconv/v1.20.0"
semconv "go.opentelemetry.io/otel/semconv/v1.27.0"
"go.opentelemetry.io/otel/trace"

"github.com/openmeterio/openmeter/pkg/pgxpoolobserver"
Expand Down

0 comments on commit c59941c

Please sign in to comment.