Commit Graph

25 Commits

Author SHA1 Message Date
Bogdan Drutu 9b5208a53a
[chore] Remove dead code from mdatagen. (#12336)
Missed by
https://github.com/open-telemetry/opentelemetry-collector/pull/12304,
this variables can no longer be initialized so this becomes dead code.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-02-10 20:29:26 +00:00
Alex Boten 7d603aa46b
Remove deprecated funcs (#12304)
Removing all v0.119.0 deprecated funcs.

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2025-02-06 03:57:26 +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 f9e73e209c
[chore] fix small indentation issue with metrics builder in mdatagen (#11300)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-09-30 11:39:58 -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 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
Curtis Robert 3f4f0d082d
[batchprocessor] Update metric units (#10658)
#### Description
`1` isn't an informative metric unit. I've made a best-guess attempt at
updating metric units, f**eedback is very necessary here**, the units
are not very clear here. I attempted to match the unit with metric
descriptions.

[Semantic conventions for
reference](https://opentelemetry.io/docs/specs/semconv/general/metrics/).

#### Link to tracking issue
Fixes
https://github.com/open-telemetry/opentelemetry-collector/issues/10652
2024-08-13 10:50:27 -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 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
Dmitrii Anoshin 4d57f5e0b8
[mdatagen] Remove WithAttributes from the telemetry builder constructor (#10608)
Attribute sets for async instruments now can be set as options to
callback setters and async instruments initializers. This allows each
async instrument to have its own attribute set.

Unblocks
https://github.com/open-telemetry/opentelemetry-collector/pull/10593
2024-07-16 10:36:35 -07:00
Dmitrii Anoshin d545fb6a10
[exporterhelper] Fix incorrect deduplication of exporter queue metrics (#10550)
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.
2024-07-08 08:23:16 -07: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 567a175ed9
[batchprocessor] ensure attributes are set on metadata metric (#10245)
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>
2024-05-29 09:10:01 -07:00
Alex Boten 1d8c53ff0f
[batchprocessor] use mdatagen for async metric (#10233)
Follows
https://github.com/open-telemetry/opentelemetry-collector/pull/10232,
use mdatagen for async counter

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-05-28 11:15:55 -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 d73235fc91
[mdatagen] use mdatagen to produce component internal telemetry (#10054)
#### 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>
2024-05-06 14:01:35 -07:00
Alex Boten ce09d9773a
[mdatagen] move telemetry into its own file (#10037)
This is in preparation for using mdatagen for component telemetry.

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-04-29 12:11:55 -07:00