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

Cherry-pick #18124 to 7.x: Enable introspecting configuration #18186

Closed
wants to merge 1 commit into from

Conversation

michalpristas
Copy link
Contributor

Cherry-pick of PR #18124 to 7.x branch. Original message:

What does this PR do?

This PR adds 3 options to our agents CLI

Option 1 - Introspecting current config

Usage ./elastic-agent inspect
This will print out current configuration either from fleet or from yml.
Sample output:

datasources:
- inputs:
  - streams:
    - dataset: system.cpu
      metricset: cpu
    - dataset: system.memory
      metricset: memory
    - dataset: system.network
      metricset: network
    - dataset: system.filesystem
      metricset: filesystem
    type: system/metrics
  namespace: default
  use_output: default
download:
  install_path: /Users/michalpristas/agent/data/install
  pgpfile: /Users/michalpristas/agent/data/elastic.pgp
  sourceURI: https://artifacts.elastic.co/downloads/beats/
  target_directory: /Users/michalpristas/agent/data/downloads
  timeout: 30s
...

Option 2 - Introspecting used outputs

Usage ./elastic-agent inspect output
This will print out outputs which are actually used . If config contains definition for output but output is not used in any datastream it will not be present in the printout
Sample output:

default
monitoring

Option 3: Introspecting specific output

Usage: ./elastic-agent inspect output -o default
This will print out actual configuration of the beats, this helps you understand how configuration retrieved from fleet translates to configuration which is sent out to the process itself.
Sample output:

[default] metricbeat:
metricbeat:
  modules:
  - index: metrics-system.filesystem-default
    metricsets:
    - filesystem
    module: system
    processors:
    - add_fields:
        fields:
          dataset: system.filesystem
          namespace: default
          type: metrics
        target: stream
output:
  elasticsearch:
    hosts:
    - 127.0.0.1:9200
    password: changeme
    username: elastic

Why is it important?

To improve debugging experience

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

* introspection

* changelog

* mage fmt

* introspect -> inspect

* follow -c argument

* conflicts
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ingest-management (Project:fleet)

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport enhancement Ingest Management:alpha1 Group issues for ingest management alpha1 needs_team Indicates that the issue/PR needs a Team:* label review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants