Move exporter config loading out of agent #130
Merged
+414
−282
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.
This is the second round of refactoring to make it a bit easier to incorporate multiple exporter support. With this PR we decouple the parsing, loading and verification of exporter configuration from the main agent startup. The agent gets back a typed structure with the exporter configuration per each pipeline type: metrics, logs and traces. It then matches on each pipeline and finishes the startup of the configured exporter. This will allow us to return different exporter configs per-pipeline in the future, decoupling the agent code from handling it.
Ideally the core agent code wouldn't need to know about each exporter type, which telemetry types they support, and how to start its exporter. In a perfect world the configs for each exporter type would support a
into_exporter()
method that transformed the config into a running exporter. However, we aren't at that level just yet and it requires some further work. We may take that up after multiple exporters are in place.Completes: STR-3470