Skip to content

Commit 3f4f0d0

Browse files
authored
[batchprocessor] Update metric units (#10658)
#### Description `1` isn't an informative metric unit. I've made a best-guess attempt at updating metric units, f**eedback is very necessary here**, the units are not very clear here. I attempted to match the unit with metric descriptions. [Semantic conventions for reference](https://opentelemetry.io/docs/specs/semconv/general/metrics/). #### Link to tracking issue Fixes #10652
1 parent 74aaafb commit 3f4f0d0

File tree

5 files changed

+50
-25
lines changed

5 files changed

+50
-25
lines changed
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: bug_fix
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
7+
component: batchprocessor
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Update units for internal telemetry
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [10652]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# Optional: The change log or logs in which this entry should be included.
21+
# e.g. '[user]' or '[user, api]'
22+
# Include 'user' if the change is relevant to end users.
23+
# Include 'api' if there is a change to a library API.
24+
# Default: '[user]'
25+
change_logs: []

processor/batchprocessor/batch_processor_test.go

+13-13
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ func TestBatchProcessorSentBySize(t *testing.T) {
236236
{
237237
Name: "otelcol_processor_batch_batch_send_size",
238238
Description: "Number of units in the batch",
239-
Unit: "1",
239+
Unit: "{units}",
240240
Data: metricdata.Histogram[int64]{
241241
Temporality: metricdata.CumulativeTemporality,
242242
DataPoints: []metricdata.HistogramDataPoint[int64]{
@@ -255,7 +255,7 @@ func TestBatchProcessorSentBySize(t *testing.T) {
255255
{
256256
Name: "otelcol_processor_batch_batch_size_trigger_send",
257257
Description: "Number of times the batch was sent due to a size trigger",
258-
Unit: "1",
258+
Unit: "{times}",
259259
Data: metricdata.Sum[int64]{
260260
Temporality: metricdata.CumulativeTemporality,
261261
IsMonotonic: true,
@@ -270,7 +270,7 @@ func TestBatchProcessorSentBySize(t *testing.T) {
270270
{
271271
Name: "otelcol_processor_batch_metadata_cardinality",
272272
Description: "Number of distinct metadata value combinations being processed",
273-
Unit: "1",
273+
Unit: "{combinations}",
274274
Data: metricdata.Sum[int64]{
275275
Temporality: metricdata.CumulativeTemporality,
276276
IsMonotonic: false,
@@ -362,7 +362,7 @@ func TestBatchProcessorSentBySizeWithMaxSize(t *testing.T) {
362362
{
363363
Name: "otelcol_processor_batch_batch_send_size",
364364
Description: "Number of units in the batch",
365-
Unit: "1",
365+
Unit: "{units}",
366366
Data: metricdata.Histogram[int64]{
367367
Temporality: metricdata.CumulativeTemporality,
368368
DataPoints: []metricdata.HistogramDataPoint[int64]{
@@ -381,7 +381,7 @@ func TestBatchProcessorSentBySizeWithMaxSize(t *testing.T) {
381381
{
382382
Name: "otelcol_processor_batch_batch_size_trigger_send",
383383
Description: "Number of times the batch was sent due to a size trigger",
384-
Unit: "1",
384+
Unit: "{times}",
385385
Data: metricdata.Sum[int64]{
386386
Temporality: metricdata.CumulativeTemporality,
387387
IsMonotonic: true,
@@ -396,7 +396,7 @@ func TestBatchProcessorSentBySizeWithMaxSize(t *testing.T) {
396396
{
397397
Name: "otelcol_processor_batch_timeout_trigger_send",
398398
Description: "Number of times the batch was sent due to a timeout trigger",
399-
Unit: "1",
399+
Unit: "{times}",
400400
Data: metricdata.Sum[int64]{
401401
Temporality: metricdata.CumulativeTemporality,
402402
IsMonotonic: true,
@@ -411,7 +411,7 @@ func TestBatchProcessorSentBySizeWithMaxSize(t *testing.T) {
411411
{
412412
Name: "otelcol_processor_batch_metadata_cardinality",
413413
Description: "Number of distinct metadata value combinations being processed",
414-
Unit: "1",
414+
Unit: "{combinations}",
415415
Data: metricdata.Sum[int64]{
416416
Temporality: metricdata.CumulativeTemporality,
417417
IsMonotonic: false,
@@ -625,7 +625,7 @@ func TestBatchMetricProcessorBatchSize(t *testing.T) {
625625
{
626626
Name: "otelcol_processor_batch_batch_send_size",
627627
Description: "Number of units in the batch",
628-
Unit: "1",
628+
Unit: "{units}",
629629
Data: metricdata.Histogram[int64]{
630630
Temporality: metricdata.CumulativeTemporality,
631631
DataPoints: []metricdata.HistogramDataPoint[int64]{
@@ -644,7 +644,7 @@ func TestBatchMetricProcessorBatchSize(t *testing.T) {
644644
{
645645
Name: "otelcol_processor_batch_batch_size_trigger_send",
646646
Description: "Number of times the batch was sent due to a size trigger",
647-
Unit: "1",
647+
Unit: "{times}",
648648
Data: metricdata.Sum[int64]{
649649
Temporality: metricdata.CumulativeTemporality,
650650
IsMonotonic: true,
@@ -659,7 +659,7 @@ func TestBatchMetricProcessorBatchSize(t *testing.T) {
659659
{
660660
Name: "otelcol_processor_batch_metadata_cardinality",
661661
Description: "Number of distinct metadata value combinations being processed",
662-
Unit: "1",
662+
Unit: "{combinations}",
663663
Data: metricdata.Sum[int64]{
664664
Temporality: metricdata.CumulativeTemporality,
665665
IsMonotonic: false,
@@ -1005,7 +1005,7 @@ func TestBatchLogProcessor_BatchSize(t *testing.T) {
10051005
{
10061006
Name: "otelcol_processor_batch_batch_send_size",
10071007
Description: "Number of units in the batch",
1008-
Unit: "1",
1008+
Unit: "{units}",
10091009
Data: metricdata.Histogram[int64]{
10101010
Temporality: metricdata.CumulativeTemporality,
10111011
DataPoints: []metricdata.HistogramDataPoint[int64]{
@@ -1024,7 +1024,7 @@ func TestBatchLogProcessor_BatchSize(t *testing.T) {
10241024
{
10251025
Name: "otelcol_processor_batch_batch_size_trigger_send",
10261026
Description: "Number of times the batch was sent due to a size trigger",
1027-
Unit: "1",
1027+
Unit: "{times}",
10281028
Data: metricdata.Sum[int64]{
10291029
Temporality: metricdata.CumulativeTemporality,
10301030
IsMonotonic: true,
@@ -1039,7 +1039,7 @@ func TestBatchLogProcessor_BatchSize(t *testing.T) {
10391039
{
10401040
Name: "otelcol_processor_batch_metadata_cardinality",
10411041
Description: "Number of distinct metadata value combinations being processed",
1042-
Unit: "1",
1042+
Unit: "{combinations}",
10431043
Data: metricdata.Sum[int64]{
10441044
Temporality: metricdata.CumulativeTemporality,
10451045
IsMonotonic: false,

processor/batchprocessor/documentation.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Number of units in the batch
1212

1313
| Unit | Metric Type | Value Type |
1414
| ---- | ----------- | ---------- |
15-
| 1 | Histogram | Int |
15+
| {units} | Histogram | Int |
1616

1717
### otelcol_processor_batch_batch_send_size_bytes
1818

@@ -28,20 +28,20 @@ Number of times the batch was sent due to a size trigger
2828

2929
| Unit | Metric Type | Value Type | Monotonic |
3030
| ---- | ----------- | ---------- | --------- |
31-
| 1 | Sum | Int | true |
31+
| {times} | Sum | Int | true |
3232

3333
### otelcol_processor_batch_metadata_cardinality
3434

3535
Number of distinct metadata value combinations being processed
3636

3737
| Unit | Metric Type | Value Type | Monotonic |
3838
| ---- | ----------- | ---------- | --------- |
39-
| 1 | Sum | Int | false |
39+
| {combinations} | Sum | Int | false |
4040

4141
### otelcol_processor_batch_timeout_trigger_send
4242

4343
Number of times the batch was sent due to a timeout trigger
4444

4545
| Unit | Metric Type | Value Type | Monotonic |
4646
| ---- | ----------- | ---------- | --------- |
47-
| 1 | Sum | Int | true |
47+
| {times} | Sum | Int | true |

processor/batchprocessor/internal/metadata/generated_telemetry.go

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

processor/batchprocessor/metadata.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ telemetry:
1414
processor_batch_batch_size_trigger_send:
1515
enabled: true
1616
description: Number of times the batch was sent due to a size trigger
17-
unit: "1"
17+
unit: "{times}"
1818
sum:
1919
value_type: int
2020
monotonic: true
2121
processor_batch_timeout_trigger_send:
2222
enabled: true
2323
description: Number of times the batch was sent due to a timeout trigger
24-
unit: "1"
24+
unit: "{times}"
2525
sum:
2626
value_type: int
2727
monotonic: true
2828
processor_batch_batch_send_size:
2929
enabled: true
3030
description: Number of units in the batch
31-
unit: "1"
31+
unit: "{units}"
3232
histogram:
3333
value_type: int
3434
bucket_boundaries: [10, 25, 50, 75, 100, 250, 500, 750, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 20000, 30000, 50000, 100000]
@@ -42,7 +42,7 @@ telemetry:
4242
processor_batch_metadata_cardinality:
4343
enabled: true
4444
description: Number of distinct metadata value combinations being processed
45-
unit: "1"
45+
unit: "{combinations}"
4646
sum:
4747
value_type: int
4848
async: true

0 commit comments

Comments
 (0)