Skip to content

Commit 5e212ba

Browse files
authored
Generate semconv/v1.36.0 (open-telemetry#7032)
Resolve open-telemetry#7030 This generation fixes the following: - The `semconv/weaver.yaml` file is moved to the `semconv/templates/registry/go` to [fix the generation](open-telemetry#7030 (comment)). - Deprecated enum `var`s are no longer generate. - The deprecation of the previous `OSTypeZOS` (`z_os`) conflicts with the replacement (`zos`). - This matches all other generations where deprecated types are not generated and the migration docs identify users need to upgrade when upgrading packages. - Fix metric description rendering to handle multi-line metric descriptions. - Fix filter of deprecated metrics in weaver configuration (see open-telemetry/weaver#847). The release notes for v1.35.0 are included as we do not plan to add a package for that release and it includes breaking changes being released here (i.e. `az.namespace` and `az.service_request_id`) ## [`v1.36.0` semantic convention release notes](https://github.com/open-telemetry/semantic-conventions/releases/tag/v1.36.0) <div data-pjax="true" data-test-selector="body-content" data-view-component="true" class="markdown-body my-3"><h3>🚩 Deprecations 🚩</h3> <ul> <li><code>os</code>: Adds the 'deprecated:' tag/attribute to the <code>z_os</code> enum value of <code>os.type</code>. This value was recently deprecated in v1.35.0. (<a href="open-telemetry/semantic-conventions#2479" data-hovercard-type="pull_request" data-hovercard-url="/open-telemetry/semantic-conventions/pull/2479/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#2479</a>)</li> </ul> <h3>💡 Enhancements 💡</h3> <ul> <li><code>otel</code>: Replaces <code>otel.sdk.span.ended</code> with <code>otel.sdk.span.started</code> and allow differentiation based on the parent span origin (<a href="open-telemetry/semantic-conventions#2431" data-hovercard-type="pull_request" data-hovercard-url="/open-telemetry/semantic-conventions/pull/2431/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#2431</a>)</li> <li><code>db</code>: Add database context propagation via <code>SET CONTEXT_INFO</code> for SQL Server (<a href="open-telemetry/semantic-conventions#2162" data-hovercard-type="issue" data-hovercard-url="/open-telemetry/semantic-conventions/issues/2162/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#2162</a>)</li> <li><code>entities</code>: Adds support for Entity registry and Entity stabilization policies. (<a href="open-telemetry/semantic-conventions#2246" data-hovercard-type="issue" data-hovercard-url="/open-telemetry/semantic-conventions/issues/2246/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#2246</a>)</li> </ul> <h3>🧰 Bug fixes 🧰</h3> <ul> <li><code>cloud</code>: Exclude deprecated Azure members from code generation on the <code>cloud.platform</code> attribute (<a href="open-telemetry/semantic-conventions#2477" data-hovercard-type="pull_request" data-hovercard-url="/open-telemetry/semantic-conventions/pull/2477/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#2477</a>, <a href="open-telemetry/semantic-conventions#2455" data-hovercard-type="issue" data-hovercard-url="/open-telemetry/semantic-conventions/issues/2455/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#2455</a>)</li> </ul> ## [`v1.35.0` semantic convention release notes](https://github.com/open-telemetry/semantic-conventions/releases/tag/v1.35.0) <div data-pjax="true" data-test-selector="body-content" data-view-component="true" class="markdown-body my-3"><h3>🛑 Breaking changes 🛑</h3> <ul> <li> <p><code>azure</code>: Align azure events, attributes, and enum members with general naming guidelines. (<a href="open-telemetry/semantic-conventions#608" data-hovercard-type="issue" data-hovercard-url="/open-telemetry/semantic-conventions/issues/608/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#608</a>, <a href="open-telemetry/semantic-conventions#1708" data-hovercard-type="pull_request" data-hovercard-url="/open-telemetry/semantic-conventions/pull/1708/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#1708</a>, <a href="open-telemetry/semantic-conventions#1698" data-hovercard-type="pull_request" data-hovercard-url="/open-telemetry/semantic-conventions/pull/1698/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#1698</a>)</p> <ul> <li>Renamed attributes: <ul> <li><code>az.service_request_id</code> to <code>azure.service.request.id</code></li> <li><code>az.namespace</code> to <code>azure.resource_provider.namespace</code></li> </ul> </li> <li>Renamed events: <ul> <li><code>az.resource.log</code> to <code>azure.resource.log</code></li> </ul> </li> <li>Renamed enum members: <ul> <li><code>az.ai.inference</code> to <code>azure.ai.inference</code> (on <code>gen_ai.system</code>)</li> <li><code>az.ai.openai</code> to <code>azure.ai.openai</code> (on <code>gen_ai.system</code>)</li> <li><code>azure_aks</code> to <code>azure.aks</code> (on <code>cloud.platform</code>)</li> <li><code>azure_app_service</code> to <code>azure.app_service</code> (on <code>cloud.platform</code>)</li> <li><code>azure_container_apps</code> to <code>azure.container_apps</code> (on <code>cloud.platform</code>)</li> <li><code>azure_container_instances</code> to <code>azure.container_instances</code> (on <code>cloud.platform</code>)</li> <li><code>azure_functions</code> to <code>azure.functions</code> (on <code>cloud.platform</code>)</li> <li><code>azure_openshift</code> to <code>azure.open_shift</code> (on <code>cloud.platform</code>)</li> <li><code>azure_vm</code> to <code>azure.vm</code> (on <code>cloud.platform</code>)</li> </ul> </li> </ul> </li> <li> <p><code>system</code>: Revert the change that moved <code>system.cpu.*</code> to <code>cpu.*</code>. The 3 affected metrics are back in <code>system.cpu.*</code>. (<a href="open-telemetry/semantic-conventions#1873" data-hovercard-type="issue" data-hovercard-url="/open-telemetry/semantic-conventions/issues/1873/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#1873</a>)</p> </li> <li> <p><code>system</code>: Changes system.network.connections to system.network.connection.count (<a href="open-telemetry/semantic-conventions#1800" data-hovercard-type="issue" data-hovercard-url="/open-telemetry/semantic-conventions/issues/1800/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#1800</a>)</p> </li> <li> <p><code>k8s</code>: Change instrument type for .limit/.request container metrics from gauge to updowncounter (<a href="open-telemetry/semantic-conventions#2354" data-hovercard-type="pull_request" data-hovercard-url="/open-telemetry/semantic-conventions/pull/2354/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#2354</a>)</p> </li> </ul> <h3>🚩 Deprecations 🚩</h3> <ul> <li><code>os</code>: Deprecate os.type='z_os' and replace with os.type='zos' (<a href="open-telemetry/semantic-conventions#1687" data-hovercard-type="issue" data-hovercard-url="/open-telemetry/semantic-conventions/issues/1687/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#1687</a>)</li> </ul> <h3>🚀 New components 🚀</h3> <ul> <li><code>mainframe, zos</code>: Add initial semantic conventions for mainframes (<a href="open-telemetry/semantic-conventions#1687" data-hovercard-type="issue" data-hovercard-url="/open-telemetry/semantic-conventions/issues/1687/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#1687</a>)</li> </ul> <h3>💡 Enhancements 💡</h3> <ul> <li> <p><code>dotnet</code>: Define .NET-specific network spans for DNS resolution, TLS handshake, and socket connections, along with HTTP-level spans to (optionally) record relationships between HTTP requests and connections.<br> (<a href="open-telemetry/semantic-conventions#1192" data-hovercard-type="pull_request" data-hovercard-url="/open-telemetry/semantic-conventions/pull/1192/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#1192</a>)</p> </li> <li> <p><code>k8s</code>: Add <code>k8s.node.allocatable.cpu</code>, <code>k8s.node.allocatable.ephemeral_storage</code>, <code>k8s.node.allocatable.memory</code>, <code>k8s.node.allocatable.pods</code> metrics (<a href="open-telemetry/semantic-conventions#2243" data-hovercard-type="issue" data-hovercard-url="/open-telemetry/semantic-conventions/issues/2243/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#2243</a>)</p> </li> <li> <p><code>k8s</code>: Add k8s.container.restart.count metric (<a href="open-telemetry/semantic-conventions#2191" data-hovercard-type="pull_request" data-hovercard-url="/open-telemetry/semantic-conventions/pull/2191/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#2191</a>)</p> </li> <li> <p><code>k8s</code>: Add K8s container resource related metrics (<a href="open-telemetry/semantic-conventions#2074" data-hovercard-type="issue" data-hovercard-url="/open-telemetry/semantic-conventions/issues/2074/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#2074</a>)</p> </li> <li> <p><code>k8s</code>: Add k8s.container.ready metric (<a href="open-telemetry/semantic-conventions#2074" data-hovercard-type="issue" data-hovercard-url="/open-telemetry/semantic-conventions/issues/2074/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#2074</a>)</p> </li> <li> <p><code>k8s</code>: Add k8s.node.condition metric (<a href="open-telemetry/semantic-conventions#2077" data-hovercard-type="issue" data-hovercard-url="/open-telemetry/semantic-conventions/issues/2077/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#2077</a>)</p> </li> <li> <p><code>k8s</code>: Add k8s resource quota metrics (<a href="open-telemetry/semantic-conventions#2076" data-hovercard-type="issue" data-hovercard-url="/open-telemetry/semantic-conventions/issues/2076/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#2076</a>)</p> </li> <li> <p><code>events</code>: Update general event guidance to allow complex attributes on events and use them instead of the body fields.<br> (<a href="open-telemetry/semantic-conventions#1651" data-hovercard-type="issue" data-hovercard-url="/open-telemetry/semantic-conventions/issues/1651/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#1651</a>, <a href="open-telemetry/semantic-conventions#1669" data-hovercard-type="issue" data-hovercard-url="/open-telemetry/semantic-conventions/issues/1669/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#1669</a>)</p> </li> <li> <p><code>k8s</code>: Add k8s.container.status.state and k8s.container.status.reason metrics (<a href="open-telemetry/semantic-conventions#1672" data-hovercard-type="issue" data-hovercard-url="/open-telemetry/semantic-conventions/issues/1672/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#1672</a>)</p> </li> <li> <p><code>feature_flags</code>: Mark feature flag semantic convention as release candidate. (<a href="open-telemetry/semantic-conventions#2277" data-hovercard-type="pull_request" data-hovercard-url="/open-telemetry/semantic-conventions/pull/2277/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#2277</a>)</p> </li> <li> <p><code>k8s</code>: Add new resource attributes for <code>k8s.hpa</code> to capture the <code>scaleTargetRef</code> fields (<a href="open-telemetry/semantic-conventions#2008" data-hovercard-type="issue" data-hovercard-url="/open-telemetry/semantic-conventions/issues/2008/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#2008</a>)<br> Adds below attributes to the <code>k8s.hpa</code> resource:</p> <ul> <li><code>k8s.hpa.scaletargetref.kind</code></li> <li><code>k8s.hpa.scaletargetref.name</code></li> <li><code>k8s.hpa.scaletargetref.api_version</code></li> </ul> </li> <li> <p><code>k8s</code>: Adds metrics and attributes to track k8s HPA's metric target values for CPU resources. (<a href="open-telemetry/semantic-conventions#2182" data-hovercard-type="issue" data-hovercard-url="/open-telemetry/semantic-conventions/issues/2182/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#2182</a>)<br> Below metrics are introduced to provide insight into HPA scaling configuration for CPU.</p> <ul> <li><code>k8s.hpa.metric.target.cpu.value</code></li> <li><code>k8s.hpa.metric.target.cpu.average_value</code></li> <li><code>k8s.hpa.metric.target.cpu.average_utilization</code></li> </ul> </li> <li> <p><code>k8s</code>: Explains the rationale behind the Kubernetes resource naming convention. (<a href="open-telemetry/semantic-conventions#2245" data-hovercard-type="issue" data-hovercard-url="/open-telemetry/semantic-conventions/issues/2245/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#2245</a>)</p> </li> <li> <p><code>all</code>: Adds modelling guide for resource and entity. (<a href="open-telemetry/semantic-conventions#2246" data-hovercard-type="issue" data-hovercard-url="/open-telemetry/semantic-conventions/issues/2246/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#2246</a>)</p> </li> <li> <p><code>service</code>: Adds stability policies for Entity groups. (<a href="open-telemetry/semantic-conventions#2378" data-hovercard-type="pull_request" data-hovercard-url="/open-telemetry/semantic-conventions/pull/2378/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#2378</a>)<br> Entity groups now require <code>role</code> to be filled for attributes.</p> </li> <li> <p><code>otel</code>: Specifies component.type values for Zipkin and Prometheus exporters (<a href="open-telemetry/semantic-conventions#2229" data-hovercard-type="pull_request" data-hovercard-url="/open-telemetry/semantic-conventions/pull/2229/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#2229</a>)</p> </li> </ul> <h3>🧰 Bug fixes 🧰</h3> <ul> <li><code>otel</code>: Removes <code>otel.scope</code> entity. (<a href="open-telemetry/semantic-conventions#2310" data-hovercard-type="pull_request" data-hovercard-url="/open-telemetry/semantic-conventions/pull/2310/hovercard" aria-keyshortcuts="Alt+ArrowUp">open-telemetry#2310</a>)</li> </ul>
1 parent a6782b9 commit 5e212ba

File tree

31 files changed

+36296
-9
lines changed

31 files changed

+36296
-9
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
4242
- Add `ErrorType` attribute helper function to the `go.opentelmetry.io/otel/semconv/v1.34.0` package. (#6962)
4343
- Add `WithAllowKeyDuplication` in `go.opentelemetry.io/otel/sdk/log` which can be used to disable deduplication for log records. (#6968)
4444
- Add `Clone` method to `Record` in `go.opentelemetry.io/otel/log` that returns a copy of the record with no shared state. (#7001)
45+
- The `go.opentelemetry.io/otel/semconv/v1.36.0` package.
46+
The package contains semantic conventions from the `v1.36.0` version of the OpenTelemetry Semantic Conventions.
47+
See the [migration documentation](./semconv/v1.36.0/MIGRATION.md) for information on how to upgrade from `go.opentelemetry.io/otel/semconv/v1.34.0.`(#7032)
4548

4649
### Changed
4750

semconv/templates/registry/go/helpers.j2

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,8 @@ func {{to_go_name(attribute.name, pkg)}}(key string, val {{attribute.type | inst
136136

137137
{{ ["Enum values for " ~ attribute.name] | comment(format="go") }}
138138
var (
139-
{%- for value in attribute.type.members %}
140-
{%- if value.deprecated %}
141-
{{ ["Deprecated: " ~ value.deprecated | trim(".") ~ "." ] | comment(format="go_1tab") }}
142-
{%- else %}
139+
{%- for value in attribute.type.members if not value.deprecated %}
143140
{{ [value.brief or value.id, "Stability: " ~ value.stability] | comment(format="go_1tab") }}
144-
{%- endif %}
145141
{{to_go_name(attribute.name ~ "." ~ value.id, pkg=pkg)}} = {{ to_go_name(attribute.name, pkg=pkg) }}Key.{{attribute.type | instantiated_type | map_text("attribute_type_method")}}({{ value.value | print_member_value }})
146142
{%- endfor %}
147143
)

semconv/templates/registry/go/instrument.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,7 @@ func (m {{ name }}) Record(ctx context.Context, val {{ value_type(metric) | lowe
218218
}
219219
{%- endif -%}
220220
{%- endmacro -%}
221+
222+
{%- macro desc(metric) -%}
223+
{{metric.brief | replace('\n', ' ') | trim}}
224+
{%- endmacro -%}

semconv/templates/registry/go/metric.go.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func New{{ metric_name }}(
6060
i, err := m.{{ metric_inst }}(
6161
"{{metric.metric_name}}",
6262
append([]metric.{{ metric_inst }}Option{
63-
metric.WithDescription("{{metric.brief | trim}}"),
63+
metric.WithDescription("{{ i.desc(metric) }}"),
6464
metric.WithUnit("{{metric.unit}}"),
6565
}, opt...)...,
6666
)
@@ -88,7 +88,7 @@ func ({{ metric_name }}) Unit() string {
8888

8989
// Description returns the semantic convention description of the instrument
9090
func ({{ metric_name }}) Description() string {
91-
return "{{ metric.brief | trim }}"
91+
return "{{ i.desc(metric) }}"
9292
}
9393
{%- endif %}
9494
{%- if "Observable" is in metric_inst %}

semconv/weaver.yaml renamed to semconv/templates/registry/go/weaver.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ templates:
2323
file_name: attribute_group.go
2424
- pattern: metric.go.j2
2525
filter: >
26-
semconv_grouped_metrics({
26+
semconv_metrics({
2727
"exclude_deprecated": true,
2828
"exclude_root_namespace": $excluded_namespaces,
29-
})
29+
})
30+
| map(select(has("deprecated") | not))
31+
| semconv_group_metrics_by_root_namespace
3032
application_mode: each
3133
file_name: "{{ctx.root_namespace | camel_case | lower }}conv/metric.go"
3234
comment_formats:

semconv/v1.36.0/MIGRATION.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!-- Generated. DO NOT MODIFY. -->
2+
# Migration from v1.34.0 to v1.36.0
3+
4+
The `go.opentelemetry.io/otel/semconv/v1.36.0` package should be a drop-in replacement for `go.opentelemetry.io/otel/semconv/v1.34.0` with the following exceptions.
5+
6+
## Removed
7+
8+
The following declarations have been removed.
9+
Refer to the [OpenTelemetry Semantic Conventions documentation] for deprecation instructions.
10+
11+
If the type is not listed in the documentation as deprecated, it has been removed in this version due to lack of applicability or use.
12+
If you use any of these non-deprecated declarations in your Go application, please [open an issue] describing your use-case.
13+
14+
- `AzNamespace`
15+
- `AzNamespaceKey`
16+
- `AzServiceRequestID`
17+
- `AzServiceRequestIDKey`
18+
- `GenAISystemAzAIInference`
19+
- `GenAISystemAzAIOpenAI`
20+
- `GenAISystemGemini`
21+
- `GenAISystemVertexAI`
22+
- `GenAITokenTypeCompletion`
23+
- `MessagingOperationTypeDeliver`
24+
- `MessagingOperationTypePublish`
25+
- `SystemMemoryStateShared`
26+
- `VCSProviderNameGittea`
27+
28+
[OpenTelemetry Semantic Conventions documentation]: https://github.com/open-telemetry/semantic-conventions
29+
[open an issue]: https://github.com/open-telemetry/opentelemetry-go/issues/new?template=Blank+issue

semconv/v1.36.0/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Semconv v1.36.0
2+
3+
[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/semconv/v1.36.0)](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.36.0)

0 commit comments

Comments
 (0)