-
Notifications
You must be signed in to change notification settings - Fork 77
Add empty metrics_filter by default #127
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
Conversation
| } | ||
|
|
||
| // Overrides metrics.processors. | ||
| original.Metrics.Processors = map[string]*MetricsProcessor{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also remove line 214 as well? Or is it doing the right thing (i.e., we'd never keep the default logging processors)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have default logging processors (which is why this line was here for metrics too, until we added a default metrics processor).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| default_pipeline: | ||
| receivers: [] | ||
| exporters: [] | ||
| processors: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For disabling the entire metrics side, does it make sense to do this instead? It saves some resource (scraping, filtering and dropping metrics data points take CPU cycles.
metrics:
service:
pipelines:
default_pipeline: []
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not optimize this later (i.e., if we have a filter that drops everything, don't even bother generating the receivers on the otel side)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe that will work (since default_pipeline isn't a list), but also, this is optimization. We can always do that later without changing the syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does
metrics:
service:
pipelines:
default_pipeline:
receivers: []
exporters: []
still work if the agent for some reason has an IIS bug on the scraper side that caused it to crash? (We can avoid advertising too much for it, but leaving the option on the table for support case mitigation)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed that works:
lingshi@lingshi:~/repo/ops-agent/confgenerator/testdata/valid/linux/metrics-no_conf$ cat input.yaml
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
metrics:
service:
pipelines:
default_pipeline:
receivers: []
exporters: []
lingshi@lingshi:~/repo/ops-agent/confgenerator/testdata/valid/linux/metrics-no_conf$ cat merged-config.yaml
logging:
receivers:
syslog:
type: files
include_paths:
- /var/log/messages
- /var/log/syslog
exporters:
google:
type: google_cloud_logging
service:
pipelines:
default_pipeline:
receivers:
- syslog
exporters:
- google
metrics:
receivers:
hostmetrics:
type: hostmetrics
collection_interval: 60s
processors:
metrics_filter:
type: exclude_metrics
metrics_pattern: []
exporters:
google:
type: google_cloud_monitoring
service:
pipelines:
default_pipeline:
receivers: []
processors: []
exporters: []
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This allows user configs to never need a pipelines section.
No changes to config validation, so users can still specify a pipeline if they choose to (but there is no longer any reason they would ever have a need to do that, with today's config options).