Skip to content

Commit bd60b70

Browse files
committed
Updates generated comments with more explicit nomenclature; Adds Unit and Description consts for each metric; append 'Name' to metric const instead of 'Key'
1 parent 67eff23 commit bd60b70

File tree

2 files changed

+480
-272
lines changed

2 files changed

+480
-272
lines changed

semconv/metric_template.j2

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ It represents {% if brief[:2] == "A " or brief[:3] == "An " or brief[:4] == "The
1010
{%- endmacro -%}
1111
{%- macro keydoc(metric) -%}
1212
{%- if metric.stability|string() == "StabilityLevel.DEPRECATED" -%}
13-
{{ to_go_name(metric.metric_name) }} is the attribute Key conforming to the "{{ metric.metric_name}}" semantic conventions.
13+
{{ to_go_name(metric.metric_name) }} is the metric conforming to the "{{ metric.metric_name}}" semantic conventions.
1414
{%- else -%}
15-
{{ to_go_name(metric.metric_name) }} is the attribute Key conforming to the "{{ metric.metric_name}}" semantic conventions. {{ it_reps(metric.brief) }}
15+
{{ to_go_name(metric.metric_name) }} is the metric conforming to the "{{ metric.metric_name}}" semantic conventions. {{ it_reps(metric.brief) }}
1616
{%- endif %}
1717
{%- endmacro -%}
1818
// Copyright The OpenTelemetry Authors
@@ -42,7 +42,9 @@ const (
4242
// Instrument: {{ metric.instrument }}
4343
// Unit: {{ metric.unit }}
4444
// Stability: {{ metric.stability }}
45-
{{to_go_name(metric.metric_name)}} = attribute.Key("{{metric.metric_name}}")
45+
{{to_go_name(metric.metric_name)}}Name = attribute.Key("{{metric.metric_name}}")
46+
{{to_go_name(metric.metric_name)}}Unit = attribute.Key("{{metric.unit}}")
47+
{{to_go_name(metric.metric_name)}}Description = attribute.Key("{{metric.brief}}")
4648
{%- endif %}
4749
{% endfor %}
4850
)

0 commit comments

Comments
 (0)