Files
telemetry/cmd/mdatagen/metadata-schema.yaml
Dmitry AnoshinandGitHub f3403e9941 Enable mdatagen reaggregation by default (#15305)
All the components upstream got the reaggregation feature enabled
https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/45396.
`reaggregation_enabled` option can be set to true by default now.
2026-05-22 04:24:03 +00:00

421 lines
22 KiB
YAML

# Required: The type of the component - Usually the name. The type and class combined uniquely identify the component (eg. receiver/otlp) or subcomponent (eg. receiver/hostmetricsreceiver/cpu)
type:
# Optional: A deprecated type that is still available as an alias.
deprecated_type: string
# Optional: Human-readable display name for the component. Used as the title in generated README files.
display_name: string
# Optional: Brief description of the component that will be included in the generated README.
description: string
# Required for subcomponents: The type of the parent component.
parent: string
# Optional: Scope name for the telemetry generated by the component. If not set, name of the go package will be used.
scope_name: string
# Optional: The name of the package that mdatagen generates. If not set, the name "metadata" will be used.
generated_package_name: string
# Optional: Enables per-metric reaggregation config generation for metrics with attributes.
# Enabled by default. Set to false to generate metric config with only the `enabled`
# field.
# When enabled, generated metrics config includes `aggregation_strategy` and `attributes`
# fields that let users reduce metric cardinality by choosing which dimensions are kept.
reaggregation_enabled: bool
# Optional: Enables per-resource-attribute override_value config generation.
# When enabled, generated resource attribute config includes typed `override_value`
# fields that let users override resource attribute values in the collector config.
# Components can opt in gradually; defaults to false (shared ResourceAttributeConfig).
override_value_enabled: bool
# Required for components (Optional for subcomponents): A high-level view of the development status and use of this component
status:
# Required: The class of the component (For example receiver)
class: <receiver|processor|exporter|connector|extension|cmd|pkg|scraper|converter|provider>
# Required: The stability of the component - See https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md#stability-levels
stability:
development: [<metrics|traces|logs|traces_to_metrics|metrics_to_metrics|logs_to_metrics|extension,converter,provider>]
alpha: [<metrics|traces|logs|traces_to_metrics|metrics_to_metrics|logs_to_metrics|extension,converter,provider>]
beta: [<metrics|traces|logs|traces_to_metrics|metrics_to_metrics|logs_to_metrics|extension,converter,provider>]
stable: [<metrics|traces|logs|traces_to_metrics|metrics_to_metrics|logs_to_metrics|extension,converter,provider>]
deprecated: [<metrics|traces|logs|traces_to_metrics|metrics_to_metrics|logs_to_metrics|extension,converter,provider>]
unmaintained: [<metrics|traces|logs|traces_to_metrics|metrics_to_metrics|logs_to_metrics|extension,converter,provider>]
# Required for deprecated components: The deprecation information for the deprecated components - See https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md#deprecation-information
deprecation:
<component>:
date: string
migration: string
# Optional: The distributions that this component is bundled with (For example core or contrib). See statusdata.go for a list of common distros.
distributions: [string]
# Optional: A list of warnings that should be brought to the attention of users looking to use this component
warnings: [string]
# Optional: Metadata related to codeowners of the component
codeowners:
active: [string]
emeritus: [string]
unsupported_platforms: [<linux|windows>]
# Optional: OTel Semantic Conventions version that will be associated with the scraped metrics.
# This attribute should be set for metrics compliant with OTel Semantic Conventions.
sem_conv_version: 1.9.0
# Optional: JSON Schema based definition for the component's configuration structure.
# This section defines the schema that could be used to generate:
# - JSON Schema files that can be used for validation and documentation. (current)
# - Go structs representing the configuration with appropriate types and validation tags. (future)
# - Configuration reference documentation in the generated README files. (future)
config:
# Optional: Description of the configuration schema.
description: string
# Optional: Additional comments for developers (not included in JSON output).
$comment: string
# Required: The type of the configuration object. Typically "object" for component configs.
type: <string|number|integer|boolean|object|array|null>
# Optional: Map of configuration properties that define the component's configuration fields.
properties:
<property.name>:
# Optional: Description of this configuration property.
description: string
# Optional: The JSON Schema type of this property.
type: <string|number|integer|boolean|object|array|null>
# Optional: Reference to another schema definition. Can be:
# - Internal reference: name of a type in $defs (e.g., "endpoint_config")
# - External reference: full package path with type (e.g., "go.opentelemetry.io/collector/config/confighttp.client_config")
# - Relative reference: local path (e.g., "./internal/metadata.config")
$ref: string
# Optional: Default value for this property if not specified.
default: any
# Optional: Example values for this property.
examples: [any]
# Optional: Indicates if this property is deprecated.
deprecated: bool
# Optional: For string types - allowed values.
enum: [string]
# Optional: Constant value - property must have exactly this value.
const: any
# Optional: For string types - regular expression pattern that the value must match.
pattern: string
# Optional: For string types - format specification (e.g., "uri", "email", "date-time", "duration").
format: string
# Optional: For string types - minimum length.
minLength: int
# Optional: For string types - maximum length.
maxLength: int
# Optional: For number/integer types - minimum value (inclusive).
minimum: number
# Optional: For number/integer types - maximum value (inclusive).
maximum: number
# Optional: For number/integer types - exclusive minimum value.
exclusiveMinimum: number
# Optional: For number/integer types - exclusive maximum value.
exclusiveMaximum: number
# Optional: For number types - value must be a multiple of this number.
multipleOf: number
# Optional: For object types - properties of the nested object.
properties: {} # Recursively follows same structure
# Optional: For object types - whether additional properties beyond those defined are allowed.
# Can be true, false, or an object schema defining the type of additional properties.
additionalProperties: <bool|object>
# Optional: For object types - minimum number of properties required.
minProperties: int
# Optional: For object types - maximum number of properties allowed.
maxProperties: int
# Optional: For array types - schema for array items.
items:
# Same structure as property definition
type: string
# ... other item properties
# Optional: For array types - minimum number of items.
minItems: int
# Optional: For array types - maximum number of items.
maxItems: int
# Optional: For array types - whether all items must be unique.
uniqueItems: bool
# Optional: All of these schemas must be satisfied (schema composition).
allOf:
- type: object
properties: {}
# Custom extension fields (not part of JSON Schema standard, used by mdatagen):
# Optional: Custom Go type name to use instead of generated type.
x-customType: string
# Optional: Whether this field should be a pointer in Go code.
x-pointer: bool
# Optional: Whether this field is optional in Go code (will use pointer or optional type).
x-optional: bool
# Optional: List of required property names. Properties in this list must be present in the config.
required: [string]
# Optional: Map of reusable schema definitions that can be referenced via $ref.
# These definitions are not directly part of the config but can be reused multiple times.
$defs:
<definition.name>:
# Same structure as property definition
type: object
properties: {}
# ... other schema properties
# Optional: map of resource attribute definitions with the key being the attribute name.
resource_attributes:
<attribute.name>:
# Required: whether the resource attribute is added the emitted metrics by default.
enabled: bool
# Required: description of the attribute.
description:
# Optional: array of attribute values if they are static values (currently, only string type is supported).
enum: [string]
# Required: attribute value type.
type: <string|int|double|bool|bytes|slice|map>
# Optional: warnings that will be shown to user under specified conditions.
warnings:
# A warning that will be displayed if the resource_attribute is enabled in user config.
# Should be used for deprecated default resource_attributes that will be removed soon.
if_enabled:
# A warning that will be displayed if `enabled` field is not set explicitly in user config.
# Should be used for resource_attributes that will be turned from default to optional or vice versa.
if_enabled_not_set:
# A warning that will be displayed if the resource_attribute is configured by user in any way.
# Should be used for deprecated optional resource_attributes that will be removed soon.
if_configured:
# Optional: the reference to a semantic convention
# Relative path to the semantic convention definition (e.g., "system.md#system-memory-state")
# The full URL is constructed using sem_conv_version: {base}/v{version}/docs/registry/attributes/{ref}
# An example of a full url is: https://github.com/open-telemetry/semantic-conventions/blob/v1.38.0/docs/registry/attributes/system.md#system-memory-state
semantic_convention:
ref:
# Optional: array of entity definitions. Entities organize resource attributes into logical entities
# with identity and description attributes.
entities:
- # Required: the type of the entity.
type: string
# Required: a brief description of the entity.
brief: string
# Optional: the stability level of the entity.
stability: <development|alpha|beta|release_candidate|stable>
# Required: array of references to resource attributes that uniquely identify this entity.
# All referenced attributes must be defined in the resource_attributes section.
identity:
- ref: string
# Optional: array of references to resource attributes that describe this entity.
# All referenced attributes must be defined in the resource_attributes section.
description:
- ref: string
# Optional: array of relationships to other entities. Relationships should be defined on only
# one end to avoid bidirectional definitions. It is recommended to define relationships on
# entities with lower lifespan (higher churn). For example, a pod should define its relationship
# to a replicaset, rather than the replicaset defining its relationship to pods.
relationships:
- # Required: the type of the relationship (e.g., "controlled_by", "parent", "peer").
type: string
# Required: the target entity type this entity relates to. Must reference an entity
# defined in the same metadata.yaml file.
target: string
# Optional: map of attribute definitions with the key being the attribute name and value
# being described below.
attributes:
<attribute.name>:
# Optional: this field can be used to override the actual attribute name defined by the key.
# It should be used if multiple metrics have different attributes with the same name.
name_override:
# Required: description of the attribute.
description:
# Optional: array of attribute values if they are static values (currently, only string type is supported).
enum: [string]
# Required: attribute value type.
type: <string|int|double|bool|bytes|slice|map>
# Optional: indicates requirement level of the attribute.
# - required: the attribute is always included and cannot be excluded.
# - conditionally_required: the attribute is included by default when certain conditions are met.
# - recommended (default behavior): the attribute is included by default but can be disabled via configuration.
# - opt_in: the attribute is not included unless explicitly enabled in user config.
requirement_level: <required|conditionally_required|recommended|opt_in>
# Optional: the reference to a semantic convention
# Relative path to the semantic convention definition (e.g., "system.md#system-memory-state")
# The full URL is constructed using sem_conv_version: {base}/v{version}/docs/registry/attributes/{ref}
# An example of a full url is: https://github.com/open-telemetry/semantic-conventions/blob/v1.38.0/docs/registry/attributes/system.md#system-memory-state
semantic_convention:
ref:
# Optional: map of metric names with the key being the metric name and value
# being described below.
metrics:
<metric.name>:
# Required: whether the metric is collected by default.
enabled: bool
# Required: metric description.
description:
# Optional: extended documentation of the metric.
extended_documentation:
# Optional: warnings that will be shown to user under specified conditions.
warnings:
# A warning that will be displayed if the metric is enabled in user config.
# Should be used for deprecated default metrics that will be removed soon.
if_enabled:
# A warning that will be displayed if `enabled` field is not set explicitly in user config.
# Should be used for metrics that will be turned from default to optional or vice versa.
if_enabled_not_set:
# A warning that will be displayed if the metrics is configured by user in any way.
# Should be used for deprecated optional metrics that will be removed soon.
if_configured:
# Required: metric unit as defined by https://ucum.org/ucum.html.
unit:
# Required: metric type with its settings.
<sum|gauge>:
# Required for sum and gauge metrics: type of number data point values.
value_type: <int|double>
# Required for sum metric: whether the metric is monotonic (no negative delta values).
monotonic: bool
# Required for sum metric: whether reported values incorporate previous measurements
# (cumulative) or not (delta).
aggregation_temporality: <delta|cumulative>
# Optional: Indicates the type the metric needs to be parsed from. If set, the generated
# functions will parse the value from string to value_type.
input_type: string
# Optional: array of attributes that were defined in the attributes section that are emitted by this metric.
attributes: [string]
# Optional: the entity type this metric is associated with.
# Required when entities are defined in the entities section.
# Must reference an entity type defined in the entities section.
entity: string
# Required: the metric stability
stability: <development|alpha|beta|stable|deprecated>
# Deprecation information for the metric. Required when stability is `deprecated`.
deprecated:
# Required: version when the metric was deprecated
since:
# Required: migration note
note:
# Optional: the reference to a semantic convention
# Relative path to the semantic convention definition (e.g., "system/system-metrics.md#metric-systemcputime")
# The full URL is constructed using sem_conv_version: {base}/v{version}/docs/{ref}
# An example of a full url is: https://github.com/open-telemetry/semantic-conventions/blob/v1.40.0/docs/system/system-metrics.md#metric-systemcputime
semantic_convention:
ref:
# Optional: map of event names with the key being the event name and value
# being described below.
events:
<event.name>:
# Required: whether the event is collected by default.
enabled: bool
# Required: event description.
description:
# Optional: extended documentation of the event.
extended_documentation:
# Optional: warnings that will be shown to user under specified conditions.
warnings:
# A warning that will be displayed if the event is enabled in user config.
# Should be used for deprecated default events that will be removed soon.
if_enabled:
# A warning that will be displayed if `enabled` field is not set explicitly in user config.
if_enabled_not_set:
# A warning that will be displayed if the event is configured by user in any way.
if_configured:
# Optional: array of attributes that were defined in the attributes section that are emitted by this event.
attributes: [string]
# Optional: the entity type this event is associated with.
# Required when entities are defined in the entities section.
# Must reference an entity type defined in the entities section.
entity: string
# Lifecycle tests generated for this component.
tests:
config: # {} by default, specific testing configuration for lifecycle tests.
# Skip lifecycle tests for this component. Not recommended for components that are not in development.
skip_lifecycle: false # false by default
# Skip shutdown tests for this component. Not recommended for components that are not in development.
skip_shutdown: false # false by default
# Whether it's expected that the Consume[Logs|Metrics|Traces] method will return an error with the given configuration.
expect_consumer_error: true # false by default
goleak: # {} by default generates a package_test to enable check for leaks
skip: false # set to true if goleak tests should be skipped
setup: string # Optional: supports configuring a setup function that runs before goleak checks
teardown: string # Optional: supports configuring a teardown function that runs before goleak checks
ignore:
top: [string] # Optional: array of strings representing functions that should be ignore via IgnoreTopFunction
any: [string] # Optional: array of strings representing functions that should be ignore via IgnoreAnyFunction
# Optional: map of metric names with the key being the metric name and value
# being described below.
telemetry:
metrics:
<metric.name>:
# Required: whether the metric is collected by default.
enabled: bool
# Required: metric description.
description:
# Optional: the stability of the metric. Set to alpha by default.
stability:
# Optional: the stability level of the metric. Set to alpha by default.
level: [alpha|stable|deprecated]
# Optional: the version current stability was introduced
from:
# Deprecation information for the metric. Required when stability is `deprecated`.
deprecated:
# Required: version when the metric was deprecated
since:
# Required: migration note
note:
# Optional: extended documentation of the metric.
extended_documentation:
# Optional: whether or not this metric is optional. Optional metrics may only be initialized
# if certain features are enabled or configured.
optional: bool
# Optional: warnings that will be shown to user under specified conditions.
warnings:
# A warning that will be displayed if the metric is enabled in user config.
# Should be used for deprecated default metrics that will be removed soon.
if_enabled:
# A warning that will be displayed if `enabled` field is not set explicitly in user config.
# Should be used for metrics that will be turned from default to optional or vice versa.
if_enabled_not_set:
# A warning that will be displayed if the metrics is configured by user in any way.
# Should be used for deprecated optional metrics that will be removed soon.
if_configured:
# Required: metric unit as defined by https://ucum.org/ucum.html.
unit:
# Required: metric type with its settings.
<sum|gauge|histogram>:
# Optional: Whether this metric is asynchronous. If async, a mechanism is required to be able to
# pass in options to the callbacks that are called when the metric is observed.
async: bool
# Required: type of number data point values.
value_type: <int|double>
# Required for sum metric: whether the metric is monotonic (no negative delta values).
monotonic: bool
# Bucket boundaries are only available to set for histogram metrics.
bucket_boundaries: [double]
# Optional: array of attributes that were defined in the attributes section that are emitted by this metric.
# Note: Only the following attribute types are supported: <string|int|double|bool>
attributes: [string]
# Optional: list of feature gate definitions.
feature_gates:
- # Required: unique identifier for the feature gate. Unless
# skip_strict_validation is true on this gate, must be prefixed with
# "<status.class>.<type>." so gates are namespaced to their component.
id: <gate.id>
# Required: description of the feature gate.
description: string
# Required: lifecycle stage of the feature gate.
stage: <alpha|beta|stable|deprecated>
# Required: version when the feature gate was introduced.
from_version: string
# Required for stable/deprecated gates: version when the feature gate reached stable stage.
to_version: string
# Required: URL with contextual information about the feature gate. Unless
# skip_strict_validation is true on this gate, must be a GitHub issue URL
# of the form https://github.com/<owner>/<repo>/issues/<number>.
reference_url: string
# Optional: when true, opts this gate out of strict validation (the
# GitHub-issue reference_url requirement and the "<status.class>.<type>."
# ID prefix requirement). Intended to grandfather in gates that predate
# these rules; new gates should leave this unset.
skip_strict_validation: false