-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathmetric.go.j2
27 lines (24 loc) · 985 Bytes
/
metric.go.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{% import 'helpers.j2' as h -%}
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
package semconv // import "go.opentelemetry.io/otel/semconv/{{params.tag}}"
const (
{%- for metric in ctx if not metric.deprecated %}
{{ h.metric_keydoc(metric) | comment(indent=2) }}
// Instrument: {{ metric.instrument }}
// Unit: {{ metric.unit }}
// Stability: {{ metric.stability }}
{%- if metric is deprecated %}
// Deprecated: {{ metric.deprecated }}
{%- endif %}
{%- if not metric.brief %}
// NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
{%- endif %}
{{ h.to_go_name(metric.metric_name) }}Name = "{{ metric.metric_name }}"
{{ h.to_go_name(metric.metric_name) }}Unit = "{{ metric.unit }}"
{%- if metric.brief %}
{{ h.to_go_name(metric.metric_name) }}Description = "{{ metric.brief | trim }}"
{%- endif %}
{%- endfor %}
)