From fedb9a12b135e7284823e88c01b7b50101e6ceb8 Mon Sep 17 00:00:00 2001 From: Honey Chaudhary Chandra Prakash Date: Fri, 19 Jul 2024 11:53:42 +0530 Subject: [PATCH 1/2] resolve#34143 [processor/groupbytrace] Update metric units This updates units for groupbytraceprocessor internal telemetry. --- .../groupbytraceprocessor/documentation.md | 30 +++++++++--------- .../generated_package_test.go | 1 - .../internal/metadata/generated_telemetry.go | 31 ++++++++++--------- .../metadata/generated_telemetry_test.go | 2 ++ processor/groupbytraceprocessor/metadata.yaml | 14 ++++----- 5 files changed, 40 insertions(+), 38 deletions(-) diff --git a/processor/groupbytraceprocessor/documentation.md b/processor/groupbytraceprocessor/documentation.md index 384939278508..4d3c9fae1867 100644 --- a/processor/groupbytraceprocessor/documentation.md +++ b/processor/groupbytraceprocessor/documentation.md @@ -6,23 +6,23 @@ The following telemetry is emitted by this component. -### otelcol_processor_groupbytrace_conf_num_traces +### processor_groupbytrace_conf_num_traces Maximum number of traces to hold in the internal storage | Unit | Metric Type | Value Type | | ---- | ----------- | ---------- | -| 1 | Gauge | Int | +| {traces} | Gauge | Int | -### otelcol_processor_groupbytrace_event_latency +### processor_groupbytrace_event_latency How long the queue events are taking to be processed | Unit | Metric Type | Value Type | | ---- | ----------- | ---------- | -| ms | Histogram | Int | +| {ms} | Histogram | Int | -### otelcol_processor_groupbytrace_incomplete_releases +### processor_groupbytrace_incomplete_releases Releases that are suspected to have been incomplete @@ -30,42 +30,42 @@ Releases that are suspected to have been incomplete | ---- | ----------- | ---------- | --------- | | | Sum | Int | true | -### otelcol_processor_groupbytrace_num_events_in_queue +### processor_groupbytrace_num_events_in_queue Number of events currently in the queue | Unit | Metric Type | Value Type | | ---- | ----------- | ---------- | -| 1 | Gauge | Int | +| {events} | Gauge | Int | -### otelcol_processor_groupbytrace_num_traces_in_memory +### processor_groupbytrace_num_traces_in_memory Number of traces currently in the in-memory storage | Unit | Metric Type | Value Type | | ---- | ----------- | ---------- | -| 1 | Gauge | Int | +| {traces} | Gauge | Int | -### otelcol_processor_groupbytrace_spans_released +### processor_groupbytrace_spans_released Spans released to the next consumer | Unit | Metric Type | Value Type | Monotonic | | ---- | ----------- | ---------- | --------- | -| 1 | Sum | Int | true | +| {spans} | Sum | Int | true | -### otelcol_processor_groupbytrace_traces_evicted +### processor_groupbytrace_traces_evicted Traces evicted from the internal buffer | Unit | Metric Type | Value Type | Monotonic | | ---- | ----------- | ---------- | --------- | -| 1 | Sum | Int | true | +| {traces} | Sum | Int | true | -### otelcol_processor_groupbytrace_traces_released +### processor_groupbytrace_traces_released Traces released to the next consumer | Unit | Metric Type | Value Type | Monotonic | | ---- | ----------- | ---------- | --------- | -| 1 | Sum | Int | true | +| {traces} | Sum | Int | true | diff --git a/processor/groupbytraceprocessor/generated_package_test.go b/processor/groupbytraceprocessor/generated_package_test.go index 84daac2b263f..e46dc5d98ba4 100644 --- a/processor/groupbytraceprocessor/generated_package_test.go +++ b/processor/groupbytraceprocessor/generated_package_test.go @@ -3,7 +3,6 @@ package groupbytraceprocessor import ( - "os" "testing" ) diff --git a/processor/groupbytraceprocessor/internal/metadata/generated_telemetry.go b/processor/groupbytraceprocessor/internal/metadata/generated_telemetry.go index 8d6f177c1c50..f65083f7ad27 100644 --- a/processor/groupbytraceprocessor/internal/metadata/generated_telemetry.go +++ b/processor/groupbytraceprocessor/internal/metadata/generated_telemetry.go @@ -3,6 +3,7 @@ package metadata import ( + "context" "errors" "go.opentelemetry.io/otel/metric" @@ -60,51 +61,51 @@ func NewTelemetryBuilder(settings component.TelemetrySettings, options ...teleme builder.meter = noop.Meter{} } builder.ProcessorGroupbytraceConfNumTraces, err = builder.meter.Int64Gauge( - "otelcol_processor_groupbytrace_conf_num_traces", + "processor_groupbytrace_conf_num_traces", metric.WithDescription("Maximum number of traces to hold in the internal storage"), - metric.WithUnit("1"), + metric.WithUnit("{traces}"), ) errs = errors.Join(errs, err) builder.ProcessorGroupbytraceEventLatency, err = builder.meter.Int64Histogram( - "otelcol_processor_groupbytrace_event_latency", + "processor_groupbytrace_event_latency", metric.WithDescription("How long the queue events are taking to be processed"), - metric.WithUnit("ms"), metric.WithExplicitBucketBoundaries([]float64{5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000}...), + metric.WithUnit("{ms}"), metric.WithExplicitBucketBoundaries([]float64{5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000}...), ) errs = errors.Join(errs, err) builder.ProcessorGroupbytraceIncompleteReleases, err = builder.meter.Int64Counter( - "otelcol_processor_groupbytrace_incomplete_releases", + "processor_groupbytrace_incomplete_releases", metric.WithDescription("Releases that are suspected to have been incomplete"), metric.WithUnit(""), ) errs = errors.Join(errs, err) builder.ProcessorGroupbytraceNumEventsInQueue, err = builder.meter.Int64Gauge( - "otelcol_processor_groupbytrace_num_events_in_queue", + "processor_groupbytrace_num_events_in_queue", metric.WithDescription("Number of events currently in the queue"), - metric.WithUnit("1"), + metric.WithUnit("{events}"), ) errs = errors.Join(errs, err) builder.ProcessorGroupbytraceNumTracesInMemory, err = builder.meter.Int64Gauge( - "otelcol_processor_groupbytrace_num_traces_in_memory", + "processor_groupbytrace_num_traces_in_memory", metric.WithDescription("Number of traces currently in the in-memory storage"), - metric.WithUnit("1"), + metric.WithUnit("{traces}"), ) errs = errors.Join(errs, err) builder.ProcessorGroupbytraceSpansReleased, err = builder.meter.Int64Counter( - "otelcol_processor_groupbytrace_spans_released", + "processor_groupbytrace_spans_released", metric.WithDescription("Spans released to the next consumer"), - metric.WithUnit("1"), + metric.WithUnit("{spans}"), ) errs = errors.Join(errs, err) builder.ProcessorGroupbytraceTracesEvicted, err = builder.meter.Int64Counter( - "otelcol_processor_groupbytrace_traces_evicted", + "processor_groupbytrace_traces_evicted", metric.WithDescription("Traces evicted from the internal buffer"), - metric.WithUnit("1"), + metric.WithUnit("{traces}"), ) errs = errors.Join(errs, err) builder.ProcessorGroupbytraceTracesReleased, err = builder.meter.Int64Counter( - "otelcol_processor_groupbytrace_traces_released", + "processor_groupbytrace_traces_released", metric.WithDescription("Traces released to the next consumer"), - metric.WithUnit("1"), + metric.WithUnit("{traces}"), ) errs = errors.Join(errs, err) return &builder, errs diff --git a/processor/groupbytraceprocessor/internal/metadata/generated_telemetry_test.go b/processor/groupbytraceprocessor/internal/metadata/generated_telemetry_test.go index 241a710c201a..3216aa6b450e 100644 --- a/processor/groupbytraceprocessor/internal/metadata/generated_telemetry_test.go +++ b/processor/groupbytraceprocessor/internal/metadata/generated_telemetry_test.go @@ -9,6 +9,8 @@ import ( "go.opentelemetry.io/otel/metric" embeddedmetric "go.opentelemetry.io/otel/metric/embedded" noopmetric "go.opentelemetry.io/otel/metric/noop" + sdkmetric "go.opentelemetry.io/otel/sdk/metric" + "go.opentelemetry.io/otel/sdk/metric/metricdata" "go.opentelemetry.io/otel/trace" embeddedtrace "go.opentelemetry.io/otel/trace/embedded" nooptrace "go.opentelemetry.io/otel/trace/noop" diff --git a/processor/groupbytraceprocessor/metadata.yaml b/processor/groupbytraceprocessor/metadata.yaml index 1ff46fea2e8c..d68ae61f6dd2 100644 --- a/processor/groupbytraceprocessor/metadata.yaml +++ b/processor/groupbytraceprocessor/metadata.yaml @@ -19,39 +19,39 @@ telemetry: processor_groupbytrace_conf_num_traces: enabled: true description: Maximum number of traces to hold in the internal storage - unit: "1" + unit: "{traces}" gauge: value_type: int processor_groupbytrace_num_events_in_queue: enabled: true description: Number of events currently in the queue - unit: "1" + unit: "{events}" gauge: value_type: int processor_groupbytrace_num_traces_in_memory: enabled: true description: Number of traces currently in the in-memory storage - unit: "1" + unit: "{traces}" gauge: value_type: int processor_groupbytrace_traces_evicted: enabled: true description: Traces evicted from the internal buffer - unit: "1" + unit: "{traces}" sum: value_type: int monotonic: true processor_groupbytrace_spans_released: enabled: true description: Spans released to the next consumer - unit: "1" + unit: "{spans}" sum: value_type: int monotonic: true processor_groupbytrace_traces_released: enabled: true description: Traces released to the next consumer - unit: "1" + unit: "{traces}" sum: value_type: int monotonic: true @@ -64,7 +64,7 @@ telemetry: processor_groupbytrace_event_latency: enabled: true description: How long the queue events are taking to be processed - unit: ms + unit: "{ms}" histogram: value_type: int bucket_boundaries: [5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000] From 95a4ca38319c7fa89b4412f7e6e8b6de972fc290 Mon Sep 17 00:00:00 2001 From: Honey Chaudhary Chandra Prakash Date: Fri, 19 Jul 2024 17:55:31 +0530 Subject: [PATCH 2/2] revert documentation change --- .../groupbytraceprocessor/documentation.md | 16 ++++++++-------- .../generated_package_test.go | 1 + .../internal/metadata/generated_telemetry.go | 17 ++++++++--------- .../metadata/generated_telemetry_test.go | 2 -- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/processor/groupbytraceprocessor/documentation.md b/processor/groupbytraceprocessor/documentation.md index 4d3c9fae1867..9cc549b382ab 100644 --- a/processor/groupbytraceprocessor/documentation.md +++ b/processor/groupbytraceprocessor/documentation.md @@ -6,7 +6,7 @@ The following telemetry is emitted by this component. -### processor_groupbytrace_conf_num_traces +### otelcol_processor_groupbytrace_conf_num_traces Maximum number of traces to hold in the internal storage @@ -14,7 +14,7 @@ Maximum number of traces to hold in the internal storage | ---- | ----------- | ---------- | | {traces} | Gauge | Int | -### processor_groupbytrace_event_latency +### otelcol_processor_groupbytrace_event_latency How long the queue events are taking to be processed @@ -22,7 +22,7 @@ How long the queue events are taking to be processed | ---- | ----------- | ---------- | | {ms} | Histogram | Int | -### processor_groupbytrace_incomplete_releases +### otelcol_processor_groupbytrace_incomplete_releases Releases that are suspected to have been incomplete @@ -30,7 +30,7 @@ Releases that are suspected to have been incomplete | ---- | ----------- | ---------- | --------- | | | Sum | Int | true | -### processor_groupbytrace_num_events_in_queue +### otelcol_processor_groupbytrace_num_events_in_queue Number of events currently in the queue @@ -38,7 +38,7 @@ Number of events currently in the queue | ---- | ----------- | ---------- | | {events} | Gauge | Int | -### processor_groupbytrace_num_traces_in_memory +### otelcol_processor_groupbytrace_num_traces_in_memory Number of traces currently in the in-memory storage @@ -46,7 +46,7 @@ Number of traces currently in the in-memory storage | ---- | ----------- | ---------- | | {traces} | Gauge | Int | -### processor_groupbytrace_spans_released +### otelcol_processor_groupbytrace_spans_released Spans released to the next consumer @@ -54,7 +54,7 @@ Spans released to the next consumer | ---- | ----------- | ---------- | --------- | | {spans} | Sum | Int | true | -### processor_groupbytrace_traces_evicted +### otelcol_processor_groupbytrace_traces_evicted Traces evicted from the internal buffer @@ -62,7 +62,7 @@ Traces evicted from the internal buffer | ---- | ----------- | ---------- | --------- | | {traces} | Sum | Int | true | -### processor_groupbytrace_traces_released +### otelcol_processor_groupbytrace_traces_released Traces released to the next consumer diff --git a/processor/groupbytraceprocessor/generated_package_test.go b/processor/groupbytraceprocessor/generated_package_test.go index e46dc5d98ba4..84daac2b263f 100644 --- a/processor/groupbytraceprocessor/generated_package_test.go +++ b/processor/groupbytraceprocessor/generated_package_test.go @@ -3,6 +3,7 @@ package groupbytraceprocessor import ( + "os" "testing" ) diff --git a/processor/groupbytraceprocessor/internal/metadata/generated_telemetry.go b/processor/groupbytraceprocessor/internal/metadata/generated_telemetry.go index f65083f7ad27..13169f116ada 100644 --- a/processor/groupbytraceprocessor/internal/metadata/generated_telemetry.go +++ b/processor/groupbytraceprocessor/internal/metadata/generated_telemetry.go @@ -3,7 +3,6 @@ package metadata import ( - "context" "errors" "go.opentelemetry.io/otel/metric" @@ -61,49 +60,49 @@ func NewTelemetryBuilder(settings component.TelemetrySettings, options ...teleme builder.meter = noop.Meter{} } builder.ProcessorGroupbytraceConfNumTraces, err = builder.meter.Int64Gauge( - "processor_groupbytrace_conf_num_traces", + "otelcol_processor_groupbytrace_conf_num_traces", metric.WithDescription("Maximum number of traces to hold in the internal storage"), metric.WithUnit("{traces}"), ) errs = errors.Join(errs, err) builder.ProcessorGroupbytraceEventLatency, err = builder.meter.Int64Histogram( - "processor_groupbytrace_event_latency", + "otelcol_processor_groupbytrace_event_latency", metric.WithDescription("How long the queue events are taking to be processed"), metric.WithUnit("{ms}"), metric.WithExplicitBucketBoundaries([]float64{5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000}...), ) errs = errors.Join(errs, err) builder.ProcessorGroupbytraceIncompleteReleases, err = builder.meter.Int64Counter( - "processor_groupbytrace_incomplete_releases", + "otelcol_processor_groupbytrace_incomplete_releases", metric.WithDescription("Releases that are suspected to have been incomplete"), metric.WithUnit(""), ) errs = errors.Join(errs, err) builder.ProcessorGroupbytraceNumEventsInQueue, err = builder.meter.Int64Gauge( - "processor_groupbytrace_num_events_in_queue", + "otelcol_processor_groupbytrace_num_events_in_queue", metric.WithDescription("Number of events currently in the queue"), metric.WithUnit("{events}"), ) errs = errors.Join(errs, err) builder.ProcessorGroupbytraceNumTracesInMemory, err = builder.meter.Int64Gauge( - "processor_groupbytrace_num_traces_in_memory", + "otelcol_processor_groupbytrace_num_traces_in_memory", metric.WithDescription("Number of traces currently in the in-memory storage"), metric.WithUnit("{traces}"), ) errs = errors.Join(errs, err) builder.ProcessorGroupbytraceSpansReleased, err = builder.meter.Int64Counter( - "processor_groupbytrace_spans_released", + "otelcol_processor_groupbytrace_spans_released", metric.WithDescription("Spans released to the next consumer"), metric.WithUnit("{spans}"), ) errs = errors.Join(errs, err) builder.ProcessorGroupbytraceTracesEvicted, err = builder.meter.Int64Counter( - "processor_groupbytrace_traces_evicted", + "otelcol_processor_groupbytrace_traces_evicted", metric.WithDescription("Traces evicted from the internal buffer"), metric.WithUnit("{traces}"), ) errs = errors.Join(errs, err) builder.ProcessorGroupbytraceTracesReleased, err = builder.meter.Int64Counter( - "processor_groupbytrace_traces_released", + "otelcol_processor_groupbytrace_traces_released", metric.WithDescription("Traces released to the next consumer"), metric.WithUnit("{traces}"), ) diff --git a/processor/groupbytraceprocessor/internal/metadata/generated_telemetry_test.go b/processor/groupbytraceprocessor/internal/metadata/generated_telemetry_test.go index 3216aa6b450e..241a710c201a 100644 --- a/processor/groupbytraceprocessor/internal/metadata/generated_telemetry_test.go +++ b/processor/groupbytraceprocessor/internal/metadata/generated_telemetry_test.go @@ -9,8 +9,6 @@ import ( "go.opentelemetry.io/otel/metric" embeddedmetric "go.opentelemetry.io/otel/metric/embedded" noopmetric "go.opentelemetry.io/otel/metric/noop" - sdkmetric "go.opentelemetry.io/otel/sdk/metric" - "go.opentelemetry.io/otel/sdk/metric/metricdata" "go.opentelemetry.io/otel/trace" embeddedtrace "go.opentelemetry.io/otel/trace/embedded" nooptrace "go.opentelemetry.io/otel/trace/noop"