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

[cmd/builder] Allow configuring confmap converters and providers

Open evan-bradley opened this issue 1 year ago • 1 comments
trafficstars

Description:

Allow configuring confmap converters and providers in the builder's config. If either config field isn't set, the default set of converters/providers is used.

Currently builds upon https://github.com/open-telemetry/opentelemetry-collector/pull/9228 and https://github.com/open-telemetry/opentelemetry-collector/pull/9461, but I'll remove those commits from this PR once they are merged.

Link to tracking Issue:

Resolves https://github.com/open-telemetry/opentelemetry-collector/issues/4759.

Testing:

Extended unit tests.

Documentation:

Will update the docs once the PR is ready.

cc @mx-psi

evan-bradley avatar Feb 07 '24 12:02 evan-bradley

Codecov Report

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

Project coverage is 91.63%. Comparing base (7b046d9) to head (6ef69ce).

Files Patch % Lines
cmd/builder/internal/builder/config.go 75.75% 4 Missing and 4 partials :warning:
cmd/otelcorecol/main.go 0.00% 4 Missing :warning:
cmd/builder/internal/command.go 50.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9513      +/-   ##
==========================================
- Coverage   91.65%   91.63%   -0.03%     
==========================================
  Files         360      360              
  Lines       16639    16676      +37     
==========================================
+ Hits        15251    15281      +30     
- Misses       1053     1058       +5     
- Partials      335      337       +2     

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

codecov[bot] avatar Feb 07 '24 12:02 codecov[bot]

Both dependencies have been merged, is this ready for review?

mx-psi avatar Mar 01 '24 10:03 mx-psi

@mx-psi I think this is ready to go, please take a look.

evan-bradley avatar Mar 04 '24 03:03 evan-bradley

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

github-actions[bot] avatar Apr 02 '24 03:04 github-actions[bot]

Will wait for #9516 before giving another pass to this one

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

Will wait for https://github.com/open-telemetry/opentelemetry-collector/pull/9516 before giving another pass to this one

I've also been waiting for that, I will let you know once I update this PR to include those changes.

evan-bradley avatar Apr 16 '24 12:04 evan-bradley

@mx-psi I've updated this to use confmap factories and to account for https://github.com/open-telemetry/opentelemetry-collector/pull/9897.

I've updated this to not use the new APIs if the builder is working with versions before v0.99.0. It looks like the new strict versioning functionality will force the builder and core API versions to be equal, according to this line. Should we expect that when the flag to skip strict versioning is removed we can also remove the v0.99.0 version check?

evan-bradley avatar Apr 19 '24 01:04 evan-bradley

@evan-bradley I did not intend for that change to go through just yet, and this is also not documented, so I filed #9999 to document it. We can handle this separately.

IMO we should be a bit more lenient and allow for some version skew between the builder and the Collector being built (at least one minor version of difference should be fine based on our deprecation guidelines, and would be in line with the Kubernetes version skew policy)

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

Thanks for the clarification. I agree we should probably allow some minor skew even if it's a bit inconvenient, it would feel pretty demanding to have to update the builder every single release.

I think this PR should be unaffected by that change and should still be ready to go.

evan-bradley avatar Apr 19 '24 12:04 evan-bradley