Skip to content

Conversation

axw
Copy link
Contributor

@axw axw commented Oct 9, 2025

Description

Add a TelemetryFactory telemetry.Factory field to otelcol.Factories. If it is nil, it will default to an otelconftelemetry factory.

This enables overriding telemetry providers.

Link to tracking issue

Fixes #4970

Testing

  • Ran the collector without any telemetry config, verified that logging still works as expected
  • Ran the collector with standard (otelconftelemetry) config, verified it is used as expected (I just smoke tested by enabling debug logging -- more comprehensive unit tests exist)
  • Ran a modified version of the collector with a custom telemetry factory

Documentation

N/A

@axw axw force-pushed the otelcol-telemetryfactory branch from 9206919 to 2ef36a1 Compare October 9, 2025 05:24
Copy link

codecov bot commented Oct 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.69%. Comparing base (1169338) to head (c7ee72a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13950      +/-   ##
==========================================
+ Coverage   91.66%   91.69%   +0.03%     
==========================================
  Files         654      654              
  Lines       42626    42629       +3     
==========================================
+ Hits        39072    39089      +17     
+ Misses       2741     2731      -10     
+ Partials      813      809       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

axw added a commit to axw/opentelemetry-collector that referenced this pull request Oct 9, 2025
Add a component for otelcol, and confighttp. The former is for
open-telemetry#13950,
while the latter is needed to fix .chloggen/13783.yaml.
@axw axw marked this pull request as ready for review October 9, 2025 06:01
@axw axw requested a review from a team as a code owner October 9, 2025 06:01
@axw axw requested a review from dmathieu October 9, 2025 06:01
@axw
Copy link
Contributor Author

axw commented Oct 9, 2025

I need to make another fix to otelcoltest (I've broken datadogconnector tests), moving back to draft.

@axw axw marked this pull request as draft October 9, 2025 07:34
axw added 2 commits October 9, 2025 15:36
Improve the coverage of TestConfigProvider* so it also covers
the default telemetry provider code path.

Tidy the TestConfigProvider* tests:
 - Just use a single confmap provider. They're both fakes, so
   testing one is enough.
 - Rather than comparing unmarshaled config to unmarshaled config,
   which is a bit circuitous, construct the expected config struct
@axw axw marked this pull request as ready for review October 9, 2025 09:48
axw added a commit to axw/opentelemetry-collector that referenced this pull request Oct 9, 2025
Add a component for otelcol, e.g. for
open-telemetry#13950
github-merge-queue bot pushed a commit that referenced this pull request Oct 10, 2025
#### Description

Add a component for otelcol for
#13950

#### Link to tracking issue

None

#### Testing

N/A

#### Documentation

N/A
@axw axw marked this pull request as draft October 13, 2025 05:17
Keep the cmd/builder changes, but retain backwards
compatibility in otelcol and otelcoltest to ease
the transition in contrib.
@axw
Copy link
Contributor Author

axw commented Oct 13, 2025

contrib tests for exporter/alertmanager and exporter/dataset are failing due to unrelated changes in core

@axw axw requested a review from mx-psi October 13, 2025 09:41
@axw axw marked this pull request as ready for review October 13, 2025 09:41
@axw axw requested a review from mx-psi October 15, 2025 23:43
Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will merge after Monday's release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow overriding telemetry providers

2 participants