From c2ccb76d651dca21587dfb84eac58acefec3829a Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Fri, 12 Jul 2024 12:21:41 -0700 Subject: [PATCH] Update Go inst semconv examples --- content/en/docs/languages/go/instrumentation.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/content/en/docs/languages/go/instrumentation.md b/content/en/docs/languages/go/instrumentation.md index 37b4992c0d7e..98c871e0b7c5 100644 --- a/content/en/docs/languages/go/instrumentation.md +++ b/content/en/docs/languages/go/instrumentation.md @@ -39,7 +39,7 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/sdk/resource" sdktrace "go.opentelemetry.io/otel/sdk/trace" - semconv "go.opentelemetry.io/otel/semconv/v1.21.0" + semconv "go.opentelemetry.io/otel/semconv/v1.26.0" "go.opentelemetry.io/otel/trace" ) @@ -187,7 +187,7 @@ span.SetAttributes(myKey.String("a value")) Semantic Attributes are attributes that are defined by the [OpenTelemetry Specification][] in order to provide a shared set of attribute keys across multiple languages, frameworks, and runtimes for common concepts like HTTP methods, status -codes, user agents, and more. These attributes are available in the `go.opentelemetry.io/otel/semconv/v1.21.0` +codes, user agents, and more. These attributes are available in the `go.opentelemetry.io/otel/semconv/v1.26.0` package. For details, see [Trace semantic conventions][]. @@ -364,7 +364,7 @@ import ( "go.opentelemetry.io/otel/exporters/stdout/stdoutmetric" "go.opentelemetry.io/otel/sdk/metric" "go.opentelemetry.io/otel/sdk/resource" - semconv "go.opentelemetry.io/otel/semconv/v1.21.0" + semconv "go.opentelemetry.io/otel/semconv/v1.26.0" ) func main() { @@ -753,7 +753,7 @@ import ( "net/http" "go.opentelemetry.io/otel/metric" - semconv "go.opentelemetry.io/otel/semconv/v1.21.0" + semconv "go.opentelemetry.io/otel/semconv/v1.26.0" ) func init() { @@ -769,7 +769,7 @@ func init() { // do some work in an API call and set the response HTTP status code apiCounter.Add(r.Context(), 1, - metric.WithAttributes(semconv.HTTPStatusCode(statusCode))) + metric.WithAttributes(semconv.HTTPResponseStatusCode(statusCode))) }) } ``` @@ -1001,7 +1001,7 @@ import ( "go.opentelemetry.io/otel/log/global" "go.opentelemetry.io/otel/sdk/log" "go.opentelemetry.io/otel/sdk/resource" - semconv "go.opentelemetry.io/otel/semconv/v1.21.0" + semconv "go.opentelemetry.io/otel/semconv/v1.26.0" ) func main() {