Skip to content
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### Fixed

- Fix missing `request.GetBody` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` to correctly handle HTTP2 GOAWAY frame. (#7931)
- Fix semconv v1.39.0 generated metric helpers skipping required attributes when extra attributes were empty. (#7964)

### Removed

Expand Down
16 changes: 16 additions & 0 deletions semconv/templates/registry/go/instrument.j2
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,15 @@ func (m {{ name }}) Add(
{{ params(metric.attributes, pkg=pkg, prefix="\t") }}
) {
if len(attrs) == 0 {
{%- if req_attr | length > 0 %}
m.{{ inst }}.Add(ctx, incr, metric.WithAttributes(
{%- for attr in req_attr %}
{{ to_attribute(attr, pkg) }}
{%- endfor %}
))
{%- else %}
m.{{ inst }}.Add(ctx, incr)
{%- endif %}
return
}

Expand Down Expand Up @@ -201,7 +209,15 @@ func (m {{ name }}) Record(
{{ params(metric.attributes, pkg=pkg, prefix="\t") }}
) {
if len(attrs) == 0 {
{%- if req_attr | length > 0 %}
m.{{ inst }}.Record(ctx, val, metric.WithAttributes(
{%- for attr in req_attr %}
{{ to_attribute(attr, pkg) }}
{%- endfor %}
))
{%- else %}
m.{{ inst }}.Record(ctx, val)
{%- endif %}
return
}

Expand Down
4 changes: 3 additions & 1 deletion semconv/v1.39.0/azureconv/metric.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 19 additions & 5 deletions semconv/v1.39.0/cicdconv/metric.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 34 additions & 11 deletions semconv/v1.39.0/dbconv/metric.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion semconv/v1.39.0/dnsconv/metric.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 21 additions & 5 deletions semconv/v1.39.0/genaiconv/metric.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading