Fix incorrect deduplication of otelcol_exporter_queue_size and
otelcol_exporter_queue_capacity metrics if multiple exporters are used.
Fixes
https://github.com/open-telemetry/opentelemetry-collector/issues/10444
The registered callbacks are ignored for now, which is the same behavior
as before. Ideally, we would need to unregister them properly.
This will be used in a follow up PR that allows initialization of
optional internal metrics which address the queue metric use-case.
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Fixing this bug required a change in mdatagen to ensure attributes could
be passed in to the telemetry builder.
Fixes#9674
---------
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
This allows components to set the minimum level needed for them to
produce telemetry. By default, this is set to
`configtelemetryLevelBasic`. If the telemetry level is below that
minimum level, then the noop meter is used for metrics.
---------
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
This PR adds the ability to configure asynchronous (observable)
instruments via mdatagen. This requires providing a mechanism to set
options to pass in the callbacks that will be called at the time of the
observation.
---------
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
#### Description
This updates mdatagen to generate internal telemetry for components
based on metadata.yaml configuration.
#### Testing
Added tests to mdatagen and updated the batch processor to use this as
well for synchronous counters and histogram
---------
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
**Description:**
- Adds `component.MustNewType` to create a type. This function panics if
the type has invalid characters. Add similar functions
`component.MustNewID` and `component.MustNewIDWithName`.
- Adds `component.Type.String` to recover the string
- Use `component.MustNewType`, `component.MustNewID`,
`component.MustNewIDWithName` and `component.Type.String` everywhere in
this codebase. To do this I changed `component.Type` into an opaque
struct and checked for compile-time errors.
Some notes:
1. All components currently on core and contrib follow this rule. This
is still breaking for other components.
2. A future PR will change this into a struct, to actually validate this
(right now you can just do `component.Type("anything")` to bypass
validation). I want to do this in two steps to avoid breaking contrib
tests: we first introduce this function, and after that we change into a
struct.
**Link to tracking Issue:** Updates #9208