-
Notifications
You must be signed in to change notification settings - Fork 519
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
Replace default config with config presets #158
Comments
@dmitryax the charts now support removing the default config using null. User are able to remove all default configuration and replace it with their own. Does that meet the needs of this issue? |
Yes, I think we still need to move to the presets as a cleaner way than setting nulls. We already have a preset for logs collection, I think we need to apply similar approach to other use cases. Some presets can require rendering of other resources not configmap only, e.g. |
Like using the presets to determine if we need to render extra permissions or something?
What do you mean by this? Finally, if a customer enabled host metrics (or something else also preset) but also defined that component in their config then which wins? I would say their version of the hostMetrics config be what renders in the configmap. |
Yes, e.g. hostMetrics requires host volume mounts
Collector can accept many config files https://github.com/open-telemetry/opentelemetry-collector/blob/150c1ede2f7fb5607035d3c7a10bfcab61c39afe/service/flags.go#L47-L48. I think we should supply each preset as another configuration file and let collector do the merging instead of using helm capabilities. Let me know if it makes sense to you
I believe what user provides in |
To avoid breaking changes I think we'll need a presets for each item in the current default config or presets that encompasses them. |
Today I learned. This is an interesting idea. It will certainly reduce logic in the helm chart, but I am initially concerned that by having the collector do the merge the final configuration the collector is truest running is more obscure. Is it well defined how the collector handles multiple configs if those configs conflict? |
Right, ideally the set of presets enabled by default should end up in an equivalent config that we have by default now |
I believe it must be done in a predictable way, same way as helm is doing it (not 100% sure tho):
All the presets should get their order in the command line in a way that combinations of them works well with each other. |
I'll take a look at this today, but I am not totally convinced yet about the multiple configs. Concerns I'd like to address:
|
Maintaining support for agentCollector and standaloneCollector with this change is going to be pretty messy. Should we submit a PR to remove that support before handling this change? |
Won't this mean that if someone uses any presets, but also adds their own configuration, they will have to list preset components in their pipeline section? presets:
traces:
enabled: true
config:
receivers:
some-extra-receiver:
service:
pipelines:
traces:
receivers: [some-extra-receiver, otlp, zipkin, jaeger]
I don't love having to list receivers that aren't defined in the config section. |
After spending a lot of the day on this here is where I am at: I not a huge fan of defining the config in multiple places, mainly because I think the final configuration gets obscured, but also because lists are replaced and not merged. We have to deal with that today too, but at least in those situations the user is able to look in the value.yaml and see the exact config that will get merged and the components they need to include in their custom list. Right now I would vote for keeping the config the way it is today, but I'd like to hear more arguments in favor of presets. I really like the idea of presets.metrics.hostMetrics.enabled. The idea of the charts handling all the k8s stuff necessary to use the hostMetrics receiver is very appealing, and there are other components that could benefit from this (k8sattributesprocessor comes to mind). What do you think about an option like |
Thinking more about containerLogs as an example, the main benefit of that field is the ability to build out the complex receiver and setup the k8s stuff. The fact that it also sets up service.logs.receiver is a "nice-to-have", but will have to get overwritten. In fact, our daemonset-collector-logs example is actually wrong right now because it doesn't update the logs pipeline's receivers. I'm gonna take a look at this with the perspective of only defining the components and not the pipeline. This will also make it easier to determine when to include receivers used between multiple pipelines, such as otlp. |
I'm starting to ramble, but here is another consideration: # components enabled by default will be included in the appropriate pipelines(s) by default.
# If any presets are enabled or disable, or if a component is configured via the 'config' field, then the appropriate
# component list needs to be configured in the `config` field to include all desired components
presets:
extensions:
health_check:
enabled: true
memory_ballast:
enabled: true
receivers:
otlp:
enabled: true
jaeger:
enabled: true
zipkin:
enabled: true
prometheus:
enabled: true
selfScraping: true
hostMetrics:
enabled: false
filelog:
enabled: false
processors:
batch:
enabled: true
memory_limiter:
enabled: true
exporters:
logging:
enabled: true
config: {} I'm not convinced this is better than our current config, but I like that in the scenario that you need to manually defined the component list you can see each component to include. |
Reflected on this issue over the last week, I retract my concerns over using presets; we definitely should be using presets. For the format of how to do presets, I think I like the "by component" version, as it makes it most clear with component(s) need to be added to pipeline(s) when custom configuration is introduced or disabled-by-default presets are enabled. |
I think the per-component presets makes it too granular and confusing. It moves presets idea the the field that should be controlled by custom configuration :) I believe presets must be per-story. The highest level presets should control pipelines. Each pipeline-preset can have sub-presets for particular features: e.g |
As discussed in the triage session, presets shouldn't end up as different configuration arguments, helm templating should be used to compose one configMap from presets and default config. Also we decided to wait until backward support of |
I agree that this approach takes advantage of the concept of a preset the most. But I am concerned about the usability of it combined with any custom configuration. If a user enabled the metrics preset (which would include otlp, and prometheus) and also configured something like the We need to have some indication of what components each preset configures. We may be able to get away with comments in the values.yaml honestly. |
Potentially we could consider applying upsert list merge for the lists created by presets. It can work well for service->pipelines lists, but it might be confusing behavior for the configuration lists where override is expected. |
I thought helm had no way to merge lists. If we wanted to upsert wouldn't we have to switch from arrays to maps? If it can merge lists, I think that would solve all my concerns around the service.pipelines.
Not sure what you mean by this. |
It's not possible by direct merge operation, but there are other operators e.g. concat + unique http://masterminds.github.io/sprig/lists.html |
There are probably some parts of the otel configuration where upsert operation on list would be not expected. E.g. if user wants to reduce list of detectors set by a preset: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourcedetectionprocessor |
I'm still not 100% sure what should we do for lists. Overriding seems like a clean way but maybe not easy to use in case of presets + default config. |
I think we're gonna have to override and make sure users know how to do it properly. |
Tracked in Issue #199 |
|
@dmitryax just ran into an interesting situation. The deployment-otlp-traces example is a scenario demonstrating how you can remove default config using With presets, though, we can no longer take advantage of that feature. As a result, any user who has a values.yaml like mode: deployment
ports:
jaeger-compact:
enabled: false
jaeger-thrift:
enabled: false
jaeger-grpc:
enabled: false
zipkin:
enabled: false
config:
receivers:
jaeger: null
prometheus: null
zipkin: null
service:
pipelines:
traces:
receivers:
- otlp
metrics: null
logs: null ends up with a configmap like this once their exporters:
logging: {}
extensions:
health_check: {}
memory_ballast: {}
processors:
batch: {}
memory_limiter:
check_interval: 5s
limit_mib: 1638
spike_limit_mib: 512
receivers:
jaeger: null
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
prometheus: null
zipkin: null
service:
extensions:
- health_check
- memory_ballast
pipelines:
logs: null
metrics: null
traces:
exporters:
- logging
processors:
- memory_limiter
- batch
receivers:
- otlp
telemetry:
metrics:
address: 0.0.0.0:8888 I did some experimenting with removing null values from the dictionary but it felt kinda hacky and it wouldn't scale well to being able to remove any preset field. What are your thoughts? |
@dmitryax we could solve this issue by not trying to merge |
I like this idea. We can provide two configuration options:
We can deprecate |
@dmitryax I think to be backwards compatible we'll have to keep the existing Following the same strategy as agentCollector/standaloneColletor and mode, we'll remove config in a future release and enable the presets by default. |
Sound like a good plan. |
@dmitryax the only downside to this plan is that users will lose the convenience of the presets pretty quickly. For example, if a user wants to use the The value of the presets is it knows how to take care of all the extra k8s stuff for you, I'm worried that by not being able to customize the presets at all that most users won't be able to take advantage of all the extra stuff they do because they'll be using Should we allow enabling presets and then also supplying |
Ok, can we keep presets and presets:
traces:
enabled: true
zipkin:
enabled: true
jaeger:
enabled: true |
Actually, we don't even need to disable receivers with config:
service:
pipelines:
traces: [otlp] # to disable all other tracing receivers |
Thats true, but from experience being an end user of the collector we didn't like deploying with configuration that wasn't used. Best to keep the configmap as clean as possible. |
Yes I think this is a valid solution. It will allow disabling some presets while using others. Will make it easier to merge in |
Based on our discussion, we are going to try pivoting the presets idea to be for components that require extra k8s settings, such as filelog, hostmetrics, or k8sattributes, instead of presets for the default config. This will allow us to have a fully customizable default config, and allow for the charts to helm with more complex components. |
Even doing only presets for components that need extra k8s config was troublesome due to the fact that helm can't merge lists. @dmitryax I linked 2 draft PRs with different options (both pretty messy still).
|
I like the second option with a proposal on how to apply list merges |
Instead of providing default configuration, we should have presets of configurations that are applied to the collector. Suggested presets configuration:
User also must be able to provide their own config that must be applied after all the presets.
Each of the enabled presets and user custom config can be provided to the collector as a configuration argument, no need to merge them in the helm chart.
The text was updated successfully, but these errors were encountered: