Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a glob config provider and use it in the build. See #708 for the rationale and semantics.
This PR is likely easier to review commit-by-commit, as they're almost completely independent. I'm submitting it as a single PR because I think it's easier to understand with the added context, but if this turns out to hurt more than it helps, I can resubmit separately.
The glob provider is added as a separate package and should be relatively self-explanatory.
The process of adding it to the build is a bit convoluted. We can pass a
CollectorSettings
struct with a customConfigProvider
to add our glob provider. However, creating thisConfigProvider
requires knowing the config locations, and we need to parse command-line flags. If we could hook into the existing Cobra command, this could be much easier, but as is, we use a workaround to parse what we need.We unfortunately also need to modify the output of otelcolbuilder, which is done in the Makefile by patching
main.go
and adding an additional replace clause togo.mod
.