diff --git a/.chloggen/feat_13781.yaml b/.chloggen/feat_13781.yaml new file mode 100644 index 000000000000..be90457af7f3 --- /dev/null +++ b/.chloggen/feat_13781.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: "enhancement" + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: "cmd/mdatagen" + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Add lint/ordering validation for metadata.yaml" + +# One or more tracking issues or pull requests related to the change +issues: [13781] + +# (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: [user] diff --git a/cmd/mdatagen/go.mod b/cmd/mdatagen/go.mod index 2eed28f19d80..618ca3939d0e 100644 --- a/cmd/mdatagen/go.mod +++ b/cmd/mdatagen/go.mod @@ -31,6 +31,7 @@ require ( go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 golang.org/x/text v0.29.0 + gopkg.in/yaml.v3 v3.0.1 ) require ( @@ -77,7 +78,6 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20250825161204-c5933d9347a5 // indirect google.golang.org/grpc v1.76.0 // indirect google.golang.org/protobuf v1.36.10 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect ) replace go.opentelemetry.io/collector/component => ../../component diff --git a/cmd/mdatagen/internal/command.go b/cmd/mdatagen/internal/command.go index 0f4ca575530e..511dad19d159 100644 --- a/cmd/mdatagen/internal/command.go +++ b/cmd/mdatagen/internal/command.go @@ -21,6 +21,7 @@ import ( "github.com/spf13/cobra" "golang.org/x/text/cases" "golang.org/x/text/language" + "gopkg.in/yaml.v3" ) const ( @@ -77,6 +78,15 @@ func run(ymlPath string) error { ymlDir := filepath.Dir(ymlPath) packageName := filepath.Base(ymlDir) + raw, readErr := os.ReadFile(ymlPath) //nolint:gosec // G304: abs path is cleaned/validated above; safe to read + if readErr != nil { + return fmt.Errorf("failed reading %v: %w", ymlPath, readErr) + } + + if err = validateYAMLKeyOrder(raw); err != nil { + return fmt.Errorf("metadata.yaml ordering check failed: %w", err) + } + md, err := LoadMetadata(ymlPath) if err != nil { return fmt.Errorf("failed loading %v: %w", ymlPath, err) @@ -404,3 +414,62 @@ func generateFile(tmplFile, outputFile string, md Metadata, goPackage string) er return formatErr } + +func validateMappingKeysSorted(root *yaml.Node, path ...string) error { + // unwrap doc + n := root + if n.Kind == yaml.DocumentNode && len(n.Content) > 0 { + n = n.Content[0] + } + // follow path + for _, seg := range path { + if n.Kind != yaml.MappingNode { + return nil + } + var next *yaml.Node + for i := 0; i < len(n.Content); i += 2 { + if n.Content[i].Value == seg { + next = n.Content[i+1] + break + } + } + if next == nil { + return nil + } + n = next + } + if n.Kind != yaml.MappingNode { + return nil + } + + // collect keys + keys := make([]string, 0, len(n.Content)/2) + for i := 0; i < len(n.Content); i += 2 { + keys = append(keys, n.Content[i].Value) + } + + if !slices.IsSorted(keys) { + return fmt.Errorf("%v keys are not sorted: %v", path, keys) + } + return nil +} + +// ValidateYAMLKeyOrder checks the sections we care about. +func validateYAMLKeyOrder(raw []byte) error { + var doc yaml.Node + if err := yaml.Unmarshal(raw, &doc); err != nil { + return err + } + for _, p := range [][]string{ + {"resource_attributes"}, + {"attributes"}, + {"metrics"}, + {"events"}, + {"telemetry", "metrics"}, + } { + if err := validateMappingKeysSorted(&doc, p...); err != nil { + return err + } + } + return nil +} diff --git a/cmd/mdatagen/internal/command_test.go b/cmd/mdatagen/internal/command_test.go index 706e00e46eef..9a079c625c75 100644 --- a/cmd/mdatagen/internal/command_test.go +++ b/cmd/mdatagen/internal/command_test.go @@ -48,12 +48,17 @@ func TestRunContents(t *testing.T) { wantGoleakSetup bool wantGoleakTeardown bool wantErr bool + wantOrderErr bool wantAttributes []string }{ { yml: "invalid.yaml", wantErr: true, }, + { + yml: "unsorted_rattr.yaml", + wantOrderErr: true, + }, { yml: "basic_connector.yaml", wantErr: false, @@ -234,6 +239,11 @@ foo require.NoError(t, os.WriteFile(filepath.Join(tmpdir, generatedPackageDir, "generated_component_test.go"), []byte("test"), 0o600)) err = run(metadataFile) + if tt.wantOrderErr { + require.Error(t, err) + require.Contains(t, err.Error(), "metadata.yaml ordering check failed") + return + } require.NoError(t, err) var contents []byte diff --git a/cmd/mdatagen/internal/sampleconnector/metadata.yaml b/cmd/mdatagen/internal/sampleconnector/metadata.yaml index ad46b6f834dc..e5a666023ccc 100644 --- a/cmd/mdatagen/internal/sampleconnector/metadata.yaml +++ b/cmd/mdatagen/internal/sampleconnector/metadata.yaml @@ -18,15 +18,9 @@ status: - Any additional information that should be brought to the consumer's attention resource_attributes: - string.resource.attr: - description: Resource attribute with any string value. - type: string - enabled: true - - string.enum.resource.attr: - description: Resource attribute with a known set of string values. - type: string - enum: [one, two] + map.resource.attr: + description: Resource attribute with a map value. + type: map enabled: true optional.resource.attr: @@ -39,9 +33,15 @@ resource_attributes: type: slice enabled: true - map.resource.attr: - description: Resource attribute with a map value. - type: map + string.enum.resource.attr: + description: Resource attribute with a known set of string values. + type: string + enum: [one, two] + enabled: true + + string.resource.attr: + description: Resource attribute with any string value. + type: string enabled: true string.resource.attr_disable_warning: @@ -66,20 +66,6 @@ resource_attributes: if_enabled: This resource_attribute is deprecated and will be removed soon. attributes: - string_attr: - description: Attribute with any string value. - type: string - - overridden_int_attr: - name_override: state - description: Integer attribute with overridden name. - type: int - - enum_attr: - description: Attribute with a known set of string values. - type: string - enum: [red, green, blue] - boolean_attr: description: Attribute with a boolean value. type: bool @@ -90,14 +76,28 @@ attributes: description: Another attribute with a boolean value. type: bool - slice_attr: - description: Attribute with a slice value. - type: slice + enum_attr: + description: Attribute with a known set of string values. + type: string + enum: [red, green, blue] map_attr: description: Attribute with a map value. type: map + overridden_int_attr: + name_override: state + description: Integer attribute with overridden name. + type: int + + slice_attr: + description: Attribute with a slice value. + type: slice + + string_attr: + description: Attribute with any string value. + type: string + metrics: default.metric: enabled: true @@ -108,30 +108,11 @@ metrics: value_type: int monotonic: true aggregation_temporality: cumulative - attributes: [string_attr, overridden_int_attr, enum_attr, slice_attr, map_attr] + attributes: + [string_attr, overridden_int_attr, enum_attr, slice_attr, map_attr] warnings: if_enabled_not_set: This metric will be disabled by default soon. - optional.metric: - enabled: false - description: "[DEPRECATED] Gauge double metric disabled by default." - unit: "1" - gauge: - value_type: double - attributes: [string_attr, boolean_attr, boolean_attr2] - warnings: - if_configured: This metric is deprecated and will be removed soon. - - optional.metric.empty_unit: - enabled: false - description: "[DEPRECATED] Gauge double metric disabled by default." - unit: "" - gauge: - value_type: double - attributes: [string_attr, boolean_attr] - warnings: - if_configured: This metric is deprecated and will be removed soon. - default.metric.to_be_removed: enabled: true description: "[DEPRECATED] Non-monotonic delta sum double metric enabled by default." @@ -153,4 +134,25 @@ metrics: input_type: string monotonic: true aggregation_temporality: cumulative - attributes: [ string_attr, overridden_int_attr, enum_attr, slice_attr, map_attr ] + attributes: + [string_attr, overridden_int_attr, enum_attr, slice_attr, map_attr] + + optional.metric: + enabled: false + description: "[DEPRECATED] Gauge double metric disabled by default." + unit: "1" + gauge: + value_type: double + attributes: [string_attr, boolean_attr, boolean_attr2] + warnings: + if_configured: This metric is deprecated and will be removed soon. + + optional.metric.empty_unit: + enabled: false + description: "[DEPRECATED] Gauge double metric disabled by default." + unit: "" + gauge: + value_type: double + attributes: [string_attr, boolean_attr] + warnings: + if_configured: This metric is deprecated and will be removed soon. diff --git a/cmd/mdatagen/internal/sampleprocessor/metadata.yaml b/cmd/mdatagen/internal/sampleprocessor/metadata.yaml index 1ad54810e09d..ce7f738c0f6f 100644 --- a/cmd/mdatagen/internal/sampleprocessor/metadata.yaml +++ b/cmd/mdatagen/internal/sampleprocessor/metadata.yaml @@ -21,15 +21,9 @@ status: - Any additional information that should be brought to the consumer's attention resource_attributes: - string.resource.attr: - description: Resource attribute with any string value. - type: string - enabled: true - - string.enum.resource.attr: - description: Resource attribute with a known set of string values. - type: string - enum: [one, two] + map.resource.attr: + description: Resource attribute with a map value. + type: map enabled: true optional.resource.attr: @@ -42,9 +36,15 @@ resource_attributes: type: slice enabled: true - map.resource.attr: - description: Resource attribute with a map value. - type: map + string.enum.resource.attr: + description: Resource attribute with a known set of string values. + type: string + enum: [one, two] + enabled: true + + string.resource.attr: + description: Resource attribute with any string value. + type: string enabled: true string.resource.attr_disable_warning: diff --git a/cmd/mdatagen/internal/samplereceiver/metadata.yaml b/cmd/mdatagen/internal/samplereceiver/metadata.yaml index 95b22c30741e..9aa1b75f87d8 100644 --- a/cmd/mdatagen/internal/samplereceiver/metadata.yaml +++ b/cmd/mdatagen/internal/samplereceiver/metadata.yaml @@ -26,15 +26,9 @@ status: - Any additional information that should be brought to the consumer's attention resource_attributes: - string.resource.attr: - description: Resource attribute with any string value. - type: string - enabled: true - - string.enum.resource.attr: - description: Resource attribute with a known set of string values. - type: string - enum: [one, two] + map.resource.attr: + description: Resource attribute with a map value. + type: map enabled: true optional.resource.attr: @@ -47,9 +41,15 @@ resource_attributes: type: slice enabled: true - map.resource.attr: - description: Resource attribute with a map value. - type: map + string.enum.resource.attr: + description: Resource attribute with a known set of string values. + type: string + enum: [one, two] + enabled: true + + string.resource.attr: + description: Resource attribute with any string value. + type: string enabled: true string.resource.attr_disable_warning: @@ -74,20 +74,6 @@ resource_attributes: if_enabled: This resource_attribute is deprecated and will be removed soon. attributes: - string_attr: - description: Attribute with any string value. - type: string - - overridden_int_attr: - name_override: state - description: Integer attribute with overridden name. - type: int - - enum_attr: - description: Attribute with a known set of string values. - type: string - enum: [red, green, blue] - boolean_attr: description: Attribute with a boolean value. type: bool @@ -98,9 +84,10 @@ attributes: description: Another attribute with a boolean value. type: bool - slice_attr: - description: Attribute with a slice value. - type: slice + enum_attr: + description: Attribute with a known set of string values. + type: string + enum: [red, green, blue] map_attr: description: Attribute with a map value. @@ -116,29 +103,52 @@ attributes: type: string optional: true + overridden_int_attr: + name_override: state + description: Integer attribute with overridden name. + type: int + + slice_attr: + description: Attribute with a slice value. + type: slice + + string_attr: + description: Attribute with any string value. + type: string + events: default.event: enabled: true description: Example event enabled by default. - attributes: [ string_attr, overridden_int_attr, enum_attr, slice_attr, map_attr, optional_int_attr, optional_string_attr] + attributes: + [ + string_attr, + overridden_int_attr, + enum_attr, + slice_attr, + map_attr, + optional_int_attr, + optional_string_attr, + ] warnings: if_enabled_not_set: This event will be disabled by default soon. - default.event.to_be_renamed: - enabled: false - description: "[DEPRECATED] Example event disabled by default." - extended_documentation: The event will be renamed soon. - attributes: [ string_attr, boolean_attr, boolean_attr2, optional_string_attr ] - warnings: - if_configured: This event is deprecated and will be renamed soon. - default.event.to_be_removed: enabled: true description: "[DEPRECATED] Example to-be-removed event enabled by default." extended_documentation: The event will be removed soon. warnings: if_enabled: This event is deprecated and will be removed soon. - attributes: [ string_attr, overridden_int_attr, enum_attr, slice_attr, map_attr ] + attributes: + [string_attr, overridden_int_attr, enum_attr, slice_attr, map_attr] + + default.event.to_be_renamed: + enabled: false + description: "[DEPRECATED] Example event disabled by default." + extended_documentation: The event will be renamed soon. + attributes: [string_attr, boolean_attr, boolean_attr2, optional_string_attr] + warnings: + if_configured: This event is deprecated and will be renamed soon. metrics: default.metric: @@ -150,30 +160,19 @@ metrics: value_type: int monotonic: true aggregation_temporality: cumulative - attributes: [string_attr, overridden_int_attr, enum_attr, slice_attr, map_attr, optional_int_attr, optional_string_attr] + attributes: + [ + string_attr, + overridden_int_attr, + enum_attr, + slice_attr, + map_attr, + optional_int_attr, + optional_string_attr, + ] warnings: if_enabled_not_set: This metric will be disabled by default soon. - optional.metric: - enabled: false - description: "[DEPRECATED] Gauge double metric disabled by default." - unit: "1" - gauge: - value_type: double - attributes: [string_attr, boolean_attr, boolean_attr2, optional_string_attr] - warnings: - if_configured: This metric is deprecated and will be removed soon. - - optional.metric.empty_unit: - enabled: false - description: "[DEPRECATED] Gauge double metric disabled by default." - unit: "" - gauge: - value_type: double - attributes: [string_attr, boolean_attr] - warnings: - if_configured: This metric is deprecated and will be removed soon. - default.metric.to_be_removed: enabled: true description: "[DEPRECATED] Non-monotonic delta sum double metric enabled by default." @@ -195,7 +194,28 @@ metrics: input_type: string monotonic: true aggregation_temporality: cumulative - attributes: [ string_attr, overridden_int_attr, enum_attr, slice_attr, map_attr ] + attributes: + [string_attr, overridden_int_attr, enum_attr, slice_attr, map_attr] + + optional.metric: + enabled: false + description: "[DEPRECATED] Gauge double metric disabled by default." + unit: "1" + gauge: + value_type: double + attributes: [string_attr, boolean_attr, boolean_attr2, optional_string_attr] + warnings: + if_configured: This metric is deprecated and will be removed soon. + + optional.metric.empty_unit: + enabled: false + description: "[DEPRECATED] Gauge double metric disabled by default." + unit: "" + gauge: + value_type: double + attributes: [string_attr, boolean_attr] + warnings: + if_configured: This metric is deprecated and will be removed soon. telemetry: metrics: @@ -209,15 +229,6 @@ telemetry: sum: value_type: int monotonic: true - request_duration: - enabled: true - stability: - level: alpha - description: Duration of request - unit: s - histogram: - value_type: double - bucket_boundaries: [1, 10, 100] process_runtime_total_alloc_bytes: enabled: true stability: @@ -228,6 +239,12 @@ telemetry: async: true value_type: int monotonic: true + queue_capacity: + enabled: true + description: Queue capacity - sync gauge example. + unit: "{items}" + gauge: + value_type: int queue_length: enabled: true stability: @@ -239,9 +256,12 @@ telemetry: gauge: async: true value_type: int - queue_capacity: + request_duration: enabled: true - description: Queue capacity - sync gauge example. - unit: "{items}" - gauge: - value_type: int + stability: + level: alpha + description: Duration of request + unit: s + histogram: + value_type: double + bucket_boundaries: [1, 10, 100] diff --git a/cmd/mdatagen/internal/samplescraper/documentation.md b/cmd/mdatagen/internal/samplescraper/documentation.md index 5044a8669ef5..5b75413d1c3c 100644 --- a/cmd/mdatagen/internal/samplescraper/documentation.md +++ b/cmd/mdatagen/internal/samplescraper/documentation.md @@ -90,9 +90,9 @@ metrics: [DEPRECATED] Gauge double metric disabled by default. -| Unit | Metric Type | Value Type | Stability | -| ---- | ----------- | ---------- | --------- | -| | Gauge | Double | deprecated | +| Unit | Metric Type | Value Type | +| ---- | ----------- | ---------- | +| | Gauge | Double | #### Attributes diff --git a/cmd/mdatagen/internal/samplescraper/metadata.yaml b/cmd/mdatagen/internal/samplescraper/metadata.yaml index efb1a963bb9c..6f9b4c957725 100644 --- a/cmd/mdatagen/internal/samplescraper/metadata.yaml +++ b/cmd/mdatagen/internal/samplescraper/metadata.yaml @@ -19,15 +19,9 @@ status: - Any additional information that should be brought to the consumer's attention resource_attributes: - string.resource.attr: - description: Resource attribute with any string value. - type: string - enabled: true - - string.enum.resource.attr: - description: Resource attribute with a known set of string values. - type: string - enum: [one, two] + map.resource.attr: + description: Resource attribute with a map value. + type: map enabled: true optional.resource.attr: @@ -40,9 +34,15 @@ resource_attributes: type: slice enabled: true - map.resource.attr: - description: Resource attribute with a map value. - type: map + string.enum.resource.attr: + description: Resource attribute with a known set of string values. + type: string + enum: [one, two] + enabled: true + + string.resource.attr: + description: Resource attribute with any string value. + type: string enabled: true string.resource.attr_disable_warning: @@ -67,20 +67,6 @@ resource_attributes: if_enabled: This resource_attribute is deprecated and will be removed soon. attributes: - string_attr: - description: Attribute with any string value. - type: string - - overridden_int_attr: - name_override: state - description: Integer attribute with overridden name. - type: int - - enum_attr: - description: Attribute with a known set of string values. - type: string - enum: [red, green, blue] - boolean_attr: description: Attribute with a boolean value. type: bool @@ -91,14 +77,28 @@ attributes: description: Another attribute with a boolean value. type: bool - slice_attr: - description: Attribute with a slice value. - type: slice + enum_attr: + description: Attribute with a known set of string values. + type: string + enum: [red, green, blue] map_attr: description: Attribute with a map value. type: map + overridden_int_attr: + name_override: state + description: Integer attribute with overridden name. + type: int + + slice_attr: + description: Attribute with a slice value. + type: slice + + string_attr: + description: Attribute with any string value. + type: string + metrics: default.metric: enabled: true @@ -109,32 +109,11 @@ metrics: value_type: int monotonic: true aggregation_temporality: cumulative - attributes: [string_attr, overridden_int_attr, enum_attr, slice_attr, map_attr] + attributes: + [string_attr, overridden_int_attr, enum_attr, slice_attr, map_attr] warnings: if_enabled_not_set: This metric will be disabled by default soon. - optional.metric: - enabled: false - description: "[DEPRECATED] Gauge double metric disabled by default." - unit: "1" - gauge: - value_type: double - attributes: [string_attr, boolean_attr, boolean_attr2] - warnings: - if_configured: This metric is deprecated and will be removed soon. - - optional.metric.empty_unit: - enabled: false - stability: - level: deprecated - description: "[DEPRECATED] Gauge double metric disabled by default." - unit: "" - gauge: - value_type: double - attributes: [string_attr, boolean_attr] - warnings: - if_configured: This metric is deprecated and will be removed soon. - default.metric.to_be_removed: enabled: true description: "[DEPRECATED] Non-monotonic delta sum double metric enabled by default." @@ -158,4 +137,25 @@ metrics: input_type: string monotonic: true aggregation_temporality: cumulative - attributes: [ string_attr, overridden_int_attr, enum_attr, slice_attr, map_attr ] + attributes: + [string_attr, overridden_int_attr, enum_attr, slice_attr, map_attr] + + optional.metric: + enabled: false + description: "[DEPRECATED] Gauge double metric disabled by default." + unit: "1" + gauge: + value_type: double + attributes: [string_attr, boolean_attr, boolean_attr2] + warnings: + if_configured: This metric is deprecated and will be removed soon. + + optional.metric.empty_unit: + enabled: false + description: "[DEPRECATED] Gauge double metric disabled by default." + unit: "" + gauge: + value_type: double + attributes: [string_attr, boolean_attr] + warnings: + if_configured: This metric is deprecated and will be removed soon. diff --git a/cmd/mdatagen/internal/testdata/unsorted_rattr.yaml b/cmd/mdatagen/internal/testdata/unsorted_rattr.yaml new file mode 100644 index 000000000000..8520678f7940 --- /dev/null +++ b/cmd/mdatagen/internal/testdata/unsorted_rattr.yaml @@ -0,0 +1,16 @@ +type: sample + +status: + class: receiver + stability: + beta: [logs] + +resource_attributes: + cloud.region: + description: region + enabled: true + type: string + cloud.availability_zone: + description: az + enabled: true + type: string diff --git a/exporter/exporterhelper/metadata.yaml b/exporter/exporterhelper/metadata.yaml index 0af14cce32ef..9212c3ec2210 100644 --- a/exporter/exporterhelper/metadata.yaml +++ b/exporter/exporterhelper/metadata.yaml @@ -13,22 +13,22 @@ status: telemetry: metrics: - exporter_sent_spans: + exporter_enqueue_failed_log_records: enabled: true stability: level: alpha - description: Number of spans successfully sent to destination. - unit: "{spans}" + description: Number of log records failed to be added to the sending queue. + unit: "{records}" sum: value_type: int monotonic: true - exporter_send_failed_spans: + exporter_enqueue_failed_metric_points: enabled: true stability: level: alpha - description: Number of spans in failed attempts to send to destination. - unit: "{spans}" + description: Number of metric points failed to be added to the sending queue. + unit: "{datapoints}" sum: value_type: int monotonic: true @@ -43,45 +43,81 @@ telemetry: value_type: int monotonic: true - exporter_sent_metric_points: + exporter_queue_batch_send_size: enabled: true - stability: - level: alpha - description: Number of metric points successfully sent to destination. - unit: "{datapoints}" - sum: + description: Number of units in the batch + unit: "{units}" + histogram: value_type: int - monotonic: true + bucket_boundaries: + [ + 10, + 25, + 50, + 75, + 100, + 250, + 500, + 750, + 1000, + 2000, + 3000, + 4000, + 5000, + 6000, + 7000, + 8000, + 9000, + 10000, + 20000, + 30000, + 50000, + 100000, + ] - exporter_send_failed_metric_points: + exporter_queue_batch_send_size_bytes: enabled: true - stability: - level: alpha - description: Number of metric points in failed attempts to send to destination. - unit: "{datapoints}" - sum: + description: Number of bytes in batch that was sent. Only available on detailed level. + unit: By + histogram: value_type: int - monotonic: true + bucket_boundaries: + [ + 10, + 25, + 50, + 75, + 100, + 250, + 500, + 750, + 1000, + 2000, + 3000, + 4000, + 5000, + 6000, + ] - exporter_enqueue_failed_metric_points: + exporter_queue_capacity: enabled: true stability: level: alpha - description: Number of metric points failed to be added to the sending queue. - unit: "{datapoints}" - sum: + description: Fixed capacity of the retry queue (in batches). + unit: "{batches}" + gauge: value_type: int - monotonic: true + async: true - exporter_sent_log_records: + exporter_queue_size: enabled: true stability: level: alpha - description: Number of log record successfully sent to destination. - unit: "{records}" - sum: + description: Current size of the retry queue (in batches). + unit: "{batches}" + gauge: value_type: int - monotonic: true + async: true exporter_send_failed_log_records: enabled: true @@ -93,48 +129,52 @@ telemetry: value_type: int monotonic: true - exporter_enqueue_failed_log_records: + exporter_send_failed_metric_points: enabled: true stability: level: alpha - description: Number of log records failed to be added to the sending queue. - unit: "{records}" + description: Number of metric points in failed attempts to send to destination. + unit: "{datapoints}" sum: value_type: int monotonic: true - exporter_queue_size: + exporter_send_failed_spans: enabled: true stability: level: alpha - description: Current size of the retry queue (in batches). - unit: "{batches}" - gauge: + description: Number of spans in failed attempts to send to destination. + unit: "{spans}" + sum: value_type: int - async: true + monotonic: true - exporter_queue_batch_send_size: + exporter_sent_log_records: enabled: true - description: Number of units in the batch - unit: "{units}" - histogram: + stability: + level: alpha + description: Number of log record successfully sent to destination. + unit: "{records}" + sum: 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 ] + monotonic: true - exporter_queue_batch_send_size_bytes: + exporter_sent_metric_points: enabled: true - description: Number of bytes in batch that was sent. Only available on detailed level. - unit: By - histogram: + stability: + level: alpha + description: Number of metric points successfully sent to destination. + unit: "{datapoints}" + sum: value_type: int - bucket_boundaries: [ 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2000, 3000, 4000, 5000, 6000 ] + monotonic: true - exporter_queue_capacity: + exporter_sent_spans: enabled: true stability: level: alpha - description: Fixed capacity of the retry queue (in batches). - unit: "{batches}" - gauge: + description: Number of spans successfully sent to destination. + unit: "{spans}" + sum: value_type: int - async: true + monotonic: true diff --git a/processor/batchprocessor/metadata.yaml b/processor/batchprocessor/metadata.yaml index fa9bb713df63..127322310050 100644 --- a/processor/batchprocessor/metadata.yaml +++ b/processor/batchprocessor/metadata.yaml @@ -5,41 +5,99 @@ status: disable_codecov_badge: true class: processor stability: - beta: [ traces, metrics, logs ] - distributions: [ core, contrib, k8s ] + beta: [traces, metrics, logs] + distributions: [core, contrib, k8s] tests: telemetry: metrics: - processor_batch_batch_size_trigger_send: - enabled: true - description: Number of times the batch was sent due to a size trigger - 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: "{times}" - sum: - value_type: int - monotonic: true processor_batch_batch_send_size: enabled: true description: Number of units in the batch 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 ] + bucket_boundaries: + [ + 10, + 25, + 50, + 75, + 100, + 250, + 500, + 750, + 1000, + 2000, + 3000, + 4000, + 5000, + 6000, + 7000, + 8000, + 9000, + 10000, + 20000, + 30000, + 50000, + 100000, + ] processor_batch_batch_send_size_bytes: enabled: true description: Number of bytes in batch that was sent. Only available on detailed level. unit: By 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, 100_000, 200_000, 300_000, 400_000, 500_000, 600_000, 700_000, 800_000, 900_000, 1000_000, 2000_000, 3000_000, 4000_000, 5000_000, 6000_000, 7000_000, 8000_000, 9000_000 ] + bucket_boundaries: + [ + 10, + 25, + 50, + 75, + 100, + 250, + 500, + 750, + 1000, + 2000, + 3000, + 4000, + 5000, + 6000, + 7000, + 8000, + 9000, + 10000, + 20000, + 30000, + 50000, + 100_000, + 200_000, + 300_000, + 400_000, + 500_000, + 600_000, + 700_000, + 800_000, + 900_000, + 1000_000, + 2000_000, + 3000_000, + 4000_000, + 5000_000, + 6000_000, + 7000_000, + 8000_000, + 9000_000, + ] + processor_batch_batch_size_trigger_send: + enabled: true + description: Number of times the batch was sent due to a size trigger + unit: "{times}" + sum: + value_type: int + monotonic: true processor_batch_metadata_cardinality: enabled: true description: Number of distinct metadata value combinations being processed @@ -47,3 +105,10 @@ telemetry: sum: value_type: int async: true + processor_batch_timeout_trigger_send: + enabled: true + description: Number of times the batch was sent due to a timeout trigger + unit: "{times}" + sum: + value_type: int + monotonic: true diff --git a/processor/memorylimiterprocessor/metadata.yaml b/processor/memorylimiterprocessor/metadata.yaml index 2b73072a2f03..aa8813f1eaf7 100644 --- a/processor/memorylimiterprocessor/metadata.yaml +++ b/processor/memorylimiterprocessor/metadata.yaml @@ -17,68 +17,68 @@ tests: telemetry: metrics: - processor_accepted_spans: + processor_accepted_log_records: enabled: true - description: Number of spans successfully pushed into the next component in the pipeline. + description: Number of log records successfully pushed into the next component in the pipeline. stability: level: deprecated from: v0.110.0 - unit: "{spans}" + unit: "{records}" sum: value_type: int monotonic: true - processor_refused_spans: + processor_accepted_metric_points: enabled: true - description: Number of spans that were rejected by the next component in the pipeline. + description: Number of metric points successfully pushed into the next component in the pipeline. stability: level: deprecated from: v0.110.0 - unit: "{spans}" + unit: "{datapoints}" sum: value_type: int monotonic: true - processor_accepted_metric_points: + processor_accepted_spans: enabled: true - description: Number of metric points successfully pushed into the next component in the pipeline. + description: Number of spans successfully pushed into the next component in the pipeline. stability: level: deprecated from: v0.110.0 - unit: "{datapoints}" + unit: "{spans}" sum: value_type: int monotonic: true - processor_refused_metric_points: + processor_refused_log_records: enabled: true - description: Number of metric points that were rejected by the next component in the pipeline. + description: Number of log records that were rejected by the next component in the pipeline. stability: level: deprecated from: v0.110.0 - unit: "{datapoints}" + unit: "{records}" sum: value_type: int monotonic: true - processor_accepted_log_records: + processor_refused_metric_points: enabled: true - description: Number of log records successfully pushed into the next component in the pipeline. + description: Number of metric points that were rejected by the next component in the pipeline. stability: level: deprecated from: v0.110.0 - unit: "{records}" + unit: "{datapoints}" sum: value_type: int monotonic: true - processor_refused_log_records: + processor_refused_spans: enabled: true - description: Number of log records that were rejected by the next component in the pipeline. + description: Number of spans that were rejected by the next component in the pipeline. stability: level: deprecated from: v0.110.0 - unit: "{records}" + unit: "{spans}" sum: value_type: int monotonic: true diff --git a/processor/processorhelper/metadata.yaml b/processor/processorhelper/metadata.yaml index 89f2775dd2ee..97b9e594a1cd 100644 --- a/processor/processorhelper/metadata.yaml +++ b/processor/processorhelper/metadata.yaml @@ -19,16 +19,6 @@ telemetry: value_type: int monotonic: true - processor_outgoing_items: - enabled: true - stability: - level: alpha - description: Number of items emitted from the processor. - unit: "{items}" - sum: - value_type: int - monotonic: true - processor_internal_duration: enabled: true stability: @@ -38,3 +28,13 @@ telemetry: histogram: async: false value_type: double + + processor_outgoing_items: + enabled: true + stability: + level: alpha + description: Number of items emitted from the processor. + unit: "{items}" + sum: + value_type: int + monotonic: true diff --git a/receiver/receiverhelper/metadata.yaml b/receiver/receiverhelper/metadata.yaml index 5d19ac537d68..e5854f996b53 100644 --- a/receiver/receiverhelper/metadata.yaml +++ b/receiver/receiverhelper/metadata.yaml @@ -7,84 +7,84 @@ status: beta: [metrics, traces, logs] telemetry: metrics: - receiver_accepted_spans: + receiver_accepted_log_records: enabled: true stability: level: alpha - description: Number of spans successfully pushed into the pipeline. - unit: "{spans}" + description: Number of log records successfully pushed into the pipeline. + unit: "{records}" sum: value_type: int monotonic: true - receiver_refused_spans: - enabled: true + receiver_accepted_metric_points: stability: level: alpha - description: Number of spans that could not be pushed into the pipeline. - unit: "{spans}" + enabled: true + description: Number of metric points successfully pushed into the pipeline. + unit: "{datapoints}" sum: value_type: int monotonic: true - receiver_failed_spans: + receiver_accepted_spans: enabled: true stability: level: alpha - description: The number of spans that failed to be processed by the receiver due to internal errors. + description: Number of spans successfully pushed into the pipeline. unit: "{spans}" sum: value_type: int monotonic: true - receiver_accepted_metric_points: + receiver_failed_log_records: + enabled: true stability: level: alpha - enabled: true - description: Number of metric points successfully pushed into the pipeline. - unit: "{datapoints}" + description: The number of log records that failed to be processed by the receiver due to internal errors. + unit: "{records}" sum: value_type: int monotonic: true - receiver_refused_metric_points: + receiver_failed_metric_points: enabled: true stability: level: alpha - description: Number of metric points that could not be pushed into the pipeline. + description: The number of metric points that failed to be processed by the receiver due to internal errors. unit: "{datapoints}" sum: value_type: int monotonic: true - receiver_failed_metric_points: + receiver_failed_spans: enabled: true stability: level: alpha - description: The number of metric points that failed to be processed by the receiver due to internal errors. - unit: "{datapoints}" + description: The number of spans that failed to be processed by the receiver due to internal errors. + unit: "{spans}" sum: value_type: int monotonic: true - receiver_accepted_log_records: + receiver_refused_log_records: enabled: true stability: level: alpha - description: Number of log records successfully pushed into the pipeline. + description: Number of log records that could not be pushed into the pipeline. unit: "{records}" sum: value_type: int monotonic: true - receiver_refused_log_records: + receiver_refused_metric_points: enabled: true stability: level: alpha - description: Number of log records that could not be pushed into the pipeline. - unit: "{records}" + description: Number of metric points that could not be pushed into the pipeline. + unit: "{datapoints}" sum: value_type: int monotonic: true - receiver_failed_log_records: + receiver_refused_spans: enabled: true stability: level: alpha - description: The number of log records that failed to be processed by the receiver due to internal errors. - unit: "{records}" + description: Number of spans that could not be pushed into the pipeline. + unit: "{spans}" sum: value_type: int monotonic: true diff --git a/scraper/scraperhelper/metadata.yaml b/scraper/scraperhelper/metadata.yaml index 74ca910307cc..6963d5751d64 100644 --- a/scraper/scraperhelper/metadata.yaml +++ b/scraper/scraperhelper/metadata.yaml @@ -9,11 +9,11 @@ status: telemetry: metrics: - scraper_scraped_metric_points: + scraper_errored_log_records: enabled: true stability: level: alpha - description: Number of metric points successfully scraped. + description: Number of log records that were unable to be scraped. unit: "{datapoints}" sum: value_type: int @@ -39,11 +39,11 @@ telemetry: value_type: int monotonic: true - scraper_errored_log_records: + scraper_scraped_metric_points: enabled: true stability: level: alpha - description: Number of log records that were unable to be scraped. + description: Number of metric points successfully scraped. unit: "{datapoints}" sum: value_type: int diff --git a/service/metadata.yaml b/service/metadata.yaml index 53f1a66836d5..344b7e587c32 100644 --- a/service/metadata.yaml +++ b/service/metadata.yaml @@ -10,17 +10,81 @@ status: telemetry: metrics: - process_uptime: + connector.consumed.items: + prefix: otelcol. + enabled: true + description: Number of items passed to the connector. + unit: "{item}" + sum: + value_type: int + monotonic: true + + connector.consumed.size: + prefix: otelcol. + enabled: false + description: Size of items passed to the connector, based on ProtoMarshaler.Sizer. + unit: "{item}" + sum: + value_type: int + monotonic: true + + connector.produced.items: + prefix: otelcol. + enabled: true + description: Number of items emitted from the connector. + unit: "{item}" + sum: + value_type: int + monotonic: true + + connector.produced.size: + prefix: otelcol. + enabled: false + description: Size of items emitted from the connector, based on ProtoMarshaler.Sizer. + unit: "{item}" + sum: + value_type: int + monotonic: true + + exporter.consumed.items: + prefix: otelcol. + enabled: true + description: Number of items passed to the exporter. + unit: "{item}" + sum: + value_type: int + monotonic: true + + exporter.consumed.size: + prefix: otelcol. + enabled: false + description: Size of items passed to the exporter, based on ProtoMarshaler.Sizer. + unit: "{item}" + sum: + value_type: int + monotonic: true + + process_cpu_seconds: enabled: true stability: level: alpha - description: Uptime of the process + description: Total CPU user and system time in seconds unit: s sum: async: true value_type: double monotonic: true + process_memory_rss: + enabled: true + stability: + level: alpha + description: Total physical memory (resident set size) + unit: By + gauge: + async: true + value_type: int + process_runtime_heap_alloc_bytes: enabled: true stability: @@ -52,35 +116,17 @@ telemetry: async: true value_type: int - process_cpu_seconds: + process_uptime: enabled: true stability: level: alpha - description: Total CPU user and system time in seconds + description: Uptime of the process unit: s sum: async: true value_type: double monotonic: true - process_memory_rss: - enabled: true - stability: - level: alpha - description: Total physical memory (resident set size) - unit: By - gauge: - async: true - value_type: int - - receiver.produced.items: - prefix: otelcol. - enabled: true - description: Number of items emitted from the receiver. - unit: "{item}" - sum: - value_type: int - monotonic: true processor.consumed.items: prefix: otelcol. enabled: true @@ -89,47 +135,7 @@ telemetry: sum: value_type: int monotonic: true - processor.produced.items: - prefix: otelcol. - enabled: true - description: Number of items emitted from the processor. - unit: "{item}" - sum: - value_type: int - monotonic: true - connector.consumed.items: - prefix: otelcol. - enabled: true - description: Number of items passed to the connector. - unit: "{item}" - sum: - value_type: int - monotonic: true - connector.produced.items: - prefix: otelcol. - enabled: true - description: Number of items emitted from the connector. - unit: "{item}" - sum: - value_type: int - monotonic: true - exporter.consumed.items: - prefix: otelcol. - enabled: true - description: Number of items passed to the exporter. - unit: "{item}" - sum: - value_type: int - monotonic: true - receiver.produced.size: - prefix: otelcol. - enabled: false - description: Size of items emitted from the receiver, based on ProtoMarshaler.Sizer. - unit: "{item}" - sum: - value_type: int - monotonic: true processor.consumed.size: prefix: otelcol. enabled: false @@ -138,34 +144,38 @@ telemetry: sum: value_type: int monotonic: true - processor.produced.size: + + processor.produced.items: prefix: otelcol. - enabled: false - description: Size of items emitted from the processor, based on ProtoMarshaler.Sizer. + enabled: true + description: Number of items emitted from the processor. unit: "{item}" sum: value_type: int monotonic: true - connector.consumed.size: + + processor.produced.size: prefix: otelcol. enabled: false - description: Size of items passed to the connector, based on ProtoMarshaler.Sizer. + description: Size of items emitted from the processor, based on ProtoMarshaler.Sizer. unit: "{item}" sum: value_type: int monotonic: true - connector.produced.size: + + receiver.produced.items: prefix: otelcol. - enabled: false - description: Size of items emitted from the connector, based on ProtoMarshaler.Sizer. + enabled: true + description: Number of items emitted from the receiver. unit: "{item}" sum: value_type: int monotonic: true - exporter.consumed.size: + + receiver.produced.size: prefix: otelcol. enabled: false - description: Size of items passed to the exporter, based on ProtoMarshaler.Sizer. + description: Size of items emitted from the receiver, based on ProtoMarshaler.Sizer. unit: "{item}" sum: value_type: int