diff --git a/.chloggen/exporterhelper_metric_units.yaml b/.chloggen/exporterhelper_metric_units.yaml new file mode 100644 index 00000000000..de6a645ffe3 --- /dev/null +++ b/.chloggen/exporterhelper_metric_units.yaml @@ -0,0 +1,25 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: bug_fix + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: exporterhelper + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Update units for internal telemetry + +# One or more tracking issues or pull requests related to the change +issues: [10648] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [] diff --git a/exporter/exporterhelper/documentation.md b/exporter/exporterhelper/documentation.md index 1279ece2db9..a82163a2bfa 100644 --- a/exporter/exporterhelper/documentation.md +++ b/exporter/exporterhelper/documentation.md @@ -12,7 +12,7 @@ Number of log records failed to be added to the sending queue. | Unit | Metric Type | Value Type | Monotonic | | ---- | ----------- | ---------- | --------- | -| 1 | Sum | Int | true | +| {records} | Sum | Int | true | ### otelcol_exporter_enqueue_failed_metric_points @@ -20,7 +20,7 @@ Number of metric points failed to be added to the sending queue. | Unit | Metric Type | Value Type | Monotonic | | ---- | ----------- | ---------- | --------- | -| 1 | Sum | Int | true | +| {datapoints} | Sum | Int | true | ### otelcol_exporter_enqueue_failed_spans @@ -28,7 +28,7 @@ Number of spans failed to be added to the sending queue. | Unit | Metric Type | Value Type | Monotonic | | ---- | ----------- | ---------- | --------- | -| 1 | Sum | Int | true | +| {spans} | Sum | Int | true | ### otelcol_exporter_queue_capacity @@ -36,7 +36,7 @@ Fixed capacity of the retry queue (in batches) | Unit | Metric Type | Value Type | | ---- | ----------- | ---------- | -| 1 | Gauge | Int | +| {batches} | Gauge | Int | ### otelcol_exporter_queue_size @@ -44,7 +44,7 @@ Current size of the retry queue (in batches) | Unit | Metric Type | Value Type | | ---- | ----------- | ---------- | -| 1 | Gauge | Int | +| {batches} | Gauge | Int | ### otelcol_exporter_send_failed_log_records @@ -52,7 +52,7 @@ Number of log records in failed attempts to send to destination. | Unit | Metric Type | Value Type | Monotonic | | ---- | ----------- | ---------- | --------- | -| 1 | Sum | Int | true | +| {records} | Sum | Int | true | ### otelcol_exporter_send_failed_metric_points @@ -60,7 +60,7 @@ Number of metric points in failed attempts to send to destination. | Unit | Metric Type | Value Type | Monotonic | | ---- | ----------- | ---------- | --------- | -| 1 | Sum | Int | true | +| {datapoints} | Sum | Int | true | ### otelcol_exporter_send_failed_spans @@ -68,7 +68,7 @@ Number of spans in failed attempts to send to destination. | Unit | Metric Type | Value Type | Monotonic | | ---- | ----------- | ---------- | --------- | -| 1 | Sum | Int | true | +| {spans} | Sum | Int | true | ### otelcol_exporter_sent_log_records @@ -76,7 +76,7 @@ Number of log record successfully sent to destination. | Unit | Metric Type | Value Type | Monotonic | | ---- | ----------- | ---------- | --------- | -| 1 | Sum | Int | true | +| {records} | Sum | Int | true | ### otelcol_exporter_sent_metric_points @@ -84,7 +84,7 @@ Number of metric points successfully sent to destination. | Unit | Metric Type | Value Type | Monotonic | | ---- | ----------- | ---------- | --------- | -| 1 | Sum | Int | true | +| {datapoints} | Sum | Int | true | ### otelcol_exporter_sent_spans @@ -92,4 +92,4 @@ Number of spans successfully sent to destination. | Unit | Metric Type | Value Type | Monotonic | | ---- | ----------- | ---------- | --------- | -| 1 | Sum | Int | true | +| {spans} | Sum | Int | true | diff --git a/exporter/exporterhelper/internal/metadata/generated_telemetry.go b/exporter/exporterhelper/internal/metadata/generated_telemetry.go index 125863e4d10..d0b27bf441b 100644 --- a/exporter/exporterhelper/internal/metadata/generated_telemetry.go +++ b/exporter/exporterhelper/internal/metadata/generated_telemetry.go @@ -56,7 +56,7 @@ func (builder *TelemetryBuilder) InitExporterQueueCapacity(cb func() int64, opts builder.ExporterQueueCapacity, err = builder.meter.Int64ObservableGauge( "otelcol_exporter_queue_capacity", metric.WithDescription("Fixed capacity of the retry queue (in batches)"), - metric.WithUnit("1"), + metric.WithUnit("{batches}"), ) if err != nil { return err @@ -74,7 +74,7 @@ func (builder *TelemetryBuilder) InitExporterQueueSize(cb func() int64, opts ... builder.ExporterQueueSize, err = builder.meter.Int64ObservableGauge( "otelcol_exporter_queue_size", metric.WithDescription("Current size of the retry queue (in batches)"), - metric.WithUnit("1"), + metric.WithUnit("{batches}"), ) if err != nil { return err @@ -102,55 +102,55 @@ func NewTelemetryBuilder(settings component.TelemetrySettings, options ...teleme builder.ExporterEnqueueFailedLogRecords, err = builder.meter.Int64Counter( "otelcol_exporter_enqueue_failed_log_records", metric.WithDescription("Number of log records failed to be added to the sending queue."), - metric.WithUnit("1"), + metric.WithUnit("{records}"), ) errs = errors.Join(errs, err) builder.ExporterEnqueueFailedMetricPoints, err = builder.meter.Int64Counter( "otelcol_exporter_enqueue_failed_metric_points", metric.WithDescription("Number of metric points failed to be added to the sending queue."), - metric.WithUnit("1"), + metric.WithUnit("{datapoints}"), ) errs = errors.Join(errs, err) builder.ExporterEnqueueFailedSpans, err = builder.meter.Int64Counter( "otelcol_exporter_enqueue_failed_spans", metric.WithDescription("Number of spans failed to be added to the sending queue."), - metric.WithUnit("1"), + metric.WithUnit("{spans}"), ) errs = errors.Join(errs, err) builder.ExporterSendFailedLogRecords, err = builder.meter.Int64Counter( "otelcol_exporter_send_failed_log_records", metric.WithDescription("Number of log records in failed attempts to send to destination."), - metric.WithUnit("1"), + metric.WithUnit("{records}"), ) errs = errors.Join(errs, err) builder.ExporterSendFailedMetricPoints, err = builder.meter.Int64Counter( "otelcol_exporter_send_failed_metric_points", metric.WithDescription("Number of metric points in failed attempts to send to destination."), - metric.WithUnit("1"), + metric.WithUnit("{datapoints}"), ) errs = errors.Join(errs, err) builder.ExporterSendFailedSpans, err = builder.meter.Int64Counter( "otelcol_exporter_send_failed_spans", metric.WithDescription("Number of spans in failed attempts to send to destination."), - metric.WithUnit("1"), + metric.WithUnit("{spans}"), ) errs = errors.Join(errs, err) builder.ExporterSentLogRecords, err = builder.meter.Int64Counter( "otelcol_exporter_sent_log_records", metric.WithDescription("Number of log record successfully sent to destination."), - metric.WithUnit("1"), + metric.WithUnit("{records}"), ) errs = errors.Join(errs, err) builder.ExporterSentMetricPoints, err = builder.meter.Int64Counter( "otelcol_exporter_sent_metric_points", metric.WithDescription("Number of metric points successfully sent to destination."), - metric.WithUnit("1"), + metric.WithUnit("{datapoints}"), ) errs = errors.Join(errs, err) builder.ExporterSentSpans, err = builder.meter.Int64Counter( "otelcol_exporter_sent_spans", metric.WithDescription("Number of spans successfully sent to destination."), - metric.WithUnit("1"), + metric.WithUnit("{spans}"), ) errs = errors.Join(errs, err) return &builder, errs diff --git a/exporter/exporterhelper/metadata.yaml b/exporter/exporterhelper/metadata.yaml index dea17a17089..e10113eb494 100644 --- a/exporter/exporterhelper/metadata.yaml +++ b/exporter/exporterhelper/metadata.yaml @@ -12,7 +12,7 @@ telemetry: exporter_sent_spans: enabled: true description: Number of spans successfully sent to destination. - unit: "1" + unit: "{spans}" sum: value_type: int monotonic: true @@ -20,7 +20,7 @@ telemetry: exporter_send_failed_spans: enabled: true description: Number of spans in failed attempts to send to destination. - unit: "1" + unit: "{spans}" sum: value_type: int monotonic: true @@ -28,7 +28,7 @@ telemetry: exporter_enqueue_failed_spans: enabled: true description: Number of spans failed to be added to the sending queue. - unit: "1" + unit: "{spans}" sum: value_type: int monotonic: true @@ -36,7 +36,7 @@ telemetry: exporter_sent_metric_points: enabled: true description: Number of metric points successfully sent to destination. - unit: "1" + unit: "{datapoints}" sum: value_type: int monotonic: true @@ -44,7 +44,7 @@ telemetry: exporter_send_failed_metric_points: enabled: true description: Number of metric points in failed attempts to send to destination. - unit: "1" + unit: "{datapoints}" sum: value_type: int monotonic: true @@ -52,7 +52,7 @@ telemetry: exporter_enqueue_failed_metric_points: enabled: true description: Number of metric points failed to be added to the sending queue. - unit: "1" + unit: "{datapoints}" sum: value_type: int monotonic: true @@ -60,7 +60,7 @@ telemetry: exporter_sent_log_records: enabled: true description: Number of log record successfully sent to destination. - unit: "1" + unit: "{records}" sum: value_type: int monotonic: true @@ -68,7 +68,7 @@ telemetry: exporter_send_failed_log_records: enabled: true description: Number of log records in failed attempts to send to destination. - unit: "1" + unit: "{records}" sum: value_type: int monotonic: true @@ -76,7 +76,7 @@ telemetry: exporter_enqueue_failed_log_records: enabled: true description: Number of log records failed to be added to the sending queue. - unit: "1" + unit: "{records}" sum: value_type: int monotonic: true @@ -84,7 +84,7 @@ telemetry: exporter_queue_size: enabled: true description: Current size of the retry queue (in batches) - unit: "1" + unit: "{batches}" optional: true gauge: value_type: int @@ -93,7 +93,7 @@ telemetry: exporter_queue_capacity: enabled: true description: Fixed capacity of the retry queue (in batches) - unit: "1" + unit: "{batches}" optional: true gauge: value_type: int