Skip to content

Commit

Permalink
[batchprocessor] Update metric units (open-telemetry#10658)
Browse files Browse the repository at this point in the history
#### 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
open-telemetry#10652
  • Loading branch information
crobert-1 authored Aug 13, 2024
1 parent 74aaafb commit 3f4f0d0
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 25 deletions.
25 changes: 25 additions & 0 deletions .chloggen/batchprocessor_metric_units.yaml
Original file line number Diff line number Diff line change
@@ -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: batchprocessor

# 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: [10652]

# (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: []
26 changes: 13 additions & 13 deletions processor/batchprocessor/batch_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func TestBatchProcessorSentBySize(t *testing.T) {
{
Name: "otelcol_processor_batch_batch_send_size",
Description: "Number of units in the batch",
Unit: "1",
Unit: "{units}",
Data: metricdata.Histogram[int64]{
Temporality: metricdata.CumulativeTemporality,
DataPoints: []metricdata.HistogramDataPoint[int64]{
Expand All @@ -255,7 +255,7 @@ func TestBatchProcessorSentBySize(t *testing.T) {
{
Name: "otelcol_processor_batch_batch_size_trigger_send",
Description: "Number of times the batch was sent due to a size trigger",
Unit: "1",
Unit: "{times}",
Data: metricdata.Sum[int64]{
Temporality: metricdata.CumulativeTemporality,
IsMonotonic: true,
Expand All @@ -270,7 +270,7 @@ func TestBatchProcessorSentBySize(t *testing.T) {
{
Name: "otelcol_processor_batch_metadata_cardinality",
Description: "Number of distinct metadata value combinations being processed",
Unit: "1",
Unit: "{combinations}",
Data: metricdata.Sum[int64]{
Temporality: metricdata.CumulativeTemporality,
IsMonotonic: false,
Expand Down Expand Up @@ -362,7 +362,7 @@ func TestBatchProcessorSentBySizeWithMaxSize(t *testing.T) {
{
Name: "otelcol_processor_batch_batch_send_size",
Description: "Number of units in the batch",
Unit: "1",
Unit: "{units}",
Data: metricdata.Histogram[int64]{
Temporality: metricdata.CumulativeTemporality,
DataPoints: []metricdata.HistogramDataPoint[int64]{
Expand All @@ -381,7 +381,7 @@ func TestBatchProcessorSentBySizeWithMaxSize(t *testing.T) {
{
Name: "otelcol_processor_batch_batch_size_trigger_send",
Description: "Number of times the batch was sent due to a size trigger",
Unit: "1",
Unit: "{times}",
Data: metricdata.Sum[int64]{
Temporality: metricdata.CumulativeTemporality,
IsMonotonic: true,
Expand All @@ -396,7 +396,7 @@ func TestBatchProcessorSentBySizeWithMaxSize(t *testing.T) {
{
Name: "otelcol_processor_batch_timeout_trigger_send",
Description: "Number of times the batch was sent due to a timeout trigger",
Unit: "1",
Unit: "{times}",
Data: metricdata.Sum[int64]{
Temporality: metricdata.CumulativeTemporality,
IsMonotonic: true,
Expand All @@ -411,7 +411,7 @@ func TestBatchProcessorSentBySizeWithMaxSize(t *testing.T) {
{
Name: "otelcol_processor_batch_metadata_cardinality",
Description: "Number of distinct metadata value combinations being processed",
Unit: "1",
Unit: "{combinations}",
Data: metricdata.Sum[int64]{
Temporality: metricdata.CumulativeTemporality,
IsMonotonic: false,
Expand Down Expand Up @@ -625,7 +625,7 @@ func TestBatchMetricProcessorBatchSize(t *testing.T) {
{
Name: "otelcol_processor_batch_batch_send_size",
Description: "Number of units in the batch",
Unit: "1",
Unit: "{units}",
Data: metricdata.Histogram[int64]{
Temporality: metricdata.CumulativeTemporality,
DataPoints: []metricdata.HistogramDataPoint[int64]{
Expand All @@ -644,7 +644,7 @@ func TestBatchMetricProcessorBatchSize(t *testing.T) {
{
Name: "otelcol_processor_batch_batch_size_trigger_send",
Description: "Number of times the batch was sent due to a size trigger",
Unit: "1",
Unit: "{times}",
Data: metricdata.Sum[int64]{
Temporality: metricdata.CumulativeTemporality,
IsMonotonic: true,
Expand All @@ -659,7 +659,7 @@ func TestBatchMetricProcessorBatchSize(t *testing.T) {
{
Name: "otelcol_processor_batch_metadata_cardinality",
Description: "Number of distinct metadata value combinations being processed",
Unit: "1",
Unit: "{combinations}",
Data: metricdata.Sum[int64]{
Temporality: metricdata.CumulativeTemporality,
IsMonotonic: false,
Expand Down Expand Up @@ -1005,7 +1005,7 @@ func TestBatchLogProcessor_BatchSize(t *testing.T) {
{
Name: "otelcol_processor_batch_batch_send_size",
Description: "Number of units in the batch",
Unit: "1",
Unit: "{units}",
Data: metricdata.Histogram[int64]{
Temporality: metricdata.CumulativeTemporality,
DataPoints: []metricdata.HistogramDataPoint[int64]{
Expand All @@ -1024,7 +1024,7 @@ func TestBatchLogProcessor_BatchSize(t *testing.T) {
{
Name: "otelcol_processor_batch_batch_size_trigger_send",
Description: "Number of times the batch was sent due to a size trigger",
Unit: "1",
Unit: "{times}",
Data: metricdata.Sum[int64]{
Temporality: metricdata.CumulativeTemporality,
IsMonotonic: true,
Expand All @@ -1039,7 +1039,7 @@ func TestBatchLogProcessor_BatchSize(t *testing.T) {
{
Name: "otelcol_processor_batch_metadata_cardinality",
Description: "Number of distinct metadata value combinations being processed",
Unit: "1",
Unit: "{combinations}",
Data: metricdata.Sum[int64]{
Temporality: metricdata.CumulativeTemporality,
IsMonotonic: false,
Expand Down
8 changes: 4 additions & 4 deletions processor/batchprocessor/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Number of units in the batch

| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| 1 | Histogram | Int |
| {units} | Histogram | Int |

### otelcol_processor_batch_batch_send_size_bytes

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

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| 1 | Sum | Int | true |
| {times} | Sum | Int | true |

### otelcol_processor_batch_metadata_cardinality

Number of distinct metadata value combinations being processed

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| 1 | Sum | Int | false |
| {combinations} | Sum | Int | false |

### otelcol_processor_batch_timeout_trigger_send

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

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| 1 | Sum | Int | true |
| {times} | Sum | Int | true |

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions processor/batchprocessor/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ telemetry:
processor_batch_batch_size_trigger_send:
enabled: true
description: Number of times the batch was sent due to a size trigger
unit: "1"
unit: "{times}"
sum:
value_type: int
monotonic: true
processor_batch_timeout_trigger_send:
enabled: true
description: Number of times the batch was sent due to a timeout trigger
unit: "1"
unit: "{times}"
sum:
value_type: int
monotonic: true
processor_batch_batch_send_size:
enabled: true
description: Number of units in the batch
unit: "1"
unit: "{units}"
histogram:
value_type: int
bucket_boundaries: [10, 25, 50, 75, 100, 250, 500, 750, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 20000, 30000, 50000, 100000]
Expand All @@ -42,7 +42,7 @@ telemetry:
processor_batch_metadata_cardinality:
enabled: true
description: Number of distinct metadata value combinations being processed
unit: "1"
unit: "{combinations}"
sum:
value_type: int
async: true

0 comments on commit 3f4f0d0

Please sign in to comment.