opentelemetry-collector icon indicating copy to clipboard operation
opentelemetry-collector copied to clipboard

[service/telemetry] Switch to a factory pattern

Open mx-psi opened this issue 4 months ago • 2 comments

Description

Switches service/telemetry to a factory pattern. To avoid adding a lot of public API in one go:

  1. the actual factory builder is in an internal package
  2. I have not added the CreateMeterProvider method yet

There are two goals with this: one is to make progress on #4970, the other is to allow initializing telemetry sooner:

Link to tracking issue

Updates #4970.

Testing

Updates existing tests to use NewFactory

mx-psi avatar Apr 19 '24 12:04 mx-psi

Codecov Report

Attention: Patch coverage is 62.77372% with 51 lines in your changes are missing coverage. Please review.

Project coverage is 91.30%. Comparing base (1d64ec4) to head (6bd178a).

:exclamation: Current head 6bd178a differs from pull request most recent head 01d4ff1. Consider uploading reports for the commit 01d4ff1 to get more accurate results

Files Patch % Lines
service/telemetry/factory.go 31.25% 22 Missing :warning:
service/telemetry/tracer.go 58.62% 9 Missing and 3 partials :warning:
service/telemetry/internal/factory.go 74.07% 5 Missing and 2 partials :warning:
service/telemetry/telemetry.go 0.00% 6 Missing :warning:
service/service.go 63.63% 2 Missing and 2 partials :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10001      +/-   ##
==========================================
- Coverage   91.65%   91.30%   -0.35%     
==========================================
  Files         356      364       +8     
  Lines       16843    16745      -98     
==========================================
- Hits        15437    15289     -148     
- Misses       1063     1117      +54     
+ Partials      343      339       -4     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 19 '24 12:04 codecov[bot]

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar May 15 '24 03:05 github-actions[bot]

I believe all remaining discussions are things I can solve while I continue working on #4970, so I will merge this right after we release v0.101.0

mx-psi avatar May 17 '24 20:05 mx-psi