@@ -107,8 +107,10 @@ type Event struct {
107
107
//
108
108
// profiles[].metric.metrics[].name (required)
109
109
// -------------------------------------------
110
- // Metric's full name typically in the form of "<metric group>.<metric name>".
111
- // It is required parameter to avoid emitting all available metrics unintentionally.
110
+ // The full metric name is formatted as "<metric group>.<metric name>". In telemetry.NewGauge()
111
+ // and similar APIs, "metric group" corresponds to the "subsystem" parameter, and "metric name"
112
+ // corresponds to the "name" parameter. Do not use the "Options.NoDoubleUnderscoreSep" option
113
+ // in these APIs, as it is not supported in agent telemetry.
112
114
//
113
115
// profiles[].metric.metrics[].aggregate_tags (optional)
114
116
// -----------------------------------------------------
@@ -338,7 +340,9 @@ func compileMetric(p *Profile, m *MetricConfig) error {
338
340
return fmt .Errorf ("profile '%s' 'metrics[].name' '(%s)' attribute should have two elements separated by '.'" , p .Name , m .Name )
339
341
}
340
342
341
- // Convert Datadog metric name to Prometheus metric name (used for quick(er) matching)
343
+ // Converts a Datadog metric name to a Prometheus metric name for quicker matching. Prometheus metrics
344
+ // (from the "telemetry" package) must be declared without setting Options.NoDoubleUnderscoreSep to true,
345
+ // ensuring the full metric name includes double underscores ("__"); otherwise, matching will fail.
342
346
promName := fmt .Sprintf ("%s__%s" , names [0 ], names [1 ])
343
347
p .metricsMap [promName ] = m
344
348
0 commit comments