Skip to content

Commit

Permalink
Update Go instrumentation semconv examples (open-telemetry#4833)
Browse files Browse the repository at this point in the history
Co-authored-by: Sam Xie <[email protected]>
Co-authored-by: Phillip Carter <[email protected]>
  • Loading branch information
3 people authored Jul 12, 2024
1 parent 7fd0d2a commit dc79770
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions content/en/docs/languages/go/instrumentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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][].
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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() {
Expand All @@ -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)))
})
}
```
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit dc79770

Please sign in to comment.