Skip to content

Commit 8445f21

Browse files
pellaredhanyuancheungMrAlias
authored
Add semconv/v1.20.0 (#4078)
* Add semconv/v1.20.0 * Update changelog * Change http.flavor to net.protocol.(name|version) * Update comments in httpconv * Fix vanity import * Update CHANGELOG.md Co-authored-by: Tyler Yahn <[email protected]> --------- Co-authored-by: Chester Cheung <[email protected]> Co-authored-by: Tyler Yahn <[email protected]>
1 parent fadd3d6 commit 8445f21

File tree

18 files changed

+7996
-12
lines changed

18 files changed

+7996
-12
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
88

99
## [Unreleased]
1010

11+
### Added
12+
13+
- The `go.opentelemetry.io/otel/semconv/v1.20.0` package.
14+
The package contains semantic conventions from the `v1.20.0` version of the OpenTelemetry specification. (#4078)
15+
1116
### Removed
1217

1318
- The deprecated `go.opentelemetry.io/otel/metric/instrument` package is removed.

RELEASING.md

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ For example,
1414
```sh
1515
export TAG="v1.13.0" # Change to the release version you are generating.
1616
export OTEL_SPEC_REPO="/absolute/path/to/opentelemetry-specification"
17-
git -C "$OTEL_SPEC_REPO" checkout "tags/$TAG" -b "$TAG"
1817
docker pull otel/semconvgen:latest
1918
make semconv-generate # Uses the exported TAG and OTEL_SPEC_REPO.
2019
```

internal/tools/semconvkit/templates/httpconv/http.go.tmpl

+12-10
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121

2222
"go.opentelemetry.io/otel/attribute"
2323
"go.opentelemetry.io/otel/codes"
24-
"go.opentelemetry.io/otel/semconv/internal/v3"
24+
"go.opentelemetry.io/otel/semconv/internal/v4"
2525
semconv "go.opentelemetry.io/otel/semconv/{{.TagVer}}"
2626
)
2727

@@ -44,7 +44,8 @@ var (
4444

4545
EnduserIDKey: semconv.EnduserIDKey,
4646
HTTPClientIPKey: semconv.HTTPClientIPKey,
47-
HTTPFlavorKey: semconv.HTTPFlavorKey,
47+
NetProtocolNameKey: semconv.NetProtocolNameKey,
48+
NetProtocolVersionKey: semconv.NetProtocolVersionKey,
4849
HTTPMethodKey: semconv.HTTPMethodKey,
4950
HTTPRequestContentLengthKey: semconv.HTTPRequestContentLengthKey,
5051
HTTPResponseContentLengthKey: semconv.HTTPResponseContentLengthKey,
@@ -74,10 +75,11 @@ func ClientResponse(resp *http.Response) []attribute.KeyValue {
7475
}
7576

7677
// ClientRequest returns trace attributes for an HTTP request made by a client.
77-
// The following attributes are always returned: "http.url", "http.flavor",
78-
// "http.method", "net.peer.name". The following attributes are returned if the
79-
// related values are defined in req: "net.peer.port", "http.user_agent",
80-
// "http.request_content_length", "enduser.id".
78+
// The following attributes are always returned: "http.url",
79+
// "net.protocol.(name|version)", "http.method", "net.peer.name".
80+
// The following attributes are returned if the related values are defined
81+
// in req: "net.peer.port", "http.user_agent", "http.request_content_length",
82+
// "enduser.id".
8183
func ClientRequest(req *http.Request) []attribute.KeyValue {
8284
return hc.ClientRequest(req)
8385
}
@@ -106,10 +108,10 @@ func ClientStatus(code int) (codes.Code, string) {
106108
// The req Host will be used to determine the server instead.
107109
//
108110
// The following attributes are always returned: "http.method", "http.scheme",
109-
// "http.flavor", "http.target", "net.host.name". The following attributes are
110-
// returned if they related values are defined in req: "net.host.port",
111-
// "net.sock.peer.addr", "net.sock.peer.port", "user_agent.original", "enduser.id",
112-
// "http.client_ip".
111+
// ""net.protocol.(name|version)", "http.target", "net.host.name".
112+
// The following attributes are returned if they related values are defined
113+
// in req: "net.host.port", "net.sock.peer.addr", "net.sock.peer.port",
114+
// "user_agent.original", "enduser.id", "http.client_ip".
113115
func ServerRequest(server string, req *http.Request) []attribute.KeyValue {
114116
return hc.ServerRequest(server, req)
115117
}

internal/tools/semconvkit/templates/netconv/net.go.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"net"
2121

2222
"go.opentelemetry.io/otel/attribute"
23-
"go.opentelemetry.io/otel/semconv/internal/v3"
23+
"go.opentelemetry.io/otel/semconv/internal/v4"
2424
semconv "go.opentelemetry.io/otel/semconv/{{.TagVer}}"
2525
)
2626

0 commit comments

Comments
 (0)