Skip to content

[chore][samplereceiver] Update internal telemetry metric units #10672

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/mdatagen/internal/samplereceiver/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ 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_process_runtime_total_alloc_bytes

Expand All @@ -141,7 +141,7 @@ For example this metric only exists if feature A is enabled.

| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| 1 | Gauge | Int |
| {items} | Gauge | Int |

### otelcol_request_duration

Expand Down

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

4 changes: 2 additions & 2 deletions cmd/mdatagen/internal/samplereceiver/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ telemetry:
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
Expand All @@ -178,7 +178,7 @@ telemetry:
enabled: true
description: This metric is optional and therefore not initialized in NewTelemetryBuilder.
extended_documentation: For example this metric only exists if feature A is enabled.
unit: "1"
unit: "{items}"
optional: true
gauge:
async: true
Expand Down
6 changes: 3 additions & 3 deletions cmd/mdatagen/internal/samplereceiver/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestComponentTelemetry(t *testing.T) {
{
Name: "otelcol_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 Down Expand Up @@ -65,7 +65,7 @@ func TestComponentTelemetry(t *testing.T) {
{
Name: "otelcol_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 Down Expand Up @@ -93,7 +93,7 @@ func TestComponentTelemetry(t *testing.T) {
{
Name: "otelcol_queue_length",
Description: "This metric is optional and therefore not initialized in NewTelemetryBuilder.",
Unit: "1",
Unit: "{items}",
Data: metricdata.Gauge[int64]{
DataPoints: []metricdata.DataPoint[int64]{
{
Expand Down
4 changes: 2 additions & 2 deletions cmd/mdatagen/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func TestLoadMetadata(t *testing.T) {
"batch_size_trigger_send": {
Enabled: true,
Description: "Number of times the batch was sent due to a size trigger",
Unit: strPtr("1"),
Unit: strPtr("{times}"),
Sum: &sum{
MetricValueType: MetricValueType{pmetric.NumberDataPointValueTypeInt},
Mono: Mono{Monotonic: true},
Expand Down Expand Up @@ -267,7 +267,7 @@ func TestLoadMetadata(t *testing.T) {
Enabled: true,
Description: "This metric is optional and therefore not initialized in NewTelemetryBuilder.",
ExtendedDocumentation: "For example this metric only exists if feature A is enabled.",
Unit: strPtr("1"),
Unit: strPtr("{items}"),
Optional: true,
Gauge: &gauge{
MetricValueType: MetricValueType{
Expand Down
Loading