Skip to content

Commit

Permalink
Updates generated comments with more explicit nomenclature; Adds Unit…
Browse files Browse the repository at this point in the history
… and Description consts for each metric; append 'Name' to metric const instead of 'Key'
  • Loading branch information
carrbs committed Feb 6, 2024
1 parent 67eff23 commit bd60b70
Show file tree
Hide file tree
Showing 2 changed files with 480 additions and 272 deletions.
8 changes: 5 additions & 3 deletions semconv/metric_template.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ It represents {% if brief[:2] == "A " or brief[:3] == "An " or brief[:4] == "The
{%- endmacro -%}
{%- macro keydoc(metric) -%}
{%- if metric.stability|string() == "StabilityLevel.DEPRECATED" -%}
{{ to_go_name(metric.metric_name) }} is the attribute Key conforming to the "{{ metric.metric_name}}" semantic conventions.
{{ to_go_name(metric.metric_name) }} is the metric conforming to the "{{ metric.metric_name}}" semantic conventions.
{%- else -%}
{{ to_go_name(metric.metric_name) }} is the attribute Key conforming to the "{{ metric.metric_name}}" semantic conventions. {{ it_reps(metric.brief) }}
{{ to_go_name(metric.metric_name) }} is the metric conforming to the "{{ metric.metric_name}}" semantic conventions. {{ it_reps(metric.brief) }}
{%- endif %}
{%- endmacro -%}
// Copyright The OpenTelemetry Authors
Expand Down Expand Up @@ -42,7 +42,9 @@ const (
// Instrument: {{ metric.instrument }}
// Unit: {{ metric.unit }}
// Stability: {{ metric.stability }}
{{to_go_name(metric.metric_name)}} = attribute.Key("{{metric.metric_name}}")
{{to_go_name(metric.metric_name)}}Name = attribute.Key("{{metric.metric_name}}")
{{to_go_name(metric.metric_name)}}Unit = attribute.Key("{{metric.unit}}")
{{to_go_name(metric.metric_name)}}Description = attribute.Key("{{metric.brief}}")
{%- endif %}
{% endfor %}
)
Loading

0 comments on commit bd60b70

Please sign in to comment.