Commit Graph

25 Commits

Author SHA1 Message Date
Andres Borja e8497dfbf6
Add processor duration metric (#13227)
#### Description

Add duration metric to processors.

#### Testing

Unit tests added.

#### Documentation

Implements issue [Processor duration metric
#13231](https://github.com/open-telemetry/opentelemetry-collector/issues/13231).

Basic documentation generated by mdatagen.

---------

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
2025-08-07 15:50:03 +00:00
Bogdan Drutu 3203167e9a
Make registration of callback for async metric always optional (#12204)
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>
2025-01-29 23:58:43 +00:00
Pablo Baeyens b844bb7146
[cmd/mdatagen] Remove level field from metrics (#12145)
<!--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
2025-01-22 14:09:03 +00:00
Bogdan Drutu 306c939415
Deprecate component_test in favor of metadatatest (#11812)
The main idea behind this is that the test helpers were generated in the
main package, hard to find and understand and also impossible to use
outside the main package, see the
[service/internal/proctelemetry/process_telemetry_test.go](https://github.com/open-telemetry/opentelemetry-collector/compare/main...bogdandrutu:opentelemetry-collector:dep-comp-test?expand=1#diff-ed642eb1c968a9308a07e87292f77af1e0830a7af2d87111c5abacde4fc87446).

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-01-06 18:06:46 +00:00
Bogdan Drutu 9ea2f531f5
Remove deprecated LeveledMeter from the generated code (#11696)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-11-19 10:50:15 -08:00
Bogdan Drutu 8e522ad950
Revert public API changes in #10931, preserve logic (#11415)
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>
2024-11-15 16:49:51 -08:00
Bogdan Drutu d1286186b7
Remove deprecated funcs form processorhelper.ObsReport (#11289)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-09-27 16:13:45 -07:00
Alex Boten a3c0565031
[processorhelper] deprecated accepted/refused/dropped metrics (#11201)
These were only used by the memory limiter processor and were never
automatically calculated by the processorhelper. It's better to move
them to processor specific metrics that can be managed within the
component itself.

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-09-18 12:33:45 -07:00
Alex Boten d5215c559a
[mdatagen] add stability detail for metrics (#11160)
This allows component authors to specify the stability level of
telemetry emitted by components. This provides visibility to end users
as to what they can expect from the telemetry.

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-09-17 11:44:43 -07:00
Alex Boten 3b50b38d39
[processorhelper] report signal as attribute on incoming/outgoing items (#11144)
This updating the existing metric points that were recently added to use
signal as an attribute instead of separating the metric name. It follows
the suggestions in [otep
259](https://github.com/open-telemetry/oteps/pull/259) for the metric
and attribute names.

Putting this in draft to get some feedback from @djaglowski before
moving forward with this change

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-09-13 13:07:15 -07:00
Bogdan Drutu 8a070097ec
[mdatagen] Avoid public APIs with internal params (#11040)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-09-13 09:37:43 -07:00
Alex Boten 3bcb341c7d
[processorhelper] remove deprecated funcs (#11151)
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-09-12 11:34:42 -07:00
Daniel Jaglowski fa3471825e
Add ingoing and outgoing counts to processorhelper (#10910)
#### Description

Implements ingoing and outgoing counts as described in
https://github.com/open-telemetry/opentelemetry-collector/issues/10708.
2024-09-09 08:19:22 -07:00
Alex Boten 7da6b618a7
[service] deprecate TelemetrySettings.MeterProvider (#10912)
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>
2024-08-29 12:05:54 -07:00
Alex Boten 2d6cb025d0
[mdatagen] mark Meter as deprecated (#10939)
This is split from
https://github.com/open-telemetry/opentelemetry-collector/pull/10912

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-08-21 09:59:16 -07:00
Alex Boten 070e85522e
[mdatagen] add LeveledMeter method (#10933)
This will use the LeveledMeterProvider in TelemetrySettings.
    
Split from
https://github.com/open-telemetry/opentelemetry-collector/pull/10912,
follows #10931

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-08-21 08:05:13 -07:00
Alex Boten ef07ea0735
[mdatagen] move ScopeName to generated_status (#10848)
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>
2024-08-09 12:10:11 -07:00
Alex Boten 7638bb2981
[mdatagen] export ScopeName in internal/metadata package (#10845)
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>
2024-08-09 08:12:05 -07:00
Alex Boten 9ef6356835
[processorhelper] update units for metrics (#10647)
This updates units for processhelper's internal telemetry.

Related #10556

Fixes
https://github.com/open-telemetry/opentelemetry-collector/issues/10651

For this PR i updated `metadata.yaml` and ran `make gogenerate`, then
`make -C processor test`

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-07-22 09:55:31 -07:00
Alex Boten 5753a58f71
update all metrics to include otelcol_ prefix (#9759)
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>
2024-07-16 16:18:37 -07:00
Daniel Jaglowski ea7270caba
Add "inserted" metrics to processors (#10372)
#### Link to tracking issue

Resolves #10353

#### Testing

Added equivalent testing to other processor metrics (accepted, refused,
dropped).

#### Documentation

Metric documentation is autogenerated.

#### Open Question

My initial implementation includes a breaking change to
`componenttest.TestTelemetry` which is public facing API. If we want to
avoid an immediate breaking change in this test package, I would propose
the following, which I can submit in a prerequisite PR:
1. Deprecate all `TestTelemetry.Check*` methods.
2. Replace with more granular `TestTelemetry.CheckOneSpecificMetric`
methods.
2024-06-19 12:15:42 +02:00
Alex Boten 7b0c38e609
[mdatagen] make meter a struct member of telemetryBuilder (#10314)
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>
2024-06-04 14:54:41 -07:00
Alex Boten 52a9520fdb
mdatagen: support setting telemetry level in telemetry builder (#10234)
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>
2024-05-28 08:59:50 -07:00
Alex Boten 28242fab81
[mdatagen] add support for async instruments (#10159)
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>
2024-05-16 13:15:27 -07:00
Alex Boten 4458b43439
[chore] use mdatagen for processorhelper (#10122)
This updates the processor helper to use mdatagen for its internal
telemetry.

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-05-09 07:03:07 -07:00