Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add semconv/v1.19.0 #3848

Merged
merged 11 commits into from May 8, 2023
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -115,6 +115,9 @@ See our [versioning policy](VERSIONING.md) for more information about these stab
- Configuration for each metric instrument in `go.opentelemetry.io/otel/sdk/metric/instrument`. (#3895)
- The internal logging introduces a warning level verbosity equal to `V(1)`. (#3900)
- Added a log message warning about usage of `SimpleSpanProcessor` in production environments. (#3854)
- The `go.opentelemetry.io/otel/semconv/v1.19.0` package. The package contains
semantic conventions from the `v1.19.0` version of the OpenTelemetry
specification. (#3846)

### Changed

Expand Down
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -211,6 +211,7 @@ semconv-generate: | $(SEMCONVGEN) $(SEMCONVKIT)
[ "$(TAG)" ] || ( echo "TAG unset: missing opentelemetry specification tag"; exit 1 )
[ "$(OTEL_SPEC_REPO)" ] || ( echo "OTEL_SPEC_REPO unset: missing path to opentelemetry specification repo"; exit 1 )
$(SEMCONVGEN) -i "$(OTEL_SPEC_REPO)/semantic_conventions/." --only=span -p conventionType=trace -f trace.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
$(SEMCONVGEN) -i "$(OTEL_SPEC_REPO)/semantic_conventions/." --only=attribute_group -p conventionType=trace -f attribute_group.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
$(SEMCONVGEN) -i "$(OTEL_SPEC_REPO)/semantic_conventions/." --only=event -p conventionType=event -f event.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
$(SEMCONVGEN) -i "$(OTEL_SPEC_REPO)/semantic_conventions/." --only=resource -p conventionType=resource -f resource.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
$(SEMCONVKIT) -output "$(SEMCONVPKG)/$(TAG)" -tag "$(TAG)"
Expand Down
10 changes: 5 additions & 5 deletions internal/tools/semconvkit/templates/httpconv/http.go.tmpl
Expand Up @@ -21,7 +21,7 @@ import (

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/semconv/internal/v2"
"go.opentelemetry.io/otel/semconv/internal/v3"
semconv "go.opentelemetry.io/otel/semconv/{{.TagVer}}"
)

Expand Down Expand Up @@ -54,7 +54,7 @@ var (
HTTPStatusCodeKey: semconv.HTTPStatusCodeKey,
HTTPTargetKey: semconv.HTTPTargetKey,
HTTPURLKey: semconv.HTTPURLKey,
HTTPUserAgentKey: semconv.HTTPUserAgentKey,
UserAgentOriginalKey: semconv.UserAgentOriginalKey,
pellared marked this conversation as resolved.
Show resolved Hide resolved
}
)

Expand Down Expand Up @@ -108,7 +108,7 @@ func ClientStatus(code int) (codes.Code, string) {
// The following attributes are always returned: "http.method", "http.scheme",
// "http.flavor", "http.target", "net.host.name". The following attributes are
// returned if they related values are defined in req: "net.host.port",
// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id",
// "net.sock.peer.addr", "net.sock.peer.port", "user_agent.original", "enduser.id",
// "http.client_ip".
func ServerRequest(server string, req *http.Request) []attribute.KeyValue {
return hc.ServerRequest(server, req)
Expand All @@ -128,7 +128,7 @@ func ServerStatus(code int) (codes.Code, string) {
// security risk - explicit configuration helps avoid leaking sensitive
// information.
//
// The User-Agent header is already captured in the http.user_agent attribute
// The User-Agent header is already captured in the user_agent.original attribute
// from ClientRequest and ServerRequest. Instrumentation may provide an option
// to capture that header here even though it is not recommended. Otherwise,
// instrumentation should filter that out of what is passed.
Expand All @@ -143,7 +143,7 @@ func RequestHeader(h http.Header) []attribute.KeyValue {
// security risk - explicit configuration helps avoid leaking sensitive
// information.
//
// The User-Agent header is already captured in the http.user_agent attribute
// The User-Agent header is already captured in the user_agent.original attribute
// from ClientRequest and ServerRequest. Instrumentation may provide an option
// to capture that header here even though it is not recommended. Otherwise,
// instrumentation should filter that out of what is passed.
Expand Down
2 changes: 1 addition & 1 deletion internal/tools/semconvkit/templates/netconv/net.go.tmpl
Expand Up @@ -20,7 +20,7 @@ import (
"net"

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/semconv/internal/v2"
"go.opentelemetry.io/otel/semconv/internal/v3"
semconv "go.opentelemetry.io/otel/semconv/{{.TagVer}}"
)

Expand Down