influxdata / influxdb

Scalable datastore for metrics, events, and real-time analytics
https://influxdata.com
Apache License 2.0
28.63k stars 3.54k forks source link

Add ability to Merge/Stack Telegraf configurations in UI #18924

Open samhld opened 4 years ago

samhld commented 4 years ago

Use case

Installing multiple templates from which each Telegraf configuration is needed in the same data source.

Example:

User has a K8s-centric infrastructure. They want to run Telegraf as a daemonset and want to use Templates to get started. They use Redis, Nginx, HAproxy, Kafka, MySQL, etc., and want to take advantage of the templated Telegraf configurations that exist for each of these services.

Problem:

Complete Telegraf configurations are in each Template. User's ability to combine these configurations is hindered.

Their options become:

Separate problem (addressed in proposed solution):

The most part of authoring a template is including even one Telegraf configuration. It requires manually entering boilerplate YAML and pasting your TOML into that section. From there, the author must make sure all lines are properly indented. I think it's safe to this isn't the experience we want for users of any piece of InfluxData software.

Proposal

Editable configurations in UI. Ultimately, the envisioned UX of this to have some kind of UI for moving configuration blocks between configuration files. This would mean the UI understands the components of the config files and exposes them as objects that can be moved, copied, picked from a dropdown or checked/selected in a list, etc.

The idea here is to benefit both the Template author and consumer personas. If the Template author can create and edit configuration in the UI, they can export (generate this portion of the template) right from their workspace.

Some possible additions to this (needs more discussion and validation)

Workflow change for author:

Workflow change for consumer:

Alternatives proposed

  1. Telegraf would support intelligently merging configurations based on diffs. There is an assumption that the Agent configuration blocks are
    • Deemed out of scope
  2. Telegraf would support running with multiple remote configurations (like telegraf.d/ but for centrally hosted configs in, say Influx2)
    • Could have added a flag like --config-url to pull multiple configs.
    • This does not fully eliminate challenges with config overlap, conflicts, etc.
wd3mo commented 3 years ago

I would love to see this happening. The most important thing in my opinion is that the configurations must be editable from the UI.

wd3mo commented 3 years ago

In the meantime I found out that it is possible to create/update telegraf configurations via CLI.

samhld commented 3 years ago

@wd3mo good news is I believe you can now edit and save the config in the Cloud UI. I'll have to check OSS but you can try it out with a free Cloud account.

sjwang90 commented 3 years ago

@wd3mo Check this portion of the video of editing the Telegraf config that's already in the UI https://youtu.be/f7ws9pfLmJc?t=96