diff --git a/.chloggen/mdatagen-flatten-metric-stability.yaml b/.chloggen/mdatagen-flatten-metric-stability.yaml new file mode 100644 index 00000000000..9e002c41812 --- /dev/null +++ b/.chloggen/mdatagen-flatten-metric-stability.yaml @@ -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: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. receiver/otlp) +component: cmd/mdatagen + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Flatten the metric stability field + +# One or more tracking issues or pull requests related to the change +issues: [14113] + +# (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: So we better match the weaver schema. Additional deprecation data can be set within the `deprecated` field. + +# 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: [api] diff --git a/cmd/mdatagen/internal/loader_test.go b/cmd/mdatagen/internal/loader_test.go index 84c223a12cb..f83edfde6be 100644 --- a/cmd/mdatagen/internal/loader_test.go +++ b/cmd/mdatagen/internal/loader_test.go @@ -259,7 +259,7 @@ func TestLoadMetadata(t *testing.T) { Enabled: true, Description: "Monotonic cumulative sum int metric enabled by default.", ExtendedDocumentation: "The metric will be become optional soon.", - Stability: Stability{Level: component.StabilityLevelDeprecated}, + Stability: component.StabilityLevelDeprecated, Warnings: Warnings{ IfEnabledNotSet: "This metric will be disabled by default soon.", }, @@ -280,7 +280,7 @@ func TestLoadMetadata(t *testing.T) { Signal: Signal{ Enabled: true, Description: "Metric for testing spatial reaggregation", - Stability: Stability{Level: component.StabilityLevelBeta}, + Stability: component.StabilityLevelBeta, Attributes: []AttributeName{"string_attr", "boolean_attr"}, }, Unit: strPtr("1"), @@ -292,7 +292,7 @@ func TestLoadMetadata(t *testing.T) { Signal: Signal{ Enabled: true, Description: "Metric for testing spatial reaggregation with required attributes", - Stability: Stability{Level: component.StabilityLevelBeta}, + Stability: component.StabilityLevelBeta, Attributes: []AttributeName{"required_string_attr", "string_attr", "boolean_attr"}, }, Unit: strPtr("1"), @@ -303,7 +303,7 @@ func TestLoadMetadata(t *testing.T) { "system.cpu.time": { Signal: Signal{ Enabled: true, - Stability: Stability{Level: component.StabilityLevelBeta}, + Stability: component.StabilityLevelBeta, SemanticConvention: &SemanticConvention{SemanticConventionRef: "https://github.com/open-telemetry/semantic-conventions/blob/v1.38.0/docs/system/system-metrics.md#metric-systemcputime"}, Description: "Monotonic cumulative sum int metric enabled by default.", ExtendedDocumentation: "The metric will be become optional soon.", @@ -319,7 +319,7 @@ func TestLoadMetadata(t *testing.T) { Signal: Signal{ Enabled: false, Description: "[DEPRECATED] Gauge double metric disabled by default.", - Stability: Stability{Level: component.StabilityLevelDeprecated}, + Stability: component.StabilityLevelDeprecated, Warnings: Warnings{ IfConfigured: "This metric is deprecated and will be removed soon.", }, @@ -338,7 +338,7 @@ func TestLoadMetadata(t *testing.T) { Signal: Signal{ Enabled: false, Description: "[DEPRECATED] Gauge double metric disabled by default.", - Stability: Stability{Level: component.StabilityLevelDeprecated}, + Stability: component.StabilityLevelDeprecated, Warnings: Warnings{ IfConfigured: "This metric is deprecated and will be removed soon.", }, @@ -359,7 +359,7 @@ func TestLoadMetadata(t *testing.T) { Enabled: true, Description: "[DEPRECATED] Non-monotonic delta sum double metric enabled by default.", ExtendedDocumentation: "The metric will be removed soon.", - Stability: Stability{Level: component.StabilityLevelDeprecated}, + Stability: component.StabilityLevelDeprecated, Warnings: Warnings{ IfEnabled: "This metric is deprecated and will be removed soon.", }, @@ -379,7 +379,7 @@ func TestLoadMetadata(t *testing.T) { Signal: Signal{ Enabled: true, Description: "Monotonic cumulative sum int metric with string input_type enabled by default.", - Stability: Stability{Level: component.StabilityLevelDevelopment}, + Stability: component.StabilityLevelDevelopment, Attributes: []AttributeName{"string_attr", "overridden_int_attr", "enum_attr", "slice_attr", "map_attr"}, }, Unit: strPtr("s"), @@ -429,10 +429,8 @@ func TestLoadMetadata(t *testing.T) { Metrics: map[MetricName]Metric{ "batch_size_trigger_send": { Signal: Signal{ - Enabled: true, - Stability: Stability{ - Level: component.StabilityLevelDeprecated, - }, + Enabled: true, + Stability: component.StabilityLevelDeprecated, Description: "Number of times the batch was sent due to a size trigger", }, Deprecated: &Deprecated{ @@ -448,7 +446,7 @@ func TestLoadMetadata(t *testing.T) { "request_duration": { Signal: Signal{ Enabled: true, - Stability: Stability{Level: component.StabilityLevelAlpha}, + Stability: component.StabilityLevelAlpha, Description: "Duration of request", }, Unit: strPtr("s"), @@ -460,7 +458,7 @@ func TestLoadMetadata(t *testing.T) { "process_runtime_total_alloc_bytes": { Signal: Signal{ Enabled: true, - Stability: Stability{Level: component.StabilityLevelStable}, + Stability: component.StabilityLevelStable, Description: "Cumulative bytes allocated for heap objects (see 'go doc runtime.MemStats.TotalAlloc')", }, Unit: strPtr("By"), @@ -475,7 +473,7 @@ func TestLoadMetadata(t *testing.T) { "queue_length": { Signal: Signal{ Enabled: true, - Stability: Stability{Level: component.StabilityLevelAlpha}, + Stability: component.StabilityLevelAlpha, Description: "This metric is optional and therefore not initialized in NewTelemetryBuilder.", ExtendedDocumentation: "For example this metric only exists if feature A is enabled.", }, @@ -492,7 +490,7 @@ func TestLoadMetadata(t *testing.T) { Signal: Signal{ Enabled: true, Description: "Queue capacity - sync gauge example.", - Stability: Stability{Level: component.StabilityLevelDevelopment}, + Stability: component.StabilityLevelDevelopment, }, Unit: strPtr("{items}"), Gauge: &Gauge{ @@ -603,7 +601,7 @@ func TestLoadMetadata(t *testing.T) { { name: "testdata/invalid_metric_stability.yaml", want: Metadata{}, - wantErr: "decoding failed due to the following error(s):\n\n'metrics[default.metric]' decoding failed due to the following error(s):\n\n'stability' decoding failed due to the following error(s):\n\n'level' unsupported stability level: \"development42\"", + wantErr: "decoding failed due to the following error(s):\n\n'metrics[default.metric]' decoding failed due to the following error(s):\n\n'stability' unsupported stability level: \"development42\"", }, { name: "testdata/invalid_metric_semconvref.yaml", @@ -613,7 +611,12 @@ func TestLoadMetadata(t *testing.T) { { name: "testdata/no_metric_stability.yaml", want: Metadata{}, - wantErr: "decoding failed due to the following error(s):\n\n'metrics[default.metric]' decoding failed due to the following error(s):\n\n'stability' missing required field: `stability.level`", + wantErr: "metric \"default.metric\": missing required field: `stability.level`", + }, + { + name: "testdata/undeprecated_with_deprecation.yaml", + want: Metadata{}, + wantErr: "`stability` must be `deprecated` when specifying a `deprecated` field", }, { name: "testdata/~~this file doesn't exist~~.yaml", diff --git a/cmd/mdatagen/internal/metadata.go b/cmd/mdatagen/internal/metadata.go index 2fa2d3eb569..69f695ee3d0 100644 --- a/cmd/mdatagen/internal/metadata.go +++ b/cmd/mdatagen/internal/metadata.go @@ -623,7 +623,7 @@ type Signal struct { SemanticConvention *SemanticConvention `mapstructure:"semantic_convention"` // The stability level of the signal. - Stability Stability `mapstructure:"stability"` + Stability component.StabilityLevel `mapstructure:"stability"` // Extended documentation of the signal. If specified, this will be appended to the description used in generated documentation. ExtendedDocumentation string `mapstructure:"extended_documentation"` diff --git a/cmd/mdatagen/internal/metric.go b/cmd/mdatagen/internal/metric.go index 21f97301f19..059c02dd07a 100644 --- a/cmd/mdatagen/internal/metric.go +++ b/cmd/mdatagen/internal/metric.go @@ -53,54 +53,14 @@ type Metric struct { Deprecated *Deprecated `mapstructure:"deprecated,omitempty"` } -type Stability struct { - Level component.StabilityLevel `mapstructure:"level"` - // Deprecated: [0.144.0] Replaced with `deprecated.since`. - From string `mapstructure:"from"` -} - -func (s Stability) String() string { - if s.Level == component.StabilityLevelUndefined || - s.Level == component.StabilityLevelStable { - return "" - } - return fmt.Sprintf(" [%s]", s.Level.String()) -} - -// Unmarshal decodes the stability configuration. -// NOTE: confmap rejects unknown keys by default. -// The "from" field cannot be tested via full metadata loading -// unless WithIgnoreUnused() is used by the caller. -func (s *Stability) Unmarshal(parser *confmap.Conf) error { - if !parser.IsSet("level") { - return errors.New("missing required field: `stability.level`") - } - - var level component.StabilityLevel - if err := parser.Unmarshal(&struct { - Level *component.StabilityLevel `mapstructure:"level"` - }{ - Level: &level, - }); err != nil { - return err - } - - s.Level = level - if parser.IsSet("from") { - if err := parser.Unmarshal(&struct { - From *string `mapstructure:"from"` - }{From: &s.From}); err != nil { - return err - } - } - - return nil -} - func (m *Metric) validate(metricName MetricName, semConvVersion string) error { var errs error if m.Deprecated != nil { + if m.Stability != component.StabilityLevelDeprecated { + errs = errors.Join(errs, errors.New("`stability` must be `deprecated` when specifying a `deprecated` field")) + } + if err := m.Deprecated.validate(); err != nil { errs = errors.Join(errs, err) } @@ -114,6 +74,9 @@ func (m *Metric) validate(metricName MetricName, semConvVersion string) error { errs = errors.Join(errs, errors.New("more than one metric type keys, "+ "only one of the following has to be specified: sum, gauge, histogram")) } + if m.Stability == component.StabilityLevelUndefined { + errs = errors.Join(errs, errors.New("missing required field: `stability.level`")) + } if m.Description == "" { errs = errors.Join(errs, errors.New(`missing metric description`)) } diff --git a/cmd/mdatagen/internal/metric_test.go b/cmd/mdatagen/internal/metric_test.go index 33fa665033d..0b495744286 100644 --- a/cmd/mdatagen/internal/metric_test.go +++ b/cmd/mdatagen/internal/metric_test.go @@ -7,10 +7,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/confmap" "go.opentelemetry.io/collector/pdata/pmetric" ) @@ -41,66 +38,3 @@ func TestMetricData(t *testing.T) { assert.Equal(t, arg.wantAsync, arg.metricData.IsAsync()) } } - -func TestStability_String(t *testing.T) { - tests := []struct { - name string - stability Stability - want string - }{ - { - name: "undefined level", - stability: Stability{ - Level: component.StabilityLevelUndefined, - }, - want: "", - }, - { - name: "stable level", - stability: Stability{ - Level: component.StabilityLevelStable, - }, - want: "", - }, - { - name: "beta level", - stability: Stability{ - Level: component.StabilityLevelBeta, - }, - want: " [Beta]", - }, - { - name: "alpha level", - stability: Stability{ - Level: component.StabilityLevelAlpha, - }, - want: " [Alpha]", - }, - { - name: "deprecated level", - stability: Stability{ - Level: component.StabilityLevelDeprecated, - }, - want: " [Deprecated]", - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - got := tt.stability.String() - assert.Equal(t, tt.want, got) - }) - } -} - -func TestStability_Unmarshal_WithoutFrom(t *testing.T) { - parser := confmap.NewFromStringMap(map[string]any{ - "level": "beta", - }) - - var s Stability - err := s.Unmarshal(parser) - require.NoError(t, err) - assert.Equal(t, component.StabilityLevelBeta, s.Level) - assert.Empty(t, s.From) -} diff --git a/cmd/mdatagen/internal/sampleconnector/documentation.md b/cmd/mdatagen/internal/sampleconnector/documentation.md index abf382ae6e8..3708e08948e 100644 --- a/cmd/mdatagen/internal/sampleconnector/documentation.md +++ b/cmd/mdatagen/internal/sampleconnector/documentation.md @@ -64,7 +64,7 @@ Monotonic cumulative sum int metric with string input_type enabled by default. ### reaggregate.metric -Metric for testing spacial reaggregation +Metric for testing spatial reaggregation | Unit | Metric Type | Value Type | Stability | | ---- | ----------- | ---------- | --------- | diff --git a/cmd/mdatagen/internal/sampleconnector/internal/metadata/generated_metrics.go b/cmd/mdatagen/internal/sampleconnector/internal/metadata/generated_metrics.go index 797f693a314..bf7a23fdf73 100644 --- a/cmd/mdatagen/internal/sampleconnector/internal/metadata/generated_metrics.go +++ b/cmd/mdatagen/internal/sampleconnector/internal/metadata/generated_metrics.go @@ -573,7 +573,7 @@ type metricReaggregateMetric struct { // init fills reaggregate.metric metric with initial data. func (m *metricReaggregateMetric) init() { m.data.SetName("reaggregate.metric") - m.data.SetDescription("Metric for testing spacial reaggregation") + m.data.SetDescription("Metric for testing spatial reaggregation") m.data.SetUnit("1") m.data.SetEmptyGauge() m.data.Gauge().DataPoints().EnsureCapacity(m.capacity) diff --git a/cmd/mdatagen/internal/sampleconnector/internal/metadata/generated_metrics_test.go b/cmd/mdatagen/internal/sampleconnector/internal/metadata/generated_metrics_test.go index 9c1895ccfae..f20f2db07de 100644 --- a/cmd/mdatagen/internal/sampleconnector/internal/metadata/generated_metrics_test.go +++ b/cmd/mdatagen/internal/sampleconnector/internal/metadata/generated_metrics_test.go @@ -450,7 +450,7 @@ func TestMetricsBuilder(t *testing.T) { validatedMetrics["reaggregate.metric"] = true assert.Equal(t, pmetric.MetricTypeGauge, ms.At(i).Type()) assert.Equal(t, 1, ms.At(i).Gauge().DataPoints().Len()) - assert.Equal(t, "Metric for testing spacial reaggregation", ms.At(i).Description()) + assert.Equal(t, "Metric for testing spatial reaggregation", ms.At(i).Description()) assert.Equal(t, "1", ms.At(i).Unit()) dp := ms.At(i).Gauge().DataPoints().At(0) assert.Equal(t, start, dp.StartTimestamp()) @@ -468,7 +468,7 @@ func TestMetricsBuilder(t *testing.T) { validatedMetrics["reaggregate.metric"] = true assert.Equal(t, pmetric.MetricTypeGauge, ms.At(i).Type()) assert.Equal(t, 1, ms.At(i).Gauge().DataPoints().Len()) - assert.Equal(t, "Metric for testing spacial reaggregation", ms.At(i).Description()) + assert.Equal(t, "Metric for testing spatial reaggregation", ms.At(i).Description()) assert.Equal(t, "1", ms.At(i).Unit()) dp := ms.At(i).Gauge().DataPoints().At(0) assert.Equal(t, start, dp.StartTimestamp()) diff --git a/cmd/mdatagen/internal/sampleconnector/metadata.yaml b/cmd/mdatagen/internal/sampleconnector/metadata.yaml index 70ef1a72228..fcce3fee4a7 100644 --- a/cmd/mdatagen/internal/sampleconnector/metadata.yaml +++ b/cmd/mdatagen/internal/sampleconnector/metadata.yaml @@ -115,8 +115,7 @@ metrics: enabled: true description: Monotonic cumulative sum int metric enabled by default. extended_documentation: The metric will be become optional soon. - stability: - level: development + stability: development unit: s sum: value_type: int @@ -131,8 +130,7 @@ metrics: enabled: true description: "[DEPRECATED] Non-monotonic delta sum double metric enabled by default." extended_documentation: The metric will be removed soon. - stability: - level: deprecated + stability: deprecated deprecated: since: "1.0.0" note: "This metric will be removed" @@ -147,8 +145,7 @@ metrics: metric.input_type: enabled: true description: Monotonic cumulative sum int metric with string input_type enabled by default. - stability: - level: development + stability: development unit: s sum: value_type: int @@ -161,8 +158,7 @@ metrics: optional.metric: enabled: false description: "[DEPRECATED] Gauge double metric disabled by default." - stability: - level: deprecated + stability: deprecated deprecated: since: "1.0.0" note: "This metric will be removed" @@ -176,8 +172,7 @@ metrics: optional.metric.empty_unit: enabled: false description: "[DEPRECATED] Gauge double metric disabled by default." - stability: - level: deprecated + stability: deprecated deprecated: since: "1.0.0" note: "This metric will be removed" @@ -190,10 +185,9 @@ metrics: reaggregate.metric: enabled: true - description: Metric for testing spacial reaggregation + description: Metric for testing spatial reaggregation unit: "1" - stability: - level: beta + stability: beta gauge: - value_type: double + value_type: double attributes: [string_attr, boolean_attr] diff --git a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry.go index 2432c77f3d2..2e2cf145de2 100644 --- a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry.go +++ b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry.go @@ -112,7 +112,7 @@ func NewTelemetryBuilder(settings component.TelemetrySettings, options ...Teleme errs = errors.Join(errs, err) builder.ProcessRuntimeTotalAllocBytes, 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.WithDescription("Cumulative bytes allocated for heap objects (see 'go doc runtime.MemStats.TotalAlloc') [Stable]"), metric.WithUnit("By"), ) errs = errors.Join(errs, err) diff --git a/cmd/mdatagen/internal/samplereceiver/internal/metadatatest/generated_telemetrytest.go b/cmd/mdatagen/internal/samplereceiver/internal/metadatatest/generated_telemetrytest.go index ec38b4739cd..81261758c79 100644 --- a/cmd/mdatagen/internal/samplereceiver/internal/metadatatest/generated_telemetrytest.go +++ b/cmd/mdatagen/internal/samplereceiver/internal/metadatatest/generated_telemetrytest.go @@ -41,7 +41,7 @@ func AssertEqualBatchSizeTriggerSend(t *testing.T, tt *componenttest.Telemetry, func AssertEqualProcessRuntimeTotalAllocBytes(t *testing.T, tt *componenttest.Telemetry, dps []metricdata.DataPoint[int64], opts ...metricdatatest.Option) { want := metricdata.Metrics{ Name: "otelcol_process_runtime_total_alloc_bytes", - Description: "Cumulative bytes allocated for heap objects (see 'go doc runtime.MemStats.TotalAlloc')", + Description: "Cumulative bytes allocated for heap objects (see 'go doc runtime.MemStats.TotalAlloc') [Stable]", Unit: "By", Data: metricdata.Sum[int64]{ Temporality: metricdata.CumulativeTemporality, diff --git a/cmd/mdatagen/internal/samplereceiver/metadata.yaml b/cmd/mdatagen/internal/samplereceiver/metadata.yaml index a2be9e8d02a..2c057696b40 100644 --- a/cmd/mdatagen/internal/samplereceiver/metadata.yaml +++ b/cmd/mdatagen/internal/samplereceiver/metadata.yaml @@ -176,8 +176,7 @@ metrics: enabled: true description: Monotonic cumulative sum int metric enabled by default. extended_documentation: The metric will be become optional soon. - stability: - level: deprecated + stability: deprecated deprecated: since: "1.0.0" note: "This metric will be removed" @@ -204,8 +203,7 @@ metrics: enabled: true description: "[DEPRECATED] Non-monotonic delta sum double metric enabled by default." extended_documentation: The metric will be removed soon. - stability: - level: deprecated + stability: deprecated deprecated: since: "1.0.0" note: "This metric will be removed" @@ -220,8 +218,7 @@ metrics: metric.input_type: enabled: true description: Monotonic cumulative sum int metric with string input_type enabled by default. - stability: - level: development + stability: development unit: s sum: value_type: int @@ -234,8 +231,7 @@ metrics: optional.metric: enabled: false description: "[DEPRECATED] Gauge double metric disabled by default." - stability: - level: deprecated + stability: deprecated deprecated: since: "1.0.0" note: "This metric will be removed" @@ -249,8 +245,7 @@ metrics: optional.metric.empty_unit: enabled: false description: "[DEPRECATED] Gauge double metric disabled by default." - stability: - level: deprecated + stability: deprecated deprecated: since: "1.0.0" note: "This metric will be removed" @@ -265,26 +260,23 @@ metrics: enabled: true description: Metric for testing spatial reaggregation unit: "1" - stability: - level: beta + stability: beta gauge: - value_type: double + value_type: double attributes: [string_attr, boolean_attr] reaggregate.metric.with_required: enabled: true description: Metric for testing spatial reaggregation with required attributes unit: "1" - stability: - level: beta + stability: beta gauge: - value_type: double + value_type: double attributes: [required_string_attr, string_attr, boolean_attr] system.cpu.time: enabled: true - stability: - level: beta + stability: beta description: Monotonic cumulative sum int metric enabled by default. extended_documentation: The metric will be become optional soon. unit: s @@ -299,8 +291,7 @@ telemetry: metrics: batch_size_trigger_send: enabled: true - stability: - level: deprecated + stability: deprecated deprecated: since: "1.5.0" note: "This metric will be removed in favor of batch_send_trigger_size" @@ -311,8 +302,7 @@ telemetry: monotonic: true process_runtime_total_alloc_bytes: enabled: true - stability: - level: stable + stability: stable description: Cumulative bytes allocated for heap objects (see 'go doc runtime.MemStats.TotalAlloc') unit: By sum: @@ -322,15 +312,13 @@ telemetry: queue_capacity: enabled: true description: Queue capacity - sync gauge example. - stability: - level: development + stability: development unit: "{items}" gauge: value_type: int queue_length: enabled: true - stability: - level: alpha + stability: alpha 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: "{items}" @@ -340,8 +328,7 @@ telemetry: value_type: int request_duration: enabled: true - stability: - level: alpha + stability: alpha description: Duration of request unit: s histogram: diff --git a/cmd/mdatagen/internal/samplescraper/documentation.md b/cmd/mdatagen/internal/samplescraper/documentation.md index aa6899fcfca..dc0ab8c93aa 100644 --- a/cmd/mdatagen/internal/samplescraper/documentation.md +++ b/cmd/mdatagen/internal/samplescraper/documentation.md @@ -64,7 +64,7 @@ Monotonic cumulative sum int metric with string input_type enabled by default. ### reaggregate.metric -Metric for testing spacial reaggregation +Metric for testing spatial reaggregation | Unit | Metric Type | Value Type | Stability | | ---- | ----------- | ---------- | --------- | diff --git a/cmd/mdatagen/internal/samplescraper/internal/metadata/generated_metrics.go b/cmd/mdatagen/internal/samplescraper/internal/metadata/generated_metrics.go index c1dd3c192ee..8220e134a74 100644 --- a/cmd/mdatagen/internal/samplescraper/internal/metadata/generated_metrics.go +++ b/cmd/mdatagen/internal/samplescraper/internal/metadata/generated_metrics.go @@ -577,7 +577,7 @@ type metricReaggregateMetric struct { // init fills reaggregate.metric metric with initial data. func (m *metricReaggregateMetric) init() { m.data.SetName("reaggregate.metric") - m.data.SetDescription("Metric for testing spacial reaggregation") + m.data.SetDescription("Metric for testing spatial reaggregation") m.data.SetUnit("1") m.data.SetEmptyGauge() m.data.Gauge().DataPoints().EnsureCapacity(m.capacity) diff --git a/cmd/mdatagen/internal/samplescraper/internal/metadata/generated_metrics_test.go b/cmd/mdatagen/internal/samplescraper/internal/metadata/generated_metrics_test.go index f198712cda4..201b38cf18d 100644 --- a/cmd/mdatagen/internal/samplescraper/internal/metadata/generated_metrics_test.go +++ b/cmd/mdatagen/internal/samplescraper/internal/metadata/generated_metrics_test.go @@ -458,7 +458,7 @@ func TestMetricsBuilder(t *testing.T) { validatedMetrics["reaggregate.metric"] = true assert.Equal(t, pmetric.MetricTypeGauge, ms.At(i).Type()) assert.Equal(t, 1, ms.At(i).Gauge().DataPoints().Len()) - assert.Equal(t, "Metric for testing spacial reaggregation", ms.At(i).Description()) + assert.Equal(t, "Metric for testing spatial reaggregation", ms.At(i).Description()) assert.Equal(t, "1", ms.At(i).Unit()) dp := ms.At(i).Gauge().DataPoints().At(0) assert.Equal(t, start, dp.StartTimestamp()) @@ -476,7 +476,7 @@ func TestMetricsBuilder(t *testing.T) { validatedMetrics["reaggregate.metric"] = true assert.Equal(t, pmetric.MetricTypeGauge, ms.At(i).Type()) assert.Equal(t, 1, ms.At(i).Gauge().DataPoints().Len()) - assert.Equal(t, "Metric for testing spacial reaggregation", ms.At(i).Description()) + assert.Equal(t, "Metric for testing spatial reaggregation", ms.At(i).Description()) assert.Equal(t, "1", ms.At(i).Unit()) dp := ms.At(i).Gauge().DataPoints().At(0) assert.Equal(t, start, dp.StartTimestamp()) diff --git a/cmd/mdatagen/internal/samplescraper/metadata.yaml b/cmd/mdatagen/internal/samplescraper/metadata.yaml index 411ecaafd29..a38381800ce 100644 --- a/cmd/mdatagen/internal/samplescraper/metadata.yaml +++ b/cmd/mdatagen/internal/samplescraper/metadata.yaml @@ -107,8 +107,7 @@ metrics: enabled: true description: Monotonic cumulative sum int metric enabled by default. extended_documentation: The metric will be become optional soon. - stability: - level: development + stability: development unit: s sum: value_type: int @@ -123,8 +122,7 @@ metrics: enabled: true description: "[DEPRECATED] Non-monotonic delta sum double metric enabled by default." extended_documentation: The metric will be removed soon. - stability: - level: deprecated + stability: deprecated deprecated: since: "1.0.0" note: "This metric will be removed" @@ -138,8 +136,7 @@ metrics: metric.input_type: enabled: true - stability: - level: development + stability: development description: Monotonic cumulative sum int metric with string input_type enabled by default. unit: s sum: @@ -153,8 +150,7 @@ metrics: optional.metric: enabled: false description: "[DEPRECATED] Gauge double metric disabled by default." - stability: - level: deprecated + stability: deprecated deprecated: since: "1.0.0" note: "This metric will be removed" @@ -168,8 +164,7 @@ metrics: optional.metric.empty_unit: enabled: false description: "[DEPRECATED] Gauge double metric disabled by default." - stability: - level: deprecated + stability: deprecated deprecated: since: "1.0.0" note: "This metric will be removed" @@ -182,18 +177,16 @@ metrics: reaggregate.metric: enabled: true - description: Metric for testing spacial reaggregation + description: Metric for testing spatial reaggregation unit: "1" - stability: - level: beta + stability: beta gauge: - value_type: double + value_type: double attributes: [string_attr, boolean_attr] system.cpu.time: enabled: true - stability: - level: beta + stability: beta description: Monotonic cumulative sum int metric enabled by default. extended_documentation: The metric will be become optional soon. unit: s diff --git a/cmd/mdatagen/internal/templates/documentation.md.tmpl b/cmd/mdatagen/internal/templates/documentation.md.tmpl index fea3879055b..73cadff8c20 100644 --- a/cmd/mdatagen/internal/templates/documentation.md.tmpl +++ b/cmd/mdatagen/internal/templates/documentation.md.tmpl @@ -12,12 +12,12 @@ {{- end }} -| Unit | Metric Type | Value Type |{{ if $metric.Data.HasAggregated }} Aggregation Temporality |{{ end }}{{ if $metric.Data.HasMonotonic }} Monotonic |{{ end }}{{ if $metric.Stability.Level }} Stability |{{ end }}{{ if $metric.SemanticConvention }} Semantic Convention |{{ end }} -| ---- | ----------- | ---------- |{{ if $metric.Data.HasAggregated }} ----------------------- |{{ end }}{{ if $metric.Data.HasMonotonic }} --------- |{{ end }}{{ if $metric.Stability.Level }} --------- |{{ end }}{{ if $metric.SemanticConvention }} ------------------- |{{ end }} +| Unit | Metric Type | Value Type |{{ if $metric.Data.HasAggregated }} Aggregation Temporality |{{ end }}{{ if $metric.Data.HasMonotonic }} Monotonic |{{ end }}{{ if $metric.Stability }} Stability |{{ end }}{{ if $metric.SemanticConvention }} Semantic Convention |{{ end }} +| ---- | ----------- | ---------- |{{ if $metric.Data.HasAggregated }} ----------------------- |{{ end }}{{ if $metric.Data.HasMonotonic }} --------- |{{ end }}{{ if $metric.Stability }} --------- |{{ end }}{{ if $metric.SemanticConvention }} ------------------- |{{ end }} | {{ $metric.Unit }} | {{ $metric.Data.Type }} | {{ $metric.Data.MetricValueType }} | {{- if $metric.Data.HasAggregated }} {{ $metric.Data.AggregationTemporality }} |{{ end }} {{- if $metric.Data.HasMonotonic }} {{ $metric.Data.Monotonic }} |{{ end }} -{{- if $metric.Stability.Level }} {{ $metric.Stability.Level }}{{ if $metric.Deprecated }} since {{ $metric.Deprecated.Since }}{{ end }} |{{ end }} +{{- if $metric.Stability }} {{ $metric.Stability }}{{ if $metric.Deprecated }} since {{ $metric.Deprecated.Since }}{{ end }} |{{ end }} {{- if $metric.SemanticConvention }} [{{ $metricName }}]({{ $metric.SemanticConvention.SemanticConventionRef }}) |{{ end }} {{- if $metric.Deprecated }}{{ if $metric.Deprecated.Note }} @@ -91,11 +91,11 @@ {{- end }} -| Unit | Metric Type | Value Type |{{ if $metric.Data.HasMonotonic }} Monotonic |{{ end }}{{ if $metric.Stability.Level }} Stability |{{ end }}{{ if $metric.SemanticConvention }} Semantic Convention |{{ end }} -| ---- | ----------- | ---------- |{{ if $metric.Data.HasMonotonic }} --------- |{{ end }}{{ if $metric.Stability.Level }} --------- |{{ end }}{{ if $metric.SemanticConvention }} ------------------- |{{ end }} +| Unit | Metric Type | Value Type |{{ if $metric.Data.HasMonotonic }} Monotonic |{{ end }}{{ if $metric.Stability }} Stability |{{ end }}{{ if $metric.SemanticConvention }} Semantic Convention |{{ end }} +| ---- | ----------- | ---------- |{{ if $metric.Data.HasMonotonic }} --------- |{{ end }}{{ if $metric.Stability }} --------- |{{ end }}{{ if $metric.SemanticConvention }} ------------------- |{{ end }} | {{ $metric.Unit }} | {{ $metric.Data.Type }} | {{ $metric.Data.MetricValueType }} | {{- if $metric.Data.HasMonotonic }} {{ $metric.Data.Monotonic }} |{{ end }} -{{- if $metric.Stability.Level }} {{ $metric.Stability.Level }}{{ if $metric.Deprecated }} since {{ $metric.Deprecated.Since }}{{ end }} |{{ end }} +{{- if $metric.Stability }} {{ $metric.Stability }}{{ if $metric.Deprecated }} since {{ $metric.Deprecated.Since }}{{ end }} |{{ end }} {{- if $metric.SemanticConvention }} [{{ $metricName }}]({{ $metric.SemanticConvention.SemanticConventionRef }}) |{{ end }} {{- if $metric.Deprecated }}{{ if $metric.Deprecated.Note }} diff --git a/cmd/mdatagen/internal/templates/telemetry.go.tmpl b/cmd/mdatagen/internal/templates/telemetry.go.tmpl index da4dc276973..0596c6d9c48 100644 --- a/cmd/mdatagen/internal/templates/telemetry.go.tmpl +++ b/cmd/mdatagen/internal/templates/telemetry.go.tmpl @@ -141,7 +141,7 @@ func NewTelemetryBuilder(settings component.TelemetrySettings, options ...Teleme {{ else -}} "otelcol_{{ $name }}", {{ end -}} - metric.WithDescription("{{ $metric.Description }}{{ $metric.Stability }}"), + metric.WithDescription("{{ $metric.Description }} [{{ $metric.Stability }}]"), metric.WithUnit("{{ $metric.Unit }}"), {{ if eq $metric.Data.Type "Histogram" -}} {{- if $metric.Data.Boundaries -}}metric.WithExplicitBucketBoundaries([]float64{ {{- range $metric.Data.Boundaries }} {{.}}, {{- end }} }...),{{- end }} diff --git a/cmd/mdatagen/internal/templates/telemetrytest.go.tmpl b/cmd/mdatagen/internal/templates/telemetrytest.go.tmpl index 62a371545b2..5b6a402a641 100644 --- a/cmd/mdatagen/internal/templates/telemetrytest.go.tmpl +++ b/cmd/mdatagen/internal/templates/telemetrytest.go.tmpl @@ -37,7 +37,7 @@ func AssertEqual{{ $name.Render }}(t *testing.T, tt *componenttest.Telemetry, dp {{ else -}} Name: "otelcol_{{ $name }}", {{ end -}} - Description: "{{ $metric.Description }}{{ $metric.Stability }}", + Description: "{{ $metric.Description }} [{{ $metric.Stability }}]", Unit: "{{ $metric.Unit }}", Data: metricdata.{{ $metric.Data.Type }}[{{ $metric.Data.BasicType }}]{ {{- if $metric.Data.HasAggregated }} diff --git a/cmd/mdatagen/internal/testdata/async_metric.yaml b/cmd/mdatagen/internal/testdata/async_metric.yaml index 0ab62684090..48bba1e958c 100644 --- a/cmd/mdatagen/internal/testdata/async_metric.yaml +++ b/cmd/mdatagen/internal/testdata/async_metric.yaml @@ -13,8 +13,7 @@ metrics: metric: enabled: true description: Description. - stability: - level: development + stability: development unit: s gauge: value_type: double diff --git a/cmd/mdatagen/internal/testdata/invalid_aggregation.yaml b/cmd/mdatagen/internal/testdata/invalid_aggregation.yaml index c86c2d62662..7c798965c6d 100644 --- a/cmd/mdatagen/internal/testdata/invalid_aggregation.yaml +++ b/cmd/mdatagen/internal/testdata/invalid_aggregation.yaml @@ -15,8 +15,7 @@ metrics: enabled: true description: Monotonic cumulative sum int metric enabled by default. extended_documentation: The metric will be become optional soon. - stability: - level: development + stability: development unit: s sum: value_type: int diff --git a/cmd/mdatagen/internal/testdata/invalid_input_type.yaml b/cmd/mdatagen/internal/testdata/invalid_input_type.yaml index 5651abe9b4f..3ecbe5cfa64 100644 --- a/cmd/mdatagen/internal/testdata/invalid_input_type.yaml +++ b/cmd/mdatagen/internal/testdata/invalid_input_type.yaml @@ -11,8 +11,7 @@ metrics: system.cpu.time: enabled: true description: Total CPU seconds broken down by different states. - stability: - level: development + stability: development unit: s sum: value_type: double diff --git a/cmd/mdatagen/internal/testdata/invalid_metric_semconvref.yaml b/cmd/mdatagen/internal/testdata/invalid_metric_semconvref.yaml index cccf15e5524..0f431e8deae 100644 --- a/cmd/mdatagen/internal/testdata/invalid_metric_semconvref.yaml +++ b/cmd/mdatagen/internal/testdata/invalid_metric_semconvref.yaml @@ -17,8 +17,7 @@ metrics: enabled: true description: Monotonic cumulative sum int metric enabled by default. extended_documentation: The metric will be become optional soon. - stability: - level: development + stability: development semantic_convention: ref: https://github.com/open-telemetry/semantic-conventions/blob/v1.38.0/docs/system/system-metrics.md#metric-systemcputime unit: s diff --git a/cmd/mdatagen/internal/testdata/invalid_metric_stability.yaml b/cmd/mdatagen/internal/testdata/invalid_metric_stability.yaml index 0906a5720b4..44d900a7820 100644 --- a/cmd/mdatagen/internal/testdata/invalid_metric_stability.yaml +++ b/cmd/mdatagen/internal/testdata/invalid_metric_stability.yaml @@ -15,8 +15,7 @@ metrics: enabled: true description: Monotonic cumulative sum int metric enabled by default. extended_documentation: The metric will be become optional soon. - stability: - level: development42 + stability: development42 unit: s sum: value_type: int diff --git a/cmd/mdatagen/internal/testdata/metrics_and_type.yaml b/cmd/mdatagen/internal/testdata/metrics_and_type.yaml index e2591e04f6e..537a56335ee 100644 --- a/cmd/mdatagen/internal/testdata/metrics_and_type.yaml +++ b/cmd/mdatagen/internal/testdata/metrics_and_type.yaml @@ -13,8 +13,7 @@ metrics: metric: enabled: true description: Description. - stability: - level: development + stability: development unit: s gauge: value_type: double diff --git a/cmd/mdatagen/internal/testdata/no_aggregation.yaml b/cmd/mdatagen/internal/testdata/no_aggregation.yaml index f9425fa6df7..fb19f85ed16 100644 --- a/cmd/mdatagen/internal/testdata/no_aggregation.yaml +++ b/cmd/mdatagen/internal/testdata/no_aggregation.yaml @@ -16,9 +16,8 @@ metrics: enabled: true description: Monotonic cumulative sum int metric enabled by default. extended_documentation: The metric will be become optional soon. - stability: - level: development + stability: development unit: s sum: value_type: int - monotonic: false \ No newline at end of file + monotonic: false diff --git a/cmd/mdatagen/internal/testdata/no_description_attr.yaml b/cmd/mdatagen/internal/testdata/no_description_attr.yaml index 6d4744ca86e..63d60cc3c49 100644 --- a/cmd/mdatagen/internal/testdata/no_description_attr.yaml +++ b/cmd/mdatagen/internal/testdata/no_description_attr.yaml @@ -23,8 +23,7 @@ metrics: enabled: true description: Monotonic cumulative sum int metric enabled by default. extended_documentation: The metric will be become optional soon. - stability: - level: development + stability: development unit: s sum: value_type: int diff --git a/cmd/mdatagen/internal/testdata/no_enabled.yaml b/cmd/mdatagen/internal/testdata/no_enabled.yaml index c993152f3f9..2b4a278091d 100644 --- a/cmd/mdatagen/internal/testdata/no_enabled.yaml +++ b/cmd/mdatagen/internal/testdata/no_enabled.yaml @@ -6,12 +6,11 @@ status: development: [logs] beta: [traces] stable: [metrics] - + metrics: system.cpu.time: description: Total CPU seconds broken down by different states. - stability: - level: development + stability: development unit: s sum: value_type: double diff --git a/cmd/mdatagen/internal/testdata/no_metric_description.yaml b/cmd/mdatagen/internal/testdata/no_metric_description.yaml index 0ef5dc10d9f..aa14a70c28f 100644 --- a/cmd/mdatagen/internal/testdata/no_metric_description.yaml +++ b/cmd/mdatagen/internal/testdata/no_metric_description.yaml @@ -15,8 +15,7 @@ metrics: default.metric: enabled: true extended_documentation: The metric will be become optional soon. - stability: - level: development + stability: development unit: s sum: value_type: int diff --git a/cmd/mdatagen/internal/testdata/no_metric_type.yaml b/cmd/mdatagen/internal/testdata/no_metric_type.yaml index 792e88ecefc..bb6b0c26fdd 100644 --- a/cmd/mdatagen/internal/testdata/no_metric_type.yaml +++ b/cmd/mdatagen/internal/testdata/no_metric_type.yaml @@ -9,7 +9,6 @@ metrics: system.cpu.time: enabled: true description: Total CPU seconds broken down by different states. - stability: - level: development + stability: development unit: s attributes: diff --git a/cmd/mdatagen/internal/testdata/no_metric_unit.yaml b/cmd/mdatagen/internal/testdata/no_metric_unit.yaml index 9f55e10cf13..394d3e677b6 100644 --- a/cmd/mdatagen/internal/testdata/no_metric_unit.yaml +++ b/cmd/mdatagen/internal/testdata/no_metric_unit.yaml @@ -16,8 +16,7 @@ metrics: enabled: true description: Monotonic cumulative sum int metric enabled by default. extended_documentation: The metric will be become optional soon. - stability: - level: development + stability: development sum: value_type: int monotonic: true diff --git a/cmd/mdatagen/internal/testdata/no_monotonic.yaml b/cmd/mdatagen/internal/testdata/no_monotonic.yaml index 9d2cf74de9a..cda807c497b 100644 --- a/cmd/mdatagen/internal/testdata/no_monotonic.yaml +++ b/cmd/mdatagen/internal/testdata/no_monotonic.yaml @@ -16,8 +16,7 @@ metrics: enabled: true description: Monotonic cumulative sum int metric enabled by default. extended_documentation: The metric will be become optional soon. - stability: - level: development + stability: development unit: s sum: value_type: int diff --git a/cmd/mdatagen/internal/testdata/no_type_attr.yaml b/cmd/mdatagen/internal/testdata/no_type_attr.yaml index 0cc5f8e56f5..9bf9f672ce4 100644 --- a/cmd/mdatagen/internal/testdata/no_type_attr.yaml +++ b/cmd/mdatagen/internal/testdata/no_type_attr.yaml @@ -17,8 +17,7 @@ metrics: metric: enabled: true description: Metric. - stability: - level: development + stability: development unit: "1" gauge: value_type: double diff --git a/cmd/mdatagen/internal/testdata/no_value_type.yaml b/cmd/mdatagen/internal/testdata/no_value_type.yaml index cdc2412d47d..eaab6d45086 100644 --- a/cmd/mdatagen/internal/testdata/no_value_type.yaml +++ b/cmd/mdatagen/internal/testdata/no_value_type.yaml @@ -15,8 +15,7 @@ metrics: system.cpu.time: enabled: true description: Total CPU seconds broken down by different states. - stability: - level: development + stability: development unit: s sum: monotonic: true diff --git a/cmd/mdatagen/internal/testdata/two_metric_types.yaml b/cmd/mdatagen/internal/testdata/two_metric_types.yaml index b6b48fd2aae..2476aff426e 100644 --- a/cmd/mdatagen/internal/testdata/two_metric_types.yaml +++ b/cmd/mdatagen/internal/testdata/two_metric_types.yaml @@ -11,8 +11,7 @@ metrics: system.cpu.time: enabled: true description: Total CPU seconds broken down by different states. - stability: - level: development + stability: development unit: s gauge: value_type: double diff --git a/cmd/mdatagen/internal/testdata/undeprecated_with_deprecation.yaml b/cmd/mdatagen/internal/testdata/undeprecated_with_deprecation.yaml new file mode 100644 index 00000000000..6d563178a06 --- /dev/null +++ b/cmd/mdatagen/internal/testdata/undeprecated_with_deprecation.yaml @@ -0,0 +1,25 @@ +type: metricreceiver + +status: + class: receiver + stability: + development: [logs] + beta: [traces] + stable: [metrics] + distributions: [contrib] + warnings: + - Any additional information that should be brought to the consumer's attention + +metrics: + default.metric: + enabled: true + description: Monotonic cumulative sum int metric enabled by default. + extended_documentation: The metric will be become optional soon. + stability: development + deprecated: + note: this should not happen + unit: s + sum: + value_type: int + monotonic: true + aggregation_temporality: cumulative diff --git a/cmd/mdatagen/internal/testdata/unknown_metric_attribute.yaml b/cmd/mdatagen/internal/testdata/unknown_metric_attribute.yaml index 6e4bad5e281..8f27faab13b 100644 --- a/cmd/mdatagen/internal/testdata/unknown_metric_attribute.yaml +++ b/cmd/mdatagen/internal/testdata/unknown_metric_attribute.yaml @@ -6,13 +6,12 @@ status: development: [logs] beta: [traces] stable: [metrics] - + metrics: system.cpu.time: enabled: true description: Total CPU seconds broken down by different states. - stability: - level: development + stability: development unit: s sum: value_type: double diff --git a/cmd/mdatagen/internal/testdata/unknown_value_type.yaml b/cmd/mdatagen/internal/testdata/unknown_value_type.yaml index 1231e7282ac..eab669a95b0 100644 --- a/cmd/mdatagen/internal/testdata/unknown_value_type.yaml +++ b/cmd/mdatagen/internal/testdata/unknown_value_type.yaml @@ -11,8 +11,7 @@ metrics: system.cpu.time: enabled: true description: Total CPU seconds broken down by different states. - stability: - level: development + stability: development unit: s sum: value_type: unknown diff --git a/cmd/mdatagen/internal/testdata/unused_attribute.yaml b/cmd/mdatagen/internal/testdata/unused_attribute.yaml index 4d07147fa10..a7daa3dd2c3 100644 --- a/cmd/mdatagen/internal/testdata/unused_attribute.yaml +++ b/cmd/mdatagen/internal/testdata/unused_attribute.yaml @@ -26,8 +26,7 @@ metrics: metric: enabled: true description: Metric. - stability: - level: development + stability: development unit: "1" gauge: value_type: double @@ -38,9 +37,8 @@ telemetry: metric: enabled: true description: Metric. - stability: - level: development + stability: development unit: "1" gauge: value_type: double - attributes: [used_attr_in_telemetry_section] \ No newline at end of file + attributes: [used_attr_in_telemetry_section] diff --git a/cmd/mdatagen/internal/testdata/with_conditional_attribute.yaml b/cmd/mdatagen/internal/testdata/with_conditional_attribute.yaml index d3f4af8e07d..0246020710d 100644 --- a/cmd/mdatagen/internal/testdata/with_conditional_attribute.yaml +++ b/cmd/mdatagen/internal/testdata/with_conditional_attribute.yaml @@ -12,7 +12,7 @@ attributes: description: Conditional int attr. type: string requirement_level: conditionally_required - + opt_in_string_attr: description: Opt-in string attr. type: string @@ -22,8 +22,7 @@ metrics: metric: enabled: true description: Metric. - stability: - level: development + stability: development unit: "1" gauge: value_type: double diff --git a/cmd/mdatagen/internal/testdata/with_telemetry.yaml b/cmd/mdatagen/internal/testdata/with_telemetry.yaml index 6d203ac9875..212511683d9 100644 --- a/cmd/mdatagen/internal/testdata/with_telemetry.yaml +++ b/cmd/mdatagen/internal/testdata/with_telemetry.yaml @@ -14,8 +14,7 @@ telemetry: description: Latency (in microseconds) of a given sampling policy unit: µs enabled: true - stability: - level: alpha + stability: alpha histogram: value_type: int attributes: [name] diff --git a/cmd/mdatagen/metadata-schema.yaml b/cmd/mdatagen/metadata-schema.yaml index f6d9142a46a..a06f9c2088c 100644 --- a/cmd/mdatagen/metadata-schema.yaml +++ b/cmd/mdatagen/metadata-schema.yaml @@ -146,11 +146,7 @@ metrics: # Optional: array of attributes that were defined in the attributes section that are emitted by this metric. attributes: [string] # Required: the metric stability - stability: - # Required: the level of stability - level: - # Optional: the version current stability was introduced - from: + stability: # Deprecation information for the metric. Required when stability is `deprecated`. deprecated: # Required: version when the metric was deprecated diff --git a/exporter/exporterhelper/metadata.yaml b/exporter/exporterhelper/metadata.yaml index d5488f8bdf7..949fc33defc 100644 --- a/exporter/exporterhelper/metadata.yaml +++ b/exporter/exporterhelper/metadata.yaml @@ -15,8 +15,7 @@ telemetry: metrics: exporter_enqueue_failed_log_records: enabled: true - stability: - level: alpha + stability: alpha description: Number of log records failed to be added to the sending queue. unit: "{records}" sum: @@ -25,8 +24,7 @@ telemetry: exporter_enqueue_failed_metric_points: enabled: true - stability: - level: alpha + stability: alpha description: Number of metric points failed to be added to the sending queue. unit: "{datapoints}" sum: @@ -35,8 +33,7 @@ telemetry: exporter_enqueue_failed_profile_samples: enabled: true - stability: - level: development + stability: development description: Number of profile samples failed to be added to the sending queue. unit: "{samples}" sum: @@ -45,8 +42,7 @@ telemetry: exporter_enqueue_failed_spans: enabled: true - stability: - level: alpha + stability: alpha description: Number of spans failed to be added to the sending queue. unit: "{spans}" sum: @@ -56,8 +52,7 @@ telemetry: exporter_queue_batch_send_size: enabled: true description: Number of units in the batch - stability: - level: development + stability: development unit: "{units}" histogram: value_type: int @@ -90,8 +85,7 @@ telemetry: exporter_queue_batch_send_size_bytes: enabled: true description: Number of bytes in batch that was sent. Only available on detailed level. - stability: - level: development + stability: development unit: By histogram: value_type: int @@ -115,8 +109,7 @@ telemetry: exporter_queue_capacity: enabled: true - stability: - level: alpha + stability: alpha description: Fixed capacity of the retry queue (in batches). unit: "{batches}" gauge: @@ -125,8 +118,7 @@ telemetry: exporter_queue_size: enabled: true - stability: - level: alpha + stability: alpha description: Current size of the retry queue (in batches). unit: "{batches}" gauge: @@ -135,8 +127,7 @@ telemetry: exporter_send_failed_log_records: enabled: true - stability: - level: alpha + stability: alpha description: "Number of log records in failed attempts to send to destination. At detailed telemetry level, includes attributes: error.type (semantic convention), error.permanent." unit: "{records}" sum: @@ -145,8 +136,7 @@ telemetry: exporter_send_failed_metric_points: enabled: true - stability: - level: alpha + stability: alpha description: "Number of metric points in failed attempts to send to destination. At detailed telemetry level, includes attributes: error.type (semantic convention), error.permanent." unit: "{datapoints}" sum: @@ -155,8 +145,7 @@ telemetry: exporter_send_failed_profile_samples: enabled: true - stability: - level: development + stability: development description: "Number of profile samples in failed attempts to send to destination. At detailed telemetry level, includes attributes: error.type (semantic convention), error.permanent." unit: "{samples}" sum: @@ -165,8 +154,7 @@ telemetry: exporter_send_failed_spans: enabled: true - stability: - level: alpha + stability: alpha description: "Number of spans in failed attempts to send to destination. At detailed telemetry level, includes attributes: error.type (semantic convention), error.permanent." unit: "{spans}" sum: @@ -175,8 +163,7 @@ telemetry: exporter_sent_log_records: enabled: true - stability: - level: alpha + stability: alpha description: Number of log record successfully sent to destination. unit: "{records}" sum: @@ -185,8 +172,7 @@ telemetry: exporter_sent_metric_points: enabled: true - stability: - level: alpha + stability: alpha description: Number of metric points successfully sent to destination. unit: "{datapoints}" sum: @@ -195,8 +181,7 @@ telemetry: exporter_sent_profile_samples: enabled: true - stability: - level: development + stability: development description: Number of profile samples successfully sent to destination. unit: "{samples}" sum: @@ -205,8 +190,7 @@ telemetry: exporter_sent_spans: enabled: true - stability: - level: alpha + stability: alpha description: Number of spans successfully sent to destination. unit: "{spans}" sum: diff --git a/processor/batchprocessor/metadata.yaml b/processor/batchprocessor/metadata.yaml index f8294872e15..4488f697c53 100644 --- a/processor/batchprocessor/metadata.yaml +++ b/processor/batchprocessor/metadata.yaml @@ -15,8 +15,7 @@ telemetry: metrics: processor_batch_batch_send_size: enabled: true - stability: - level: development + stability: development description: Number of units in the batch unit: "{units}" histogram: @@ -48,8 +47,7 @@ telemetry: ] processor_batch_batch_send_size_bytes: enabled: true - stability: - level: development + stability: development description: Number of bytes in batch that was sent. Only available on detailed level. unit: By histogram: @@ -98,8 +96,7 @@ telemetry: ] processor_batch_batch_size_trigger_send: enabled: true - stability: - level: development + stability: development description: Number of times the batch was sent due to a size trigger unit: "{times}" sum: @@ -107,8 +104,7 @@ telemetry: monotonic: true processor_batch_metadata_cardinality: enabled: true - stability: - level: development + stability: development description: Number of distinct metadata value combinations being processed unit: "{combinations}" sum: @@ -116,8 +112,7 @@ telemetry: async: true processor_batch_timeout_trigger_send: enabled: true - stability: - level: development + stability: development description: Number of times the batch was sent due to a timeout trigger unit: "{times}" sum: diff --git a/processor/memorylimiterprocessor/metadata.yaml b/processor/memorylimiterprocessor/metadata.yaml index 19bc4106c0f..660c39d9802 100644 --- a/processor/memorylimiterprocessor/metadata.yaml +++ b/processor/memorylimiterprocessor/metadata.yaml @@ -21,8 +21,7 @@ telemetry: processor_accepted_log_records: enabled: true description: Number of log records successfully pushed into the next component in the pipeline. - stability: - level: deprecated + stability: deprecated deprecated: since: "0.110.0" note: "This metric is deprecated" @@ -34,8 +33,7 @@ telemetry: processor_accepted_metric_points: enabled: true description: Number of metric points successfully pushed into the next component in the pipeline. - stability: - level: deprecated + stability: deprecated deprecated: since: "0.110.0" note: "This metric is deprecated" @@ -47,8 +45,7 @@ telemetry: processor_accepted_spans: enabled: true description: Number of spans successfully pushed into the next component in the pipeline. - stability: - level: deprecated + stability: deprecated deprecated: since: "0.110.0" note: "This metric is deprecated" @@ -60,8 +57,7 @@ telemetry: processor_refused_log_records: enabled: true description: Number of log records that were rejected by the next component in the pipeline. - stability: - level: deprecated + stability: deprecated deprecated: since: "0.110.0" note: "This metric is deprecated" @@ -73,8 +69,7 @@ telemetry: processor_refused_metric_points: enabled: true description: Number of metric points that were rejected by the next component in the pipeline. - stability: - level: deprecated + stability: deprecated deprecated: since: "0.110.0" note: "This metric is deprecated" @@ -86,8 +81,7 @@ telemetry: processor_refused_spans: enabled: true description: Number of spans that were rejected by the next component in the pipeline. - stability: - level: deprecated + stability: deprecated deprecated: since: "0.110.0" note: "This metric is deprecated" diff --git a/processor/processorhelper/metadata.yaml b/processor/processorhelper/metadata.yaml index 97b9e594a1c..4c1bc56e1b4 100644 --- a/processor/processorhelper/metadata.yaml +++ b/processor/processorhelper/metadata.yaml @@ -11,8 +11,7 @@ telemetry: metrics: processor_incoming_items: enabled: true - stability: - level: alpha + stability: alpha description: Number of items passed to the processor. unit: "{items}" sum: @@ -21,8 +20,7 @@ telemetry: processor_internal_duration: enabled: true - stability: - level: alpha + stability: alpha description: Duration of time taken to process a batch of telemetry data through the processor. unit: s histogram: @@ -31,8 +29,7 @@ telemetry: processor_outgoing_items: enabled: true - stability: - level: alpha + stability: alpha description: Number of items emitted from the processor. unit: "{items}" sum: diff --git a/receiver/receiverhelper/metadata.yaml b/receiver/receiverhelper/metadata.yaml index 6696d5b68a0..ba9c7908619 100644 --- a/receiver/receiverhelper/metadata.yaml +++ b/receiver/receiverhelper/metadata.yaml @@ -9,16 +9,14 @@ telemetry: metrics: receiver_accepted_log_records: enabled: true - stability: - level: alpha + stability: alpha description: Number of log records successfully pushed into the pipeline. unit: "{records}" sum: value_type: int monotonic: true receiver_accepted_metric_points: - stability: - level: alpha + stability: alpha enabled: true description: Number of metric points successfully pushed into the pipeline. unit: "{datapoints}" @@ -27,8 +25,7 @@ telemetry: monotonic: true receiver_accepted_profile_samples: enabled: true - stability: - level: alpha + stability: alpha description: Number of profile samples successfully pushed into the pipeline. unit: "{samples}" sum: @@ -36,8 +33,7 @@ telemetry: monotonic: true receiver_accepted_spans: enabled: true - stability: - level: alpha + stability: alpha description: Number of spans successfully pushed into the pipeline. unit: "{spans}" sum: @@ -45,8 +41,7 @@ telemetry: monotonic: true receiver_failed_log_records: enabled: true - stability: - level: alpha + stability: alpha description: The number of log records that failed to be processed by the receiver due to internal errors. unit: "{records}" sum: @@ -54,8 +49,7 @@ telemetry: monotonic: true receiver_failed_metric_points: enabled: true - stability: - level: alpha + stability: alpha description: The number of metric points that failed to be processed by the receiver due to internal errors. unit: "{datapoints}" sum: @@ -63,8 +57,7 @@ telemetry: monotonic: true receiver_failed_profile_samples: enabled: true - stability: - level: alpha + stability: alpha description: The number of profile samples that failed to be processed by the receiver due to internal errors. unit: "{samples}" sum: @@ -72,8 +65,7 @@ telemetry: monotonic: true receiver_failed_spans: enabled: true - stability: - level: alpha + stability: alpha description: The number of spans that failed to be processed by the receiver due to internal errors. unit: "{spans}" sum: @@ -81,8 +73,7 @@ telemetry: monotonic: true receiver_refused_log_records: enabled: true - stability: - level: alpha + stability: alpha description: Number of log records that could not be pushed into the pipeline. unit: "{records}" sum: @@ -90,8 +81,7 @@ telemetry: monotonic: true receiver_refused_metric_points: enabled: true - stability: - level: alpha + stability: alpha description: Number of metric points that could not be pushed into the pipeline. unit: "{datapoints}" sum: @@ -99,8 +89,7 @@ telemetry: monotonic: true receiver_refused_profile_samples: enabled: true - stability: - level: alpha + stability: alpha description: Number of profile samples that could not be pushed into the pipeline. unit: "{samples}" sum: @@ -108,8 +97,7 @@ telemetry: monotonic: true receiver_refused_spans: enabled: true - stability: - level: alpha + stability: alpha description: Number of spans that could not be pushed into the pipeline. unit: "{spans}" sum: @@ -117,8 +105,7 @@ telemetry: monotonic: true receiver_requests: enabled: true - stability: - level: alpha + stability: alpha description: The number of requests performed. unit: "{requests}" sum: diff --git a/scraper/scraperhelper/metadata.yaml b/scraper/scraperhelper/metadata.yaml index 6963d5751d6..ea8010188d9 100644 --- a/scraper/scraperhelper/metadata.yaml +++ b/scraper/scraperhelper/metadata.yaml @@ -11,8 +11,7 @@ telemetry: metrics: scraper_errored_log_records: enabled: true - stability: - level: alpha + stability: alpha description: Number of log records that were unable to be scraped. unit: "{datapoints}" sum: @@ -21,8 +20,7 @@ telemetry: scraper_errored_metric_points: enabled: true - stability: - level: alpha + stability: alpha description: Number of metric points that were unable to be scraped. unit: "{datapoints}" sum: @@ -31,8 +29,7 @@ telemetry: scraper_scraped_log_records: enabled: true - stability: - level: alpha + stability: alpha description: Number of log records successfully scraped. unit: "{datapoints}" sum: @@ -41,8 +38,7 @@ telemetry: scraper_scraped_metric_points: enabled: true - stability: - level: alpha + stability: alpha description: Number of metric points successfully scraped. unit: "{datapoints}" sum: diff --git a/scraper/scraperhelper/xscraperhelper/metadata.yaml b/scraper/scraperhelper/xscraperhelper/metadata.yaml index fd53acbbf49..c6b353b5ca1 100644 --- a/scraper/scraperhelper/xscraperhelper/metadata.yaml +++ b/scraper/scraperhelper/xscraperhelper/metadata.yaml @@ -14,8 +14,7 @@ telemetry: metrics: scraper_errored_profile_records: enabled: true - stability: - level: alpha + stability: alpha description: Number of profile records that were unable to be scraped. unit: "{datapoints}" sum: @@ -24,8 +23,7 @@ telemetry: scraper_scraped_profile_records: enabled: true - stability: - level: alpha + stability: alpha description: Number of profile records successfully scraped. unit: "{datapoints}" sum: diff --git a/service/metadata.yaml b/service/metadata.yaml index 2bd1292a0a9..de436afbb7a 100644 --- a/service/metadata.yaml +++ b/service/metadata.yaml @@ -14,8 +14,7 @@ telemetry: connector.consumed.items: prefix: otelcol. enabled: true - stability: - level: development + stability: development description: Number of items passed to the connector. unit: "{item}" sum: @@ -25,8 +24,7 @@ telemetry: connector.consumed.size: prefix: otelcol. enabled: false - stability: - level: development + stability: development description: Size of items passed to the connector, based on ProtoMarshaler.Sizer. unit: "{item}" sum: @@ -36,8 +34,7 @@ telemetry: connector.produced.items: prefix: otelcol. enabled: true - stability: - level: development + stability: development description: Number of items emitted from the connector. unit: "{item}" sum: @@ -47,8 +44,7 @@ telemetry: connector.produced.size: prefix: otelcol. enabled: false - stability: - level: development + stability: development description: Size of items emitted from the connector, based on ProtoMarshaler.Sizer. unit: "{item}" sum: @@ -58,8 +54,7 @@ telemetry: exporter.consumed.items: prefix: otelcol. enabled: true - stability: - level: development + stability: development description: Number of items passed to the exporter. unit: "{item}" sum: @@ -69,8 +64,7 @@ telemetry: exporter.consumed.size: prefix: otelcol. enabled: false - stability: - level: development + stability: development description: Size of items passed to the exporter, based on ProtoMarshaler.Sizer. unit: "{item}" sum: @@ -79,8 +73,7 @@ telemetry: process_cpu_seconds: enabled: true - stability: - level: alpha + stability: alpha description: Total CPU user and system time in seconds unit: s sum: @@ -90,8 +83,7 @@ telemetry: process_memory_rss: enabled: true - stability: - level: alpha + stability: alpha description: Total physical memory (resident set size) unit: By gauge: @@ -100,8 +92,7 @@ telemetry: process_runtime_heap_alloc_bytes: enabled: true - stability: - level: alpha + stability: alpha description: Bytes of allocated heap objects (see 'go doc runtime.MemStats.HeapAlloc') unit: By gauge: @@ -110,8 +101,7 @@ telemetry: process_runtime_total_alloc_bytes: enabled: true - stability: - level: alpha + stability: alpha description: Cumulative bytes allocated for heap objects (see 'go doc runtime.MemStats.TotalAlloc') unit: By sum: @@ -121,8 +111,7 @@ telemetry: process_runtime_total_sys_memory_bytes: enabled: true - stability: - level: alpha + stability: alpha description: Total bytes of memory obtained from the OS (see 'go doc runtime.MemStats.Sys') unit: By gauge: @@ -131,8 +120,7 @@ telemetry: process_uptime: enabled: true - stability: - level: alpha + stability: alpha description: Uptime of the process unit: s sum: @@ -143,8 +131,7 @@ telemetry: processor.consumed.items: prefix: otelcol. enabled: true - stability: - level: development + stability: development description: Number of items passed to the processor. unit: "{item}" sum: @@ -154,8 +141,7 @@ telemetry: processor.consumed.size: prefix: otelcol. enabled: false - stability: - level: development + stability: development description: Size of items passed to the processor, based on ProtoMarshaler.Sizer. unit: "{item}" sum: @@ -165,8 +151,7 @@ telemetry: processor.produced.items: prefix: otelcol. enabled: true - stability: - level: development + stability: development description: Number of items emitted from the processor. unit: "{item}" sum: @@ -176,8 +161,7 @@ telemetry: processor.produced.size: prefix: otelcol. enabled: false - stability: - level: development + stability: development description: Size of items emitted from the processor, based on ProtoMarshaler.Sizer. unit: "{item}" sum: @@ -187,8 +171,7 @@ telemetry: receiver.produced.items: prefix: otelcol. enabled: true - stability: - level: development + stability: development description: Number of items emitted from the receiver. unit: "{item}" sum: @@ -198,8 +181,7 @@ telemetry: receiver.produced.size: prefix: otelcol. enabled: false - stability: - level: development + stability: development description: Size of items emitted from the receiver, based on ProtoMarshaler.Sizer. unit: "{item}" sum: