Commit Graph

22 Commits

Author SHA1 Message Date
Bogdan Drutu d9b97ffb43
[metadatatest] Generate NewSettings that accepts componenttest.Telemetry (#12216)
This is the last functionality needed to replace
`metadatatest.Telemetry` with `componenttest.Telemetry`.

The `metadatatest.Telemetry` will be deprecated next release to give
time to change contrib since it is a large change.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2025-01-30 21:42:20 +00:00
Chao Weng 356e5a6e26
[chore] Replace AssertMetrics with AssertEqualMetric series functions (#12184)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
A follow-up PR of #12179 , cc @bogdandrutu 

Note: This PR also removes those metric assertions which is actually
testing metrics that doesn't belong to the package. They might be added
due to the limitation of the AssertMetrics function. e.g. changes in
`processor/memorylimitprocessor/memorylimiter_test.go`

<!-- Issue number if applicable -->
#### Link to tracking issue
Relevant to #12179 

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Updated

<!--Describe the documentation added.-->
#### Documentation
n/a

<!--Please delete paragraphs that you did not use before submitting.-->
2025-01-26 23:00:59 +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 63c7fece02
Re-deprecate LeveledMeterProvider, wrong usage of colons (#11697)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-11-19 08:45:40 -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
Matthieu MOREL 6925a306fa
[chore]: enable len and empty rules from testifylint (#11021)
#### Description

Testifylint is a linter that provides best practices with the use of
testify.

This PR enables
[len](https://github.com/Antonboom/testifylint?tab=readme-ov-file#len)
and
[empty](https://github.com/Antonboom/testifylint?tab=readme-ov-file#empty)
rules from [testifylint](https://github.com/Antonboom/testifylint)

It also adds testifylint as tool to use with a make command

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-09-09 09:57:58 -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 3c1cf33f8c
[component] add LeveledMeterProvider (#10931)
This func will MeterProvider and MetricsLevel in the near future. Split
from
https://github.com/open-telemetry/opentelemetry-collector/pull/10912

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-08-20 13:57:12 -07:00
Tyler Helmuth fb5b1e6aa5
[service] Remove servicetelemetry.TelemetrySettings (#10728)
#### Description
Reorganizes service to not require `servicetelemetry.TelemetrySettings`
and instead depend directly on `component.TelemetrySettings`

Whether or not we move forward with
https://github.com/open-telemetry/opentelemetry-collector/pull/10725 I
think this is a useful change for service.

#### Testing
Unit tests
2024-07-29 10:29:05 +02:00
Tyler Helmuth 4e44e32280
[service] Remove getBallastSize from service (#10696)
#### Description

This PR removes all ballast logic from service. This effectively
deprecates the ballastextension as including the extension with this
service would do nothing.

Related to
https://github.com/open-telemetry/opentelemetry-collector/pull/10671

#### Link to tracking issue
Closes
https://github.com/open-telemetry/opentelemetry-collector/issues/8342

#### Testing
Unit tests.
2024-07-23 14:59:53 -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
Alex Boten a2289fd910
[service] use mdatagen for service metrics (#10273)
This reverts the reverts
https://github.com/open-telemetry/opentelemetry-collector/pull/10271 and
adds a mechanism to skip adding a create settings method for the service
package component test. Will need to figure out if
servicetelemetry.TelemetrySettings should be renamed to fit w/ the other
CreateSettings structs before removing this check.

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-06-10 09:04:29 -07:00
Alex Boten 1749a8f19d
Revert "[chore] use mdatagen to generate service metrics (#10160)" (#10271)
This reverts commit 10bcef33e6.
2024-05-30 11:45:17 -07:00
Alex Boten 10bcef33e6
[chore] use mdatagen to generate service metrics (#10160)
This PR follows
https://github.com/open-telemetry/opentelemetry-collector/pull/10159 and
uses the new mdatagen functionality to generate async metrics in the
service.

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-05-30 09:40:47 -07:00
Alex Boten 9c7177496f
[chore] remove unused opencensus code (#9108)
Follows
https://github.com/open-telemetry/opentelemetry-collector/pull/9102

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2024-01-30 10:19:42 -08:00
Alex Boten 834413537b
[telemetry] mark useOtelForInternalMetrics stable (#9102)
This marks the flag as stable. Leaving this as a draft until v0.92.0 is
released.

Closes https://github.com/open-telemetry/opentelemetry-collector/issues/8962
Fixes https://github.com/open-telemetry/opentelemetry-collector/issues/816

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2024-01-16 15:38:21 -08:00
Alex Boten 7f56849c0d
[service] remove _total suffix for otel generated metrics (#8965)
This ensures backwards compatibility with the metrics generated via
opencensus by default today.

Part of #7454

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-11-21 11:20:48 +01:00
Alex Boten 80d704deb4
[chore] use license shortform (#7694)
* [chore] use license shortform

To remain consistent w/ contrib repo, see https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/22052

Signed-off-by: Alex Boten <aboten@lightstep.com>

* make goporto

Signed-off-by: Alex Boten <aboten@lightstep.com>

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-05-18 13:11:17 -07:00
Alex Boten 5a7b14153a
[chore] update otel-go dep (#7588)
Updating required APIs along the way.

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-05-02 09:47:52 -07:00
my-git9 fc882832a9
Use http constants to replace numbers as parameters (#7216)
Signed-off-by: xin.li <xin.li@daocloud.io>
2023-02-20 09:38:36 -08:00
Moh Osman 297e3912d5
Instrument proctelemetry.ProcessMetrics (#6886)
* Instrument proctelemetry.ProcessMetrics (#67)

* Instrument proctelemetry.ProcessMetrics

* add chloggen

* fix lint and remove unneeded context

* catch potential case where some metricValues are 0

* address review feedback

* rebase and remove unneeded registry

* only run assertMetrics for OC

* address review comments

* rebase and update featuregate function in use

* rebase and update to use new otel metrics api

* fix lint err

* address feedback

* newline

* use multierr for errors
2023-02-02 09:13:33 -08:00
Bogdan Drutu dfb21cf3f1
Start moving telemetry initialization to service/telemetry (#6275)
Signed-off-by: Bogdan <bogdandrutu@gmail.com>

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
2022-10-13 10:10:55 -07:00