Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider separating configuration files #25

Open
james-bebbington opened this issue Oct 2, 2020 · 0 comments
Open

Consider separating configuration files #25

james-bebbington opened this issue Oct 2, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@james-bebbington
Copy link
Contributor

james-bebbington commented Oct 2, 2020

Viper, the library used to load configuration in the Collector, supports loading from and merging multiple config files. Note the following caveats:

  • Arrays are overwritten instead of being merged
  • There is no mechanism to "include" config files from within another config file

We could change the startup code to load all *.yaml files in the same directory as the executable (or based on some provided regex flag) and change the configuration to be logically separated, e.g.:

<config.yaml>

# shared components listed here
processors:
  resourcedetection:
    ...
<config_agent.yaml>

pipelines:
  metrics/agent:
    receivers: [ prometheus/agent ]
    processors: [ metricstransform/agent, resourcedetection ]
    exporters: [ ... ]

receivers:
  prometheus/agent:
    # scrape self reported agent metrics

processors:
  metricstransform/agent:
    ...
<config_iis.yaml>

pipelines:
  metrics/iis:
    receivers: [ windowsperfcounters/iis ]
    processors: [ metricstransform/iis, resourcedetection ]
    exporters: [ ... ]

receivers:
  windowsperfcounters/iis:
    ...

processors:
  metricstransform/iis:
    ...
<config_sqlserver.yaml>

pipelines:
  metrics/sqlserver:
    receivers: [ windowsperfcounters/sqlserver ]
    processors: [ metricstransform/sqlserver, resourcedetection ]
    exporters: [ ... ]

receivers:
  windowsperfcounters/sqlserver:
    ...

processors:
  metricstransform/sqlserver:
    ...

In addition, it would be useful to support a way of loading constants into environment variables so that values don't need to be repeated across config files, e.g.:

<config_env.yaml>
CUSTOM_METRIC_PREFIX: custom.googleapis.com/
<config_*.yaml>

exporters:
  stackdriver/application1:
    metric:
      prefix: $CUSTOM_METRIC_PREFIX

  stackdriver/application2:
    metric:
      prefix: $CUSTOM_METRIC_PREFIX
@james-bebbington james-bebbington changed the title Consider separating environment variables Consider separating configuration files Oct 2, 2020
@jsuereth jsuereth added the enhancement New feature or request label Mar 22, 2021
JonathanWamsley pushed a commit to observIQ/opentelemetry-operations-collector that referenced this issue Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants