Skip to content

Commit

Permalink
Merge branch 'main' into logs-design
Browse files Browse the repository at this point in the history
  • Loading branch information
pellared authored Dec 5, 2023
2 parents 6443d19 + 6cee2b4 commit b170245
Show file tree
Hide file tree
Showing 10 changed files with 7,769 additions and 9 deletions.
10 changes: 6 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## [Unreleased]

### Added

- The `go.opentelemetry.io/otel/semconv/v1.22.0` package.
The package contains semantic conventions from the `v1.22.0` version of the OpenTelemetry Semantic Conventions. (#4735)
- Add `WithResourceAsConstantLabels` option to apply resource attributes for every metric emitted by the Prometheus exporter. (#4733)

### Changed

- Improve `go.opentelemetry.io/otel/trace.TraceState`'s performance. (#4722)
- Improve `go.opentelemetry.io/otel/propagation.TraceContext`'s performance. (#4721)

### Added

- Add `WithResourceAsConstantLabels` option to apply resource attributes for every metric emitted by the Prometheus exporter. (#4733)

## [1.21.0/0.44.0] 2023-11-16

### Removed
Expand Down
4 changes: 2 additions & 2 deletions internal/tools/semconvkit/templates/doc.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
// Package semconv implements OpenTelemetry semantic conventions.
//
// OpenTelemetry semantic conventions are agreed standardized naming
// patterns for OpenTelemetry things. This package represents the conventions
// as of the {{.TagVer}} version of the OpenTelemetry specification.
// patterns for OpenTelemetry things. This package represents the {{.TagVer}}
// version of the OpenTelemetry semantic conventions.
package semconv // import "go.opentelemetry.io/otel/semconv/{{.TagVer}}"
20 changes: 17 additions & 3 deletions semconv/template.j2
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ It represents {% if brief[:2] == "A " or brief[:3] == "An " or brief[:4] == "The
{%- endif -%}
{%- endmacro -%}
{%- macro keydoc(attr) -%}
{%- if attr.stability|string() == "StabilityLevel.DEPRECATED" -%}
{{ to_go_name(attr.fqn) }}Key is the attribute Key conforming to the "{{ attr.fqn }}" semantic conventions.
{%- else -%}
{{ to_go_name(attr.fqn) }}Key is the attribute Key conforming to the "{{ attr.fqn }}" semantic conventions. {{ it_reps(attr.brief) }}
{%- endif %}
{%- endmacro -%}
{%- macro keydetails(attr) -%}
{%- if attr.attr_type is string %}
Expand All @@ -51,18 +55,24 @@ RequirementLevel: Recommended
RequirementLevel: Optional
{%- endif %}
{{ attr.stability | replace("Level.", ": ") | capitalize }}
{%- if attr.deprecated != None %}
Deprecated: {{ attr.deprecated }}
{%- endif %}
{%- if attr.examples is iterable %}
Examples: {{ attr.examples | pprint | trim("[]") }}
{%- endif %}
{%- if attr.note %}
Note: {{ attr.note }}
{%- endif %}
{%- if attr.stability|string() == "StabilityLevel.DEPRECATED" %}
Deprecated: {{ attr.brief | replace("Deprecated, ", "") }}
{%- endif %}
{%- endmacro -%}
{%- macro fndoc(attr) -%}
{%- if attr.stability|string() == "StabilityLevel.DEPRECATED" -%}
// {{ to_go_name(attr.fqn) }} returns an attribute KeyValue conforming to the "{{ attr.fqn }}" semantic conventions.

Deprecated: {{ attr.brief | replace("Deprecated, ", "") }}
{%- else -%}
// {{ to_go_name(attr.fqn) }} returns an attribute KeyValue conforming to the "{{ attr.fqn }}" semantic conventions. {{ it_reps(attr.brief) }}
{%- endif %}
{%- endmacro -%}
{%- macro to_go_func(type, name) -%}
{%- if type == "string" -%}
Expand Down Expand Up @@ -124,6 +134,10 @@ const (
var (
{%- for val in attr.attr_type.members %}
// {{ val.brief | to_doc_brief }}
{%- if attr.stability|string() == "StabilityLevel.DEPRECATED" %}
//
// Deprecated: {{ attr.brief | replace("Deprecated, ", "") | wordwrap(76, break_long_words=false, break_on_hyphens=false, wrapstring="\n// ") }}
{%- endif %}
{{to_go_name("{}.{}".format(attr.fqn, val.member_id))}} = {{to_go_name(attr.fqn)}}Key.{{to_go_attr_type(attr.attr_type.enum_type, val.value)}}
{%- endfor %}
)
Expand Down
Loading

0 comments on commit b170245

Please sign in to comment.