This PR also solves one more issues with the new interface, which is the
ability to record multiple observations for a single async metric using
one callback.
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
<!-- Issue number if applicable -->
Removes `level` field. This will be added back in the future once #11754
is completed.
#### Link to tracking issue
Updates #11061
This PR removes APIs that expose `configtelemetry.Level`. Internal
functionality still uses the Level, but will be soon changed to use the
new Instrument.Enabled.
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
This is replaced by a LeveledMeterProvider method on the struct instead.
This
reduces the complexity from the view of component authors, in that
there's no need
to check the level before invoking the meter to record a metric.
Closes
https://github.com/open-telemetry/opentelemetry-collector/issues/9510
---------
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
This will make it available to most components, as the
generated_telemetry is only generated for components that have internal
telemetry configured. Arguably the scope name should be moved to its own
file, but i'd rather not add yet another file if possible.
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
This can be used by components that need to set their scope name
manually. Will save component owners from having to store a variable,
which may diverge from the scope name used by the component for emitting
its own telemetry. There are about a dozen components in contrib that
could use this today.
Alternatively, I could just update the scope name strings in the
components manually.
---------
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
This ensures the consistency for folks emitting metrics w/ OTLP until
the OTEP to specify pipeline telemetry is completed.
Waiting on
https://github.com/open-telemetry/opentelemetry-collector/pull/9775
before moving this forward
Fixes#9315
---------
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
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>