Skip to content

Conversation

@quentinmit
Copy link
Member

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).

}

// Overrides metrics.processors.
original.Metrics.Processors = map[string]*MetricsProcessor{}
Copy link
Contributor

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)?

Copy link
Member Author

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).

Copy link
Contributor

@igorpeshansky igorpeshansky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :shipit:

default_pipeline:
receivers: []
exporters: []
processors:
Copy link
Contributor

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: []

Copy link
Contributor

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)?

Copy link
Member Author

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.

Copy link
Contributor

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)?

Copy link
Contributor

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: []

Copy link
Contributor

@qingling128 qingling128 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@qingling128 qingling128 merged commit 48a6d6e into master Jun 30, 2021
@qingling128 qingling128 deleted the quentin-default-metrics branch June 30, 2021 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants