From 686bf0a768bb3e081034dfb2fc464b26b06e8b49 Mon Sep 17 00:00:00 2001 From: Alex Boten <223565+codeboten@users.noreply.github.com> Date: Mon, 10 Jun 2024 09:54:35 -0700 Subject: [PATCH] update all metrics with prefix Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com> --- exporter/exporterhelper/documentation.md | 22 ++-- .../internal/metadata/generated_telemetry.go | 80 +++++++------- exporter/exporterhelper/metadata.yaml | 22 ++-- exporter/exporterhelper/obsexporter.go | 18 ++-- processor/processorhelper/documentation.md | 18 ++-- .../internal/metadata/generated_telemetry.go | 58 +++++----- processor/processorhelper/metadata.yaml | 18 ++-- processor/processorhelper/obsreport.go | 18 ++-- receiver/receiverhelper/documentation.md | 12 +-- .../internal/metadata/generated_telemetry.go | 40 +++---- receiver/receiverhelper/metadata.yaml | 12 +-- receiver/receiverhelper/obsreport.go | 12 +-- receiver/scraperhelper/documentation.md | 4 +- .../internal/metadata/generated_telemetry.go | 16 +-- receiver/scraperhelper/metadata.yaml | 4 +- service/documentation.md | 12 +-- .../internal/metadata/generated_telemetry.go | 102 +++++++++--------- .../proctelemetry/process_telemetry.go | 12 +-- service/metadata.yaml | 12 +-- 19 files changed, 246 insertions(+), 246 deletions(-) diff --git a/exporter/exporterhelper/documentation.md b/exporter/exporterhelper/documentation.md index df11c1af81e..1279ece2db9 100644 --- a/exporter/exporterhelper/documentation.md +++ b/exporter/exporterhelper/documentation.md @@ -6,7 +6,7 @@ The following telemetry is emitted by this component. -### exporter_enqueue_failed_log_records +### otelcol_exporter_enqueue_failed_log_records Number of log records failed to be added to the sending queue. @@ -14,7 +14,7 @@ Number of log records failed to be added to the sending queue. | ---- | ----------- | ---------- | --------- | | 1 | Sum | Int | true | -### exporter_enqueue_failed_metric_points +### otelcol_exporter_enqueue_failed_metric_points Number of metric points failed to be added to the sending queue. @@ -22,7 +22,7 @@ Number of metric points failed to be added to the sending queue. | ---- | ----------- | ---------- | --------- | | 1 | Sum | Int | true | -### exporter_enqueue_failed_spans +### otelcol_exporter_enqueue_failed_spans Number of spans failed to be added to the sending queue. @@ -30,7 +30,7 @@ Number of spans failed to be added to the sending queue. | ---- | ----------- | ---------- | --------- | | 1 | Sum | Int | true | -### exporter_queue_capacity +### otelcol_exporter_queue_capacity Fixed capacity of the retry queue (in batches) @@ -38,7 +38,7 @@ Fixed capacity of the retry queue (in batches) | ---- | ----------- | ---------- | | 1 | Gauge | Int | -### exporter_queue_size +### otelcol_exporter_queue_size Current size of the retry queue (in batches) @@ -46,7 +46,7 @@ Current size of the retry queue (in batches) | ---- | ----------- | ---------- | | 1 | Gauge | Int | -### exporter_send_failed_log_records +### otelcol_exporter_send_failed_log_records Number of log records in failed attempts to send to destination. @@ -54,7 +54,7 @@ Number of log records in failed attempts to send to destination. | ---- | ----------- | ---------- | --------- | | 1 | Sum | Int | true | -### exporter_send_failed_metric_points +### otelcol_exporter_send_failed_metric_points Number of metric points in failed attempts to send to destination. @@ -62,7 +62,7 @@ Number of metric points in failed attempts to send to destination. | ---- | ----------- | ---------- | --------- | | 1 | Sum | Int | true | -### exporter_send_failed_spans +### otelcol_exporter_send_failed_spans Number of spans in failed attempts to send to destination. @@ -70,7 +70,7 @@ Number of spans in failed attempts to send to destination. | ---- | ----------- | ---------- | --------- | | 1 | Sum | Int | true | -### exporter_sent_log_records +### otelcol_exporter_sent_log_records Number of log record successfully sent to destination. @@ -78,7 +78,7 @@ Number of log record successfully sent to destination. | ---- | ----------- | ---------- | --------- | | 1 | Sum | Int | true | -### exporter_sent_metric_points +### otelcol_exporter_sent_metric_points Number of metric points successfully sent to destination. @@ -86,7 +86,7 @@ Number of metric points successfully sent to destination. | ---- | ----------- | ---------- | --------- | | 1 | Sum | Int | true | -### exporter_sent_spans +### otelcol_exporter_sent_spans Number of spans successfully sent to destination. diff --git a/exporter/exporterhelper/internal/metadata/generated_telemetry.go b/exporter/exporterhelper/internal/metadata/generated_telemetry.go index 4383809885e..d5e07967760 100644 --- a/exporter/exporterhelper/internal/metadata/generated_telemetry.go +++ b/exporter/exporterhelper/internal/metadata/generated_telemetry.go @@ -26,20 +26,20 @@ func Tracer(settings component.TelemetrySettings) trace.Tracer { // TelemetryBuilder provides an interface for components to report telemetry // as defined in metadata and user config. type TelemetryBuilder struct { - meter metric.Meter - ExporterEnqueueFailedLogRecords metric.Int64Counter - ExporterEnqueueFailedMetricPoints metric.Int64Counter - ExporterEnqueueFailedSpans metric.Int64Counter - ExporterQueueCapacity metric.Int64ObservableGauge - ExporterQueueSize metric.Int64ObservableGauge - ExporterSendFailedLogRecords metric.Int64Counter - ExporterSendFailedMetricPoints metric.Int64Counter - ExporterSendFailedSpans metric.Int64Counter - ExporterSentLogRecords metric.Int64Counter - ExporterSentMetricPoints metric.Int64Counter - ExporterSentSpans metric.Int64Counter - level configtelemetry.Level - attributeSet attribute.Set + meter metric.Meter + OtelcolExporterEnqueueFailedLogRecords metric.Int64Counter + OtelcolExporterEnqueueFailedMetricPoints metric.Int64Counter + OtelcolExporterEnqueueFailedSpans metric.Int64Counter + OtelcolExporterQueueCapacity metric.Int64ObservableGauge + OtelcolExporterQueueSize metric.Int64ObservableGauge + OtelcolExporterSendFailedLogRecords metric.Int64Counter + OtelcolExporterSendFailedMetricPoints metric.Int64Counter + OtelcolExporterSendFailedSpans metric.Int64Counter + OtelcolExporterSentLogRecords metric.Int64Counter + OtelcolExporterSentMetricPoints metric.Int64Counter + OtelcolExporterSentSpans metric.Int64Counter + level configtelemetry.Level + attributeSet attribute.Set } // telemetryBuilderOption applies changes to default builder. @@ -59,11 +59,11 @@ func WithAttributeSet(set attribute.Set) telemetryBuilderOption { } } -// InitExporterQueueCapacity configures the ExporterQueueCapacity metric. -func (builder *TelemetryBuilder) InitExporterQueueCapacity(cb func() int64) error { +// InitOtelcolExporterQueueCapacity configures the OtelcolExporterQueueCapacity metric. +func (builder *TelemetryBuilder) InitOtelcolExporterQueueCapacity(cb func() int64) error { var err error - builder.ExporterQueueCapacity, err = builder.meter.Int64ObservableGauge( - "exporter_queue_capacity", + builder.OtelcolExporterQueueCapacity, err = builder.meter.Int64ObservableGauge( + "otelcol_exporter_queue_capacity", metric.WithDescription("Fixed capacity of the retry queue (in batches)"), metric.WithUnit("1"), metric.WithInt64Callback(func(_ context.Context, o metric.Int64Observer) error { @@ -74,11 +74,11 @@ func (builder *TelemetryBuilder) InitExporterQueueCapacity(cb func() int64) erro return err } -// InitExporterQueueSize configures the ExporterQueueSize metric. -func (builder *TelemetryBuilder) InitExporterQueueSize(cb func() int64) error { +// InitOtelcolExporterQueueSize configures the OtelcolExporterQueueSize metric. +func (builder *TelemetryBuilder) InitOtelcolExporterQueueSize(cb func() int64) error { var err error - builder.ExporterQueueSize, err = builder.meter.Int64ObservableGauge( - "exporter_queue_size", + builder.OtelcolExporterQueueSize, err = builder.meter.Int64ObservableGauge( + "otelcol_exporter_queue_size", metric.WithDescription("Current size of the retry queue (in batches)"), metric.WithUnit("1"), metric.WithInt64Callback(func(_ context.Context, o metric.Int64Observer) error { @@ -102,56 +102,56 @@ func NewTelemetryBuilder(settings component.TelemetrySettings, options ...teleme } else { builder.meter = noop.Meter{} } - builder.ExporterEnqueueFailedLogRecords, err = builder.meter.Int64Counter( - "exporter_enqueue_failed_log_records", + builder.OtelcolExporterEnqueueFailedLogRecords, 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"), ) errs = errors.Join(errs, err) - builder.ExporterEnqueueFailedMetricPoints, err = builder.meter.Int64Counter( - "exporter_enqueue_failed_metric_points", + builder.OtelcolExporterEnqueueFailedMetricPoints, 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"), ) errs = errors.Join(errs, err) - builder.ExporterEnqueueFailedSpans, err = builder.meter.Int64Counter( - "exporter_enqueue_failed_spans", + builder.OtelcolExporterEnqueueFailedSpans, 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"), ) errs = errors.Join(errs, err) - builder.ExporterSendFailedLogRecords, err = builder.meter.Int64Counter( - "exporter_send_failed_log_records", + builder.OtelcolExporterSendFailedLogRecords, 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"), ) errs = errors.Join(errs, err) - builder.ExporterSendFailedMetricPoints, err = builder.meter.Int64Counter( - "exporter_send_failed_metric_points", + builder.OtelcolExporterSendFailedMetricPoints, 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"), ) errs = errors.Join(errs, err) - builder.ExporterSendFailedSpans, err = builder.meter.Int64Counter( - "exporter_send_failed_spans", + builder.OtelcolExporterSendFailedSpans, err = builder.meter.Int64Counter( + "otelcol_exporter_send_failed_spans", metric.WithDescription("Number of spans in failed attempts to send to destination."), metric.WithUnit("1"), ) errs = errors.Join(errs, err) - builder.ExporterSentLogRecords, err = builder.meter.Int64Counter( - "exporter_sent_log_records", + builder.OtelcolExporterSentLogRecords, err = builder.meter.Int64Counter( + "otelcol_exporter_sent_log_records", metric.WithDescription("Number of log record successfully sent to destination."), metric.WithUnit("1"), ) errs = errors.Join(errs, err) - builder.ExporterSentMetricPoints, err = builder.meter.Int64Counter( - "exporter_sent_metric_points", + builder.OtelcolExporterSentMetricPoints, err = builder.meter.Int64Counter( + "otelcol_exporter_sent_metric_points", metric.WithDescription("Number of metric points successfully sent to destination."), metric.WithUnit("1"), ) errs = errors.Join(errs, err) - builder.ExporterSentSpans, err = builder.meter.Int64Counter( - "exporter_sent_spans", + builder.OtelcolExporterSentSpans, err = builder.meter.Int64Counter( + "otelcol_exporter_sent_spans", metric.WithDescription("Number of spans successfully sent to destination."), metric.WithUnit("1"), ) diff --git a/exporter/exporterhelper/metadata.yaml b/exporter/exporterhelper/metadata.yaml index 0703902f6f4..780c7a08787 100644 --- a/exporter/exporterhelper/metadata.yaml +++ b/exporter/exporterhelper/metadata.yaml @@ -9,7 +9,7 @@ status: telemetry: metrics: - exporter_sent_spans: + otelcol_exporter_sent_spans: enabled: true description: Number of spans successfully sent to destination. unit: 1 @@ -17,7 +17,7 @@ telemetry: value_type: int monotonic: true - exporter_send_failed_spans: + otelcol_exporter_send_failed_spans: enabled: true description: Number of spans in failed attempts to send to destination. unit: 1 @@ -25,7 +25,7 @@ telemetry: value_type: int monotonic: true - exporter_enqueue_failed_spans: + otelcol_exporter_enqueue_failed_spans: enabled: true description: Number of spans failed to be added to the sending queue. unit: 1 @@ -33,7 +33,7 @@ telemetry: value_type: int monotonic: true - exporter_sent_metric_points: + otelcol_exporter_sent_metric_points: enabled: true description: Number of metric points successfully sent to destination. unit: 1 @@ -41,7 +41,7 @@ telemetry: value_type: int monotonic: true - exporter_send_failed_metric_points: + otelcol_exporter_send_failed_metric_points: enabled: true description: Number of metric points in failed attempts to send to destination. unit: 1 @@ -49,7 +49,7 @@ telemetry: value_type: int monotonic: true - exporter_enqueue_failed_metric_points: + otelcol_exporter_enqueue_failed_metric_points: enabled: true description: Number of metric points failed to be added to the sending queue. unit: 1 @@ -57,7 +57,7 @@ telemetry: value_type: int monotonic: true - exporter_sent_log_records: + otelcol_exporter_sent_log_records: enabled: true description: Number of log record successfully sent to destination. unit: 1 @@ -65,7 +65,7 @@ telemetry: value_type: int monotonic: true - exporter_send_failed_log_records: + otelcol_exporter_send_failed_log_records: enabled: true description: Number of log records in failed attempts to send to destination. unit: 1 @@ -73,7 +73,7 @@ telemetry: value_type: int monotonic: true - exporter_enqueue_failed_log_records: + otelcol_exporter_enqueue_failed_log_records: enabled: true description: Number of log records failed to be added to the sending queue. unit: 1 @@ -81,7 +81,7 @@ telemetry: value_type: int monotonic: true - exporter_queue_size: + otelcol_exporter_queue_size: enabled: true description: Current size of the retry queue (in batches) unit: 1 @@ -90,7 +90,7 @@ telemetry: value_type: int async: true - exporter_queue_capacity: + otelcol_exporter_queue_capacity: enabled: true description: Fixed capacity of the retry queue (in batches) unit: 1 diff --git a/exporter/exporterhelper/obsexporter.go b/exporter/exporterhelper/obsexporter.go index 8093bd1f834..b8d41862b78 100644 --- a/exporter/exporterhelper/obsexporter.go +++ b/exporter/exporterhelper/obsexporter.go @@ -117,14 +117,14 @@ func (or *ObsReport) recordMetrics(ctx context.Context, dataType component.DataT var sentMeasure, failedMeasure metric.Int64Counter switch dataType { case component.DataTypeTraces: - sentMeasure = or.telemetryBuilder.ExporterSentSpans - failedMeasure = or.telemetryBuilder.ExporterSendFailedSpans + sentMeasure = or.telemetryBuilder.OtelcolExporterSentSpans + failedMeasure = or.telemetryBuilder.OtelcolExporterSendFailedSpans case component.DataTypeMetrics: - sentMeasure = or.telemetryBuilder.ExporterSentMetricPoints - failedMeasure = or.telemetryBuilder.ExporterSendFailedMetricPoints + sentMeasure = or.telemetryBuilder.OtelcolExporterSentMetricPoints + failedMeasure = or.telemetryBuilder.OtelcolExporterSendFailedMetricPoints case component.DataTypeLogs: - sentMeasure = or.telemetryBuilder.ExporterSentLogRecords - failedMeasure = or.telemetryBuilder.ExporterSendFailedLogRecords + sentMeasure = or.telemetryBuilder.OtelcolExporterSentLogRecords + failedMeasure = or.telemetryBuilder.OtelcolExporterSendFailedLogRecords } sentMeasure.Add(ctx, sent, metric.WithAttributes(or.otelAttrs...)) @@ -157,11 +157,11 @@ func (or *ObsReport) recordEnqueueFailure(ctx context.Context, dataType componen var enqueueFailedMeasure metric.Int64Counter switch dataType { case component.DataTypeTraces: - enqueueFailedMeasure = or.telemetryBuilder.ExporterEnqueueFailedSpans + enqueueFailedMeasure = or.telemetryBuilder.OtelcolExporterEnqueueFailedSpans case component.DataTypeMetrics: - enqueueFailedMeasure = or.telemetryBuilder.ExporterEnqueueFailedMetricPoints + enqueueFailedMeasure = or.telemetryBuilder.OtelcolExporterEnqueueFailedMetricPoints case component.DataTypeLogs: - enqueueFailedMeasure = or.telemetryBuilder.ExporterEnqueueFailedLogRecords + enqueueFailedMeasure = or.telemetryBuilder.OtelcolExporterEnqueueFailedLogRecords } enqueueFailedMeasure.Add(ctx, failed, metric.WithAttributes(or.otelAttrs...)) diff --git a/processor/processorhelper/documentation.md b/processor/processorhelper/documentation.md index 073fc9a7219..f1285f8ee7f 100644 --- a/processor/processorhelper/documentation.md +++ b/processor/processorhelper/documentation.md @@ -6,7 +6,7 @@ The following telemetry is emitted by this component. -### processor_accepted_log_records +### otelcol_processor_accepted_log_records Number of log records successfully pushed into the next component in the pipeline. @@ -14,7 +14,7 @@ Number of log records successfully pushed into the next component in the pipelin | ---- | ----------- | ---------- | --------- | | 1 | Sum | Int | true | -### processor_accepted_metric_points +### otelcol_processor_accepted_metric_points Number of metric points successfully pushed into the next component in the pipeline. @@ -22,7 +22,7 @@ Number of metric points successfully pushed into the next component in the pipel | ---- | ----------- | ---------- | --------- | | 1 | Sum | Int | true | -### processor_accepted_spans +### otelcol_processor_accepted_spans Number of spans successfully pushed into the next component in the pipeline. @@ -30,7 +30,7 @@ Number of spans successfully pushed into the next component in the pipeline. | ---- | ----------- | ---------- | --------- | | 1 | Sum | Int | true | -### processor_dropped_log_records +### otelcol_processor_dropped_log_records Number of log records that were dropped. @@ -38,7 +38,7 @@ Number of log records that were dropped. | ---- | ----------- | ---------- | --------- | | 1 | Sum | Int | true | -### processor_dropped_metric_points +### otelcol_processor_dropped_metric_points Number of metric points that were dropped. @@ -46,7 +46,7 @@ Number of metric points that were dropped. | ---- | ----------- | ---------- | --------- | | 1 | Sum | Int | true | -### processor_dropped_spans +### otelcol_processor_dropped_spans Number of spans that were dropped. @@ -54,7 +54,7 @@ Number of spans that were dropped. | ---- | ----------- | ---------- | --------- | | 1 | Sum | Int | true | -### processor_refused_log_records +### otelcol_processor_refused_log_records Number of log records that were rejected by the next component in the pipeline. @@ -62,7 +62,7 @@ Number of log records that were rejected by the next component in the pipeline. | ---- | ----------- | ---------- | --------- | | 1 | Sum | Int | true | -### processor_refused_metric_points +### otelcol_processor_refused_metric_points Number of metric points that were rejected by the next component in the pipeline. @@ -70,7 +70,7 @@ Number of metric points that were rejected by the next component in the pipeline | ---- | ----------- | ---------- | --------- | | 1 | Sum | Int | true | -### processor_refused_spans +### otelcol_processor_refused_spans Number of spans that were rejected by the next component in the pipeline. diff --git a/processor/processorhelper/internal/metadata/generated_telemetry.go b/processor/processorhelper/internal/metadata/generated_telemetry.go index 94d738f4a63..9ce94576efc 100644 --- a/processor/processorhelper/internal/metadata/generated_telemetry.go +++ b/processor/processorhelper/internal/metadata/generated_telemetry.go @@ -24,17 +24,17 @@ func Tracer(settings component.TelemetrySettings) trace.Tracer { // TelemetryBuilder provides an interface for components to report telemetry // as defined in metadata and user config. type TelemetryBuilder struct { - meter metric.Meter - ProcessorAcceptedLogRecords metric.Int64Counter - ProcessorAcceptedMetricPoints metric.Int64Counter - ProcessorAcceptedSpans metric.Int64Counter - ProcessorDroppedLogRecords metric.Int64Counter - ProcessorDroppedMetricPoints metric.Int64Counter - ProcessorDroppedSpans metric.Int64Counter - ProcessorRefusedLogRecords metric.Int64Counter - ProcessorRefusedMetricPoints metric.Int64Counter - ProcessorRefusedSpans metric.Int64Counter - level configtelemetry.Level + meter metric.Meter + OtelcolProcessorAcceptedLogRecords metric.Int64Counter + OtelcolProcessorAcceptedMetricPoints metric.Int64Counter + OtelcolProcessorAcceptedSpans metric.Int64Counter + OtelcolProcessorDroppedLogRecords metric.Int64Counter + OtelcolProcessorDroppedMetricPoints metric.Int64Counter + OtelcolProcessorDroppedSpans metric.Int64Counter + OtelcolProcessorRefusedLogRecords metric.Int64Counter + OtelcolProcessorRefusedMetricPoints metric.Int64Counter + OtelcolProcessorRefusedSpans metric.Int64Counter + level configtelemetry.Level } // telemetryBuilderOption applies changes to default builder. @@ -60,56 +60,56 @@ func NewTelemetryBuilder(settings component.TelemetrySettings, options ...teleme } else { builder.meter = noop.Meter{} } - builder.ProcessorAcceptedLogRecords, err = builder.meter.Int64Counter( - "processor_accepted_log_records", + builder.OtelcolProcessorAcceptedLogRecords, err = builder.meter.Int64Counter( + "otelcol_processor_accepted_log_records", metric.WithDescription("Number of log records successfully pushed into the next component in the pipeline."), metric.WithUnit("1"), ) errs = errors.Join(errs, err) - builder.ProcessorAcceptedMetricPoints, err = builder.meter.Int64Counter( - "processor_accepted_metric_points", + builder.OtelcolProcessorAcceptedMetricPoints, err = builder.meter.Int64Counter( + "otelcol_processor_accepted_metric_points", metric.WithDescription("Number of metric points successfully pushed into the next component in the pipeline."), metric.WithUnit("1"), ) errs = errors.Join(errs, err) - builder.ProcessorAcceptedSpans, err = builder.meter.Int64Counter( - "processor_accepted_spans", + builder.OtelcolProcessorAcceptedSpans, err = builder.meter.Int64Counter( + "otelcol_processor_accepted_spans", metric.WithDescription("Number of spans successfully pushed into the next component in the pipeline."), metric.WithUnit("1"), ) errs = errors.Join(errs, err) - builder.ProcessorDroppedLogRecords, err = builder.meter.Int64Counter( - "processor_dropped_log_records", + builder.OtelcolProcessorDroppedLogRecords, err = builder.meter.Int64Counter( + "otelcol_processor_dropped_log_records", metric.WithDescription("Number of log records that were dropped."), metric.WithUnit("1"), ) errs = errors.Join(errs, err) - builder.ProcessorDroppedMetricPoints, err = builder.meter.Int64Counter( - "processor_dropped_metric_points", + builder.OtelcolProcessorDroppedMetricPoints, err = builder.meter.Int64Counter( + "otelcol_processor_dropped_metric_points", metric.WithDescription("Number of metric points that were dropped."), metric.WithUnit("1"), ) errs = errors.Join(errs, err) - builder.ProcessorDroppedSpans, err = builder.meter.Int64Counter( - "processor_dropped_spans", + builder.OtelcolProcessorDroppedSpans, err = builder.meter.Int64Counter( + "otelcol_processor_dropped_spans", metric.WithDescription("Number of spans that were dropped."), metric.WithUnit("1"), ) errs = errors.Join(errs, err) - builder.ProcessorRefusedLogRecords, err = builder.meter.Int64Counter( - "processor_refused_log_records", + builder.OtelcolProcessorRefusedLogRecords, err = builder.meter.Int64Counter( + "otelcol_processor_refused_log_records", metric.WithDescription("Number of log records that were rejected by the next component in the pipeline."), metric.WithUnit("1"), ) errs = errors.Join(errs, err) - builder.ProcessorRefusedMetricPoints, err = builder.meter.Int64Counter( - "processor_refused_metric_points", + builder.OtelcolProcessorRefusedMetricPoints, err = builder.meter.Int64Counter( + "otelcol_processor_refused_metric_points", metric.WithDescription("Number of metric points that were rejected by the next component in the pipeline."), metric.WithUnit("1"), ) errs = errors.Join(errs, err) - builder.ProcessorRefusedSpans, err = builder.meter.Int64Counter( - "processor_refused_spans", + builder.OtelcolProcessorRefusedSpans, err = builder.meter.Int64Counter( + "otelcol_processor_refused_spans", metric.WithDescription("Number of spans that were rejected by the next component in the pipeline."), metric.WithUnit("1"), ) diff --git a/processor/processorhelper/metadata.yaml b/processor/processorhelper/metadata.yaml index 7e0c72f5c9c..04304d9e625 100644 --- a/processor/processorhelper/metadata.yaml +++ b/processor/processorhelper/metadata.yaml @@ -9,7 +9,7 @@ status: telemetry: metrics: - processor_accepted_spans: + otelcol_processor_accepted_spans: enabled: true description: Number of spans successfully pushed into the next component in the pipeline. unit: 1 @@ -17,7 +17,7 @@ telemetry: value_type: int monotonic: true - processor_refused_spans: + otelcol_processor_refused_spans: enabled: true description: Number of spans that were rejected by the next component in the pipeline. unit: 1 @@ -25,7 +25,7 @@ telemetry: value_type: int monotonic: true - processor_dropped_spans: + otelcol_processor_dropped_spans: enabled: true description: Number of spans that were dropped. unit: 1 @@ -33,7 +33,7 @@ telemetry: value_type: int monotonic: true - processor_accepted_metric_points: + otelcol_processor_accepted_metric_points: enabled: true description: Number of metric points successfully pushed into the next component in the pipeline. unit: 1 @@ -41,7 +41,7 @@ telemetry: value_type: int monotonic: true - processor_refused_metric_points: + otelcol_processor_refused_metric_points: enabled: true description: Number of metric points that were rejected by the next component in the pipeline. unit: 1 @@ -49,7 +49,7 @@ telemetry: value_type: int monotonic: true - processor_dropped_metric_points: + otelcol_processor_dropped_metric_points: enabled: true description: Number of metric points that were dropped. unit: 1 @@ -57,7 +57,7 @@ telemetry: value_type: int monotonic: true - processor_accepted_log_records: + otelcol_processor_accepted_log_records: enabled: true description: Number of log records successfully pushed into the next component in the pipeline. unit: 1 @@ -65,7 +65,7 @@ telemetry: value_type: int monotonic: true - processor_refused_log_records: + otelcol_processor_refused_log_records: enabled: true description: Number of log records that were rejected by the next component in the pipeline. unit: 1 @@ -73,7 +73,7 @@ telemetry: value_type: int monotonic: true - processor_dropped_log_records: + otelcol_processor_dropped_log_records: enabled: true description: Number of log records that were dropped. unit: 1 diff --git a/processor/processorhelper/obsreport.go b/processor/processorhelper/obsreport.go index ad46303da6b..14035377634 100644 --- a/processor/processorhelper/obsreport.go +++ b/processor/processorhelper/obsreport.go @@ -64,17 +64,17 @@ func (or *ObsReport) recordData(ctx context.Context, dataType component.DataType var acceptedCount, refusedCount, droppedCount metric.Int64Counter switch dataType { case component.DataTypeTraces: - acceptedCount = or.telemetryBuilder.ProcessorAcceptedSpans - refusedCount = or.telemetryBuilder.ProcessorRefusedSpans - droppedCount = or.telemetryBuilder.ProcessorDroppedSpans + acceptedCount = or.telemetryBuilder.OtelcolProcessorAcceptedSpans + refusedCount = or.telemetryBuilder.OtelcolProcessorRefusedSpans + droppedCount = or.telemetryBuilder.OtelcolProcessorDroppedSpans case component.DataTypeMetrics: - acceptedCount = or.telemetryBuilder.ProcessorAcceptedMetricPoints - refusedCount = or.telemetryBuilder.ProcessorRefusedMetricPoints - droppedCount = or.telemetryBuilder.ProcessorDroppedMetricPoints + acceptedCount = or.telemetryBuilder.OtelcolProcessorAcceptedMetricPoints + refusedCount = or.telemetryBuilder.OtelcolProcessorRefusedMetricPoints + droppedCount = or.telemetryBuilder.OtelcolProcessorDroppedMetricPoints case component.DataTypeLogs: - acceptedCount = or.telemetryBuilder.ProcessorAcceptedLogRecords - refusedCount = or.telemetryBuilder.ProcessorRefusedLogRecords - droppedCount = or.telemetryBuilder.ProcessorDroppedLogRecords + acceptedCount = or.telemetryBuilder.OtelcolProcessorAcceptedLogRecords + refusedCount = or.telemetryBuilder.OtelcolProcessorRefusedLogRecords + droppedCount = or.telemetryBuilder.OtelcolProcessorDroppedLogRecords } acceptedCount.Add(ctx, accepted, metric.WithAttributes(or.otelAttrs...)) diff --git a/receiver/receiverhelper/documentation.md b/receiver/receiverhelper/documentation.md index 457a856618e..d3990dfe998 100644 --- a/receiver/receiverhelper/documentation.md +++ b/receiver/receiverhelper/documentation.md @@ -6,7 +6,7 @@ The following telemetry is emitted by this component. -### receiver_accepted_log_records +### otelcol_receiver_accepted_log_records Number of log records successfully pushed into the pipeline. @@ -14,7 +14,7 @@ Number of log records successfully pushed into the pipeline. | ---- | ----------- | ---------- | --------- | | 1 | Sum | Int | true | -### receiver_accepted_metric_points +### otelcol_receiver_accepted_metric_points Number of metric points successfully pushed into the pipeline. @@ -22,7 +22,7 @@ Number of metric points successfully pushed into the pipeline. | ---- | ----------- | ---------- | --------- | | 1 | Sum | Int | true | -### receiver_accepted_spans +### otelcol_receiver_accepted_spans Number of spans successfully pushed into the pipeline. @@ -30,7 +30,7 @@ Number of spans successfully pushed into the pipeline. | ---- | ----------- | ---------- | --------- | | 1 | Sum | Int | true | -### receiver_refused_log_records +### otelcol_receiver_refused_log_records Number of log records that could not be pushed into the pipeline. @@ -38,7 +38,7 @@ Number of log records that could not be pushed into the pipeline. | ---- | ----------- | ---------- | --------- | | 1 | Sum | Int | true | -### receiver_refused_metric_points +### otelcol_receiver_refused_metric_points Number of metric points that could not be pushed into the pipeline. @@ -46,7 +46,7 @@ Number of metric points that could not be pushed into the pipeline. | ---- | ----------- | ---------- | --------- | | 1 | Sum | Int | true | -### receiver_refused_spans +### otelcol_receiver_refused_spans Number of spans that could not be pushed into the pipeline. diff --git a/receiver/receiverhelper/internal/metadata/generated_telemetry.go b/receiver/receiverhelper/internal/metadata/generated_telemetry.go index 0300e413abd..b1b9255318c 100644 --- a/receiver/receiverhelper/internal/metadata/generated_telemetry.go +++ b/receiver/receiverhelper/internal/metadata/generated_telemetry.go @@ -24,14 +24,14 @@ func Tracer(settings component.TelemetrySettings) trace.Tracer { // TelemetryBuilder provides an interface for components to report telemetry // as defined in metadata and user config. type TelemetryBuilder struct { - meter metric.Meter - ReceiverAcceptedLogRecords metric.Int64Counter - ReceiverAcceptedMetricPoints metric.Int64Counter - ReceiverAcceptedSpans metric.Int64Counter - ReceiverRefusedLogRecords metric.Int64Counter - ReceiverRefusedMetricPoints metric.Int64Counter - ReceiverRefusedSpans metric.Int64Counter - level configtelemetry.Level + meter metric.Meter + OtelcolReceiverAcceptedLogRecords metric.Int64Counter + OtelcolReceiverAcceptedMetricPoints metric.Int64Counter + OtelcolReceiverAcceptedSpans metric.Int64Counter + OtelcolReceiverRefusedLogRecords metric.Int64Counter + OtelcolReceiverRefusedMetricPoints metric.Int64Counter + OtelcolReceiverRefusedSpans metric.Int64Counter + level configtelemetry.Level } // telemetryBuilderOption applies changes to default builder. @@ -57,38 +57,38 @@ func NewTelemetryBuilder(settings component.TelemetrySettings, options ...teleme } else { builder.meter = noop.Meter{} } - builder.ReceiverAcceptedLogRecords, err = builder.meter.Int64Counter( - "receiver_accepted_log_records", + builder.OtelcolReceiverAcceptedLogRecords, err = builder.meter.Int64Counter( + "otelcol_receiver_accepted_log_records", metric.WithDescription("Number of log records successfully pushed into the pipeline."), metric.WithUnit("1"), ) errs = errors.Join(errs, err) - builder.ReceiverAcceptedMetricPoints, err = builder.meter.Int64Counter( - "receiver_accepted_metric_points", + builder.OtelcolReceiverAcceptedMetricPoints, err = builder.meter.Int64Counter( + "otelcol_receiver_accepted_metric_points", metric.WithDescription("Number of metric points successfully pushed into the pipeline."), metric.WithUnit("1"), ) errs = errors.Join(errs, err) - builder.ReceiverAcceptedSpans, err = builder.meter.Int64Counter( - "receiver_accepted_spans", + builder.OtelcolReceiverAcceptedSpans, err = builder.meter.Int64Counter( + "otelcol_receiver_accepted_spans", metric.WithDescription("Number of spans successfully pushed into the pipeline."), metric.WithUnit("1"), ) errs = errors.Join(errs, err) - builder.ReceiverRefusedLogRecords, err = builder.meter.Int64Counter( - "receiver_refused_log_records", + builder.OtelcolReceiverRefusedLogRecords, err = builder.meter.Int64Counter( + "otelcol_receiver_refused_log_records", metric.WithDescription("Number of log records that could not be pushed into the pipeline."), metric.WithUnit("1"), ) errs = errors.Join(errs, err) - builder.ReceiverRefusedMetricPoints, err = builder.meter.Int64Counter( - "receiver_refused_metric_points", + builder.OtelcolReceiverRefusedMetricPoints, err = builder.meter.Int64Counter( + "otelcol_receiver_refused_metric_points", metric.WithDescription("Number of metric points that could not be pushed into the pipeline."), metric.WithUnit("1"), ) errs = errors.Join(errs, err) - builder.ReceiverRefusedSpans, err = builder.meter.Int64Counter( - "receiver_refused_spans", + builder.OtelcolReceiverRefusedSpans, err = builder.meter.Int64Counter( + "otelcol_receiver_refused_spans", metric.WithDescription("Number of spans that could not be pushed into the pipeline."), metric.WithUnit("1"), ) diff --git a/receiver/receiverhelper/metadata.yaml b/receiver/receiverhelper/metadata.yaml index 2897d549a70..047261abc74 100644 --- a/receiver/receiverhelper/metadata.yaml +++ b/receiver/receiverhelper/metadata.yaml @@ -9,7 +9,7 @@ status: telemetry: metrics: - receiver_accepted_spans: + otelcol_receiver_accepted_spans: enabled: true description: Number of spans successfully pushed into the pipeline. unit: 1 @@ -17,7 +17,7 @@ telemetry: value_type: int monotonic: true - receiver_refused_spans: + otelcol_receiver_refused_spans: enabled: true description: Number of spans that could not be pushed into the pipeline. unit: 1 @@ -25,7 +25,7 @@ telemetry: value_type: int monotonic: true - receiver_accepted_metric_points: + otelcol_receiver_accepted_metric_points: enabled: true description: Number of metric points successfully pushed into the pipeline. unit: 1 @@ -33,7 +33,7 @@ telemetry: value_type: int monotonic: true - receiver_refused_metric_points: + otelcol_receiver_refused_metric_points: enabled: true description: Number of metric points that could not be pushed into the pipeline. unit: 1 @@ -41,7 +41,7 @@ telemetry: value_type: int monotonic: true - receiver_accepted_log_records: + otelcol_receiver_accepted_log_records: enabled: true description: Number of log records successfully pushed into the pipeline. unit: 1 @@ -49,7 +49,7 @@ telemetry: value_type: int monotonic: true - receiver_refused_log_records: + otelcol_receiver_refused_log_records: enabled: true description: Number of log records that could not be pushed into the pipeline. unit: 1 diff --git a/receiver/receiverhelper/obsreport.go b/receiver/receiverhelper/obsreport.go index f3904061329..34e0ef9dced 100644 --- a/receiver/receiverhelper/obsreport.go +++ b/receiver/receiverhelper/obsreport.go @@ -201,14 +201,14 @@ func (rec *ObsReport) recordMetrics(receiverCtx context.Context, dataType compon var acceptedMeasure, refusedMeasure metric.Int64Counter switch dataType { case component.DataTypeTraces: - acceptedMeasure = rec.telemetryBuilder.ReceiverAcceptedSpans - refusedMeasure = rec.telemetryBuilder.ReceiverRefusedSpans + acceptedMeasure = rec.telemetryBuilder.OtelcolReceiverAcceptedSpans + refusedMeasure = rec.telemetryBuilder.OtelcolReceiverRefusedSpans case component.DataTypeMetrics: - acceptedMeasure = rec.telemetryBuilder.ReceiverAcceptedMetricPoints - refusedMeasure = rec.telemetryBuilder.ReceiverRefusedMetricPoints + acceptedMeasure = rec.telemetryBuilder.OtelcolReceiverAcceptedMetricPoints + refusedMeasure = rec.telemetryBuilder.OtelcolReceiverRefusedMetricPoints case component.DataTypeLogs: - acceptedMeasure = rec.telemetryBuilder.ReceiverAcceptedLogRecords - refusedMeasure = rec.telemetryBuilder.ReceiverRefusedLogRecords + acceptedMeasure = rec.telemetryBuilder.OtelcolReceiverAcceptedLogRecords + refusedMeasure = rec.telemetryBuilder.OtelcolReceiverRefusedLogRecords } acceptedMeasure.Add(receiverCtx, int64(numAccepted), metric.WithAttributes(rec.otelAttrs...)) diff --git a/receiver/scraperhelper/documentation.md b/receiver/scraperhelper/documentation.md index b3f2ae00b94..a582be9c5f1 100644 --- a/receiver/scraperhelper/documentation.md +++ b/receiver/scraperhelper/documentation.md @@ -6,7 +6,7 @@ The following telemetry is emitted by this component. -### scraper_errored_metric_points +### otelcol_scraper_errored_metric_points Number of metric points that were unable to be scraped. @@ -14,7 +14,7 @@ Number of metric points that were unable to be scraped. | ---- | ----------- | ---------- | --------- | | 1 | Sum | Int | true | -### scraper_scraped_metric_points +### otelcol_scraper_scraped_metric_points Number of metric points successfully scraped. diff --git a/receiver/scraperhelper/internal/metadata/generated_telemetry.go b/receiver/scraperhelper/internal/metadata/generated_telemetry.go index 88c77973369..d8b86c975f6 100644 --- a/receiver/scraperhelper/internal/metadata/generated_telemetry.go +++ b/receiver/scraperhelper/internal/metadata/generated_telemetry.go @@ -24,10 +24,10 @@ func Tracer(settings component.TelemetrySettings) trace.Tracer { // TelemetryBuilder provides an interface for components to report telemetry // as defined in metadata and user config. type TelemetryBuilder struct { - meter metric.Meter - ScraperErroredMetricPoints metric.Int64Counter - ScraperScrapedMetricPoints metric.Int64Counter - level configtelemetry.Level + meter metric.Meter + OtelcolScraperErroredMetricPoints metric.Int64Counter + OtelcolScraperScrapedMetricPoints metric.Int64Counter + level configtelemetry.Level } // telemetryBuilderOption applies changes to default builder. @@ -53,14 +53,14 @@ func NewTelemetryBuilder(settings component.TelemetrySettings, options ...teleme } else { builder.meter = noop.Meter{} } - builder.ScraperErroredMetricPoints, err = builder.meter.Int64Counter( - "scraper_errored_metric_points", + builder.OtelcolScraperErroredMetricPoints, err = builder.meter.Int64Counter( + "otelcol_scraper_errored_metric_points", metric.WithDescription("Number of metric points that were unable to be scraped."), metric.WithUnit("1"), ) errs = errors.Join(errs, err) - builder.ScraperScrapedMetricPoints, err = builder.meter.Int64Counter( - "scraper_scraped_metric_points", + builder.OtelcolScraperScrapedMetricPoints, err = builder.meter.Int64Counter( + "otelcol_scraper_scraped_metric_points", metric.WithDescription("Number of metric points successfully scraped."), metric.WithUnit("1"), ) diff --git a/receiver/scraperhelper/metadata.yaml b/receiver/scraperhelper/metadata.yaml index 33a1080e7dd..89283ab15af 100644 --- a/receiver/scraperhelper/metadata.yaml +++ b/receiver/scraperhelper/metadata.yaml @@ -9,7 +9,7 @@ status: telemetry: metrics: - scraper_scraped_metric_points: + otelcol_scraper_scraped_metric_points: enabled: true description: Number of metric points successfully scraped. unit: 1 @@ -17,7 +17,7 @@ telemetry: value_type: int monotonic: true - scraper_errored_metric_points: + otelcol_scraper_errored_metric_points: enabled: true description: Number of metric points that were unable to be scraped. unit: 1 diff --git a/service/documentation.md b/service/documentation.md index 2cbd48a0708..2d10879a607 100644 --- a/service/documentation.md +++ b/service/documentation.md @@ -6,7 +6,7 @@ The following telemetry is emitted by this component. -### process_cpu_seconds +### otelcol_process_cpu_seconds Total CPU user and system time in seconds @@ -14,7 +14,7 @@ Total CPU user and system time in seconds | ---- | ----------- | ---------- | --------- | | s | Sum | Double | true | -### process_memory_rss +### otelcol_process_memory_rss Total physical memory (resident set size) @@ -22,7 +22,7 @@ Total physical memory (resident set size) | ---- | ----------- | ---------- | | By | Gauge | Int | -### process_runtime_heap_alloc_bytes +### otelcol_process_runtime_heap_alloc_bytes Bytes of allocated heap objects (see 'go doc runtime.MemStats.HeapAlloc') @@ -30,7 +30,7 @@ Bytes of allocated heap objects (see 'go doc runtime.MemStats.HeapAlloc') | ---- | ----------- | ---------- | | By | Gauge | Int | -### process_runtime_total_alloc_bytes +### otelcol_process_runtime_total_alloc_bytes Cumulative bytes allocated for heap objects (see 'go doc runtime.MemStats.TotalAlloc') @@ -38,7 +38,7 @@ Cumulative bytes allocated for heap objects (see 'go doc runtime.MemStats.TotalA | ---- | ----------- | ---------- | --------- | | By | Sum | Int | true | -### process_runtime_total_sys_memory_bytes +### otelcol_process_runtime_total_sys_memory_bytes Total bytes of memory obtained from the OS (see 'go doc runtime.MemStats.Sys') @@ -46,7 +46,7 @@ Total bytes of memory obtained from the OS (see 'go doc runtime.MemStats.Sys') | ---- | ----------- | ---------- | | By | Gauge | Int | -### process_uptime +### otelcol_process_uptime Uptime of the process diff --git a/service/internal/metadata/generated_telemetry.go b/service/internal/metadata/generated_telemetry.go index dac0e287f35..e541ab1ed19 100644 --- a/service/internal/metadata/generated_telemetry.go +++ b/service/internal/metadata/generated_telemetry.go @@ -26,21 +26,21 @@ func Tracer(settings component.TelemetrySettings) trace.Tracer { // TelemetryBuilder provides an interface for components to report telemetry // as defined in metadata and user config. type TelemetryBuilder struct { - meter metric.Meter - ProcessCPUSeconds metric.Float64ObservableCounter - observeProcessCPUSeconds func() float64 - ProcessMemoryRss metric.Int64ObservableGauge - observeProcessMemoryRss func() int64 - ProcessRuntimeHeapAllocBytes metric.Int64ObservableGauge - observeProcessRuntimeHeapAllocBytes func() int64 - ProcessRuntimeTotalAllocBytes metric.Int64ObservableCounter - observeProcessRuntimeTotalAllocBytes func() int64 - ProcessRuntimeTotalSysMemoryBytes metric.Int64ObservableGauge - observeProcessRuntimeTotalSysMemoryBytes func() int64 - ProcessUptime metric.Float64ObservableCounter - observeProcessUptime func() float64 - level configtelemetry.Level - attributeSet attribute.Set + meter metric.Meter + OtelcolProcessCPUSeconds metric.Float64ObservableCounter + observeOtelcolProcessCPUSeconds func() float64 + OtelcolProcessMemoryRss metric.Int64ObservableGauge + observeOtelcolProcessMemoryRss func() int64 + OtelcolProcessRuntimeHeapAllocBytes metric.Int64ObservableGauge + observeOtelcolProcessRuntimeHeapAllocBytes func() int64 + OtelcolProcessRuntimeTotalAllocBytes metric.Int64ObservableCounter + observeOtelcolProcessRuntimeTotalAllocBytes func() int64 + OtelcolProcessRuntimeTotalSysMemoryBytes metric.Int64ObservableGauge + observeOtelcolProcessRuntimeTotalSysMemoryBytes func() int64 + OtelcolProcessUptime metric.Float64ObservableCounter + observeOtelcolProcessUptime func() float64 + level configtelemetry.Level + attributeSet attribute.Set } // telemetryBuilderOption applies changes to default builder. @@ -60,45 +60,45 @@ func WithAttributeSet(set attribute.Set) telemetryBuilderOption { } } -// WithProcessCPUSecondsCallback sets callback for observable ProcessCPUSeconds metric. -func WithProcessCPUSecondsCallback(cb func() float64) telemetryBuilderOption { +// WithOtelcolProcessCPUSecondsCallback sets callback for observable OtelcolProcessCPUSeconds metric. +func WithOtelcolProcessCPUSecondsCallback(cb func() float64) telemetryBuilderOption { return func(builder *TelemetryBuilder) { - builder.observeProcessCPUSeconds = cb + builder.observeOtelcolProcessCPUSeconds = cb } } -// WithProcessMemoryRssCallback sets callback for observable ProcessMemoryRss metric. -func WithProcessMemoryRssCallback(cb func() int64) telemetryBuilderOption { +// WithOtelcolProcessMemoryRssCallback sets callback for observable OtelcolProcessMemoryRss metric. +func WithOtelcolProcessMemoryRssCallback(cb func() int64) telemetryBuilderOption { return func(builder *TelemetryBuilder) { - builder.observeProcessMemoryRss = cb + builder.observeOtelcolProcessMemoryRss = cb } } -// WithProcessRuntimeHeapAllocBytesCallback sets callback for observable ProcessRuntimeHeapAllocBytes metric. -func WithProcessRuntimeHeapAllocBytesCallback(cb func() int64) telemetryBuilderOption { +// WithOtelcolProcessRuntimeHeapAllocBytesCallback sets callback for observable OtelcolProcessRuntimeHeapAllocBytes metric. +func WithOtelcolProcessRuntimeHeapAllocBytesCallback(cb func() int64) telemetryBuilderOption { return func(builder *TelemetryBuilder) { - builder.observeProcessRuntimeHeapAllocBytes = cb + builder.observeOtelcolProcessRuntimeHeapAllocBytes = cb } } -// WithProcessRuntimeTotalAllocBytesCallback sets callback for observable ProcessRuntimeTotalAllocBytes metric. -func WithProcessRuntimeTotalAllocBytesCallback(cb func() int64) telemetryBuilderOption { +// WithOtelcolProcessRuntimeTotalAllocBytesCallback sets callback for observable OtelcolProcessRuntimeTotalAllocBytes metric. +func WithOtelcolProcessRuntimeTotalAllocBytesCallback(cb func() int64) telemetryBuilderOption { return func(builder *TelemetryBuilder) { - builder.observeProcessRuntimeTotalAllocBytes = cb + builder.observeOtelcolProcessRuntimeTotalAllocBytes = cb } } -// WithProcessRuntimeTotalSysMemoryBytesCallback sets callback for observable ProcessRuntimeTotalSysMemoryBytes metric. -func WithProcessRuntimeTotalSysMemoryBytesCallback(cb func() int64) telemetryBuilderOption { +// WithOtelcolProcessRuntimeTotalSysMemoryBytesCallback sets callback for observable OtelcolProcessRuntimeTotalSysMemoryBytes metric. +func WithOtelcolProcessRuntimeTotalSysMemoryBytesCallback(cb func() int64) telemetryBuilderOption { return func(builder *TelemetryBuilder) { - builder.observeProcessRuntimeTotalSysMemoryBytes = cb + builder.observeOtelcolProcessRuntimeTotalSysMemoryBytes = cb } } -// WithProcessUptimeCallback sets callback for observable ProcessUptime metric. -func WithProcessUptimeCallback(cb func() float64) telemetryBuilderOption { +// WithOtelcolProcessUptimeCallback sets callback for observable OtelcolProcessUptime metric. +func WithOtelcolProcessUptimeCallback(cb func() float64) telemetryBuilderOption { return func(builder *TelemetryBuilder) { - builder.observeProcessUptime = cb + builder.observeOtelcolProcessUptime = cb } } @@ -115,62 +115,62 @@ func NewTelemetryBuilder(settings component.TelemetrySettings, options ...teleme } else { builder.meter = noop.Meter{} } - builder.ProcessCPUSeconds, err = builder.meter.Float64ObservableCounter( - "process_cpu_seconds", + builder.OtelcolProcessCPUSeconds, err = builder.meter.Float64ObservableCounter( + "otelcol_process_cpu_seconds", metric.WithDescription("Total CPU user and system time in seconds"), metric.WithUnit("s"), metric.WithFloat64Callback(func(_ context.Context, o metric.Float64Observer) error { - o.Observe(builder.observeProcessCPUSeconds(), metric.WithAttributeSet(builder.attributeSet)) + o.Observe(builder.observeOtelcolProcessCPUSeconds(), metric.WithAttributeSet(builder.attributeSet)) return nil }), ) errs = errors.Join(errs, err) - builder.ProcessMemoryRss, err = builder.meter.Int64ObservableGauge( - "process_memory_rss", + builder.OtelcolProcessMemoryRss, err = builder.meter.Int64ObservableGauge( + "otelcol_process_memory_rss", metric.WithDescription("Total physical memory (resident set size)"), metric.WithUnit("By"), metric.WithInt64Callback(func(_ context.Context, o metric.Int64Observer) error { - o.Observe(builder.observeProcessMemoryRss(), metric.WithAttributeSet(builder.attributeSet)) + o.Observe(builder.observeOtelcolProcessMemoryRss(), metric.WithAttributeSet(builder.attributeSet)) return nil }), ) errs = errors.Join(errs, err) - builder.ProcessRuntimeHeapAllocBytes, err = builder.meter.Int64ObservableGauge( - "process_runtime_heap_alloc_bytes", + builder.OtelcolProcessRuntimeHeapAllocBytes, err = builder.meter.Int64ObservableGauge( + "otelcol_process_runtime_heap_alloc_bytes", metric.WithDescription("Bytes of allocated heap objects (see 'go doc runtime.MemStats.HeapAlloc')"), metric.WithUnit("By"), metric.WithInt64Callback(func(_ context.Context, o metric.Int64Observer) error { - o.Observe(builder.observeProcessRuntimeHeapAllocBytes(), metric.WithAttributeSet(builder.attributeSet)) + o.Observe(builder.observeOtelcolProcessRuntimeHeapAllocBytes(), metric.WithAttributeSet(builder.attributeSet)) return nil }), ) errs = errors.Join(errs, err) - builder.ProcessRuntimeTotalAllocBytes, err = builder.meter.Int64ObservableCounter( - "process_runtime_total_alloc_bytes", + builder.OtelcolProcessRuntimeTotalAllocBytes, err = builder.meter.Int64ObservableCounter( + "otelcol_process_runtime_total_alloc_bytes", metric.WithDescription("Cumulative bytes allocated for heap objects (see 'go doc runtime.MemStats.TotalAlloc')"), metric.WithUnit("By"), metric.WithInt64Callback(func(_ context.Context, o metric.Int64Observer) error { - o.Observe(builder.observeProcessRuntimeTotalAllocBytes(), metric.WithAttributeSet(builder.attributeSet)) + o.Observe(builder.observeOtelcolProcessRuntimeTotalAllocBytes(), metric.WithAttributeSet(builder.attributeSet)) return nil }), ) errs = errors.Join(errs, err) - builder.ProcessRuntimeTotalSysMemoryBytes, err = builder.meter.Int64ObservableGauge( - "process_runtime_total_sys_memory_bytes", + builder.OtelcolProcessRuntimeTotalSysMemoryBytes, err = builder.meter.Int64ObservableGauge( + "otelcol_process_runtime_total_sys_memory_bytes", metric.WithDescription("Total bytes of memory obtained from the OS (see 'go doc runtime.MemStats.Sys')"), metric.WithUnit("By"), metric.WithInt64Callback(func(_ context.Context, o metric.Int64Observer) error { - o.Observe(builder.observeProcessRuntimeTotalSysMemoryBytes(), metric.WithAttributeSet(builder.attributeSet)) + o.Observe(builder.observeOtelcolProcessRuntimeTotalSysMemoryBytes(), metric.WithAttributeSet(builder.attributeSet)) return nil }), ) errs = errors.Join(errs, err) - builder.ProcessUptime, err = builder.meter.Float64ObservableCounter( - "process_uptime", + builder.OtelcolProcessUptime, err = builder.meter.Float64ObservableCounter( + "otelcol_process_uptime", metric.WithDescription("Uptime of the process"), metric.WithUnit("s"), metric.WithFloat64Callback(func(_ context.Context, o metric.Float64Observer) error { - o.Observe(builder.observeProcessUptime(), metric.WithAttributeSet(builder.attributeSet)) + o.Observe(builder.observeOtelcolProcessUptime(), metric.WithAttributeSet(builder.attributeSet)) return nil }), ) diff --git a/service/internal/proctelemetry/process_telemetry.go b/service/internal/proctelemetry/process_telemetry.go index 9f8f0874e97..6ed74ee8c30 100644 --- a/service/internal/proctelemetry/process_telemetry.go +++ b/service/internal/proctelemetry/process_telemetry.go @@ -77,12 +77,12 @@ func RegisterProcessMetrics(cfg servicetelemetry.TelemetrySettings, ballastSizeB } _, err = metadata.NewTelemetryBuilder(cfg.ToComponentTelemetrySettings(&component.InstanceID{}), - metadata.WithProcessUptimeCallback(pm.updateProcessUptime), - metadata.WithProcessRuntimeHeapAllocBytesCallback(pm.updateAllocMem), - metadata.WithProcessRuntimeTotalAllocBytesCallback(pm.updateTotalAllocMem), - metadata.WithProcessRuntimeTotalSysMemoryBytesCallback(pm.updateSysMem), - metadata.WithProcessCPUSecondsCallback(pm.updateCPUSeconds), - metadata.WithProcessMemoryRssCallback(pm.updateRSSMemory), + metadata.WithOtelcolProcessUptimeCallback(pm.updateProcessUptime), + metadata.WithOtelcolProcessRuntimeHeapAllocBytesCallback(pm.updateAllocMem), + metadata.WithOtelcolProcessRuntimeTotalAllocBytesCallback(pm.updateTotalAllocMem), + metadata.WithOtelcolProcessRuntimeTotalSysMemoryBytesCallback(pm.updateSysMem), + metadata.WithOtelcolProcessCPUSecondsCallback(pm.updateCPUSeconds), + metadata.WithOtelcolProcessMemoryRssCallback(pm.updateRSSMemory), ) return err } diff --git a/service/metadata.yaml b/service/metadata.yaml index d5417740d57..6b4dd211a2c 100644 --- a/service/metadata.yaml +++ b/service/metadata.yaml @@ -16,7 +16,7 @@ tests: telemetry: metrics: - process_uptime: + otelcol_process_uptime: enabled: true description: Uptime of the process unit: s @@ -25,7 +25,7 @@ telemetry: value_type: double monotonic: true - process_runtime_heap_alloc_bytes: + otelcol_process_runtime_heap_alloc_bytes: enabled: true description: Bytes of allocated heap objects (see 'go doc runtime.MemStats.HeapAlloc') unit: By @@ -33,7 +33,7 @@ telemetry: async: true value_type: int - process_runtime_total_alloc_bytes: + otelcol_process_runtime_total_alloc_bytes: enabled: true description: Cumulative bytes allocated for heap objects (see 'go doc runtime.MemStats.TotalAlloc') unit: By @@ -42,7 +42,7 @@ telemetry: value_type: int monotonic: true - process_runtime_total_sys_memory_bytes: + otelcol_process_runtime_total_sys_memory_bytes: enabled: true description: Total bytes of memory obtained from the OS (see 'go doc runtime.MemStats.Sys') unit: By @@ -50,7 +50,7 @@ telemetry: async: true value_type: int - process_cpu_seconds: + otelcol_process_cpu_seconds: enabled: true description: Total CPU user and system time in seconds unit: s @@ -59,7 +59,7 @@ telemetry: value_type: double monotonic: true - process_memory_rss: + otelcol_process_memory_rss: enabled: true description: Total physical memory (resident set size) unit: By