-
Couldn't load subscription status.
- Fork 5.7k
feat(selfstat): Implement collection of plugin-internal statistics for all types #17749
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ package models | |
| import ( | ||
| "errors" | ||
| "fmt" | ||
| "maps" | ||
| "time" | ||
|
|
||
| "github.com/influxdata/telegraf" | ||
|
|
@@ -45,6 +46,8 @@ func NewRunningInput(input telegraf.Input, config *InputConfig) *RunningInput { | |
| tags["alias"] = config.Alias | ||
| } | ||
|
|
||
| maps.Copy(tags, config.Tags) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we should do this! The target is to have the same tags as the model-level statistics... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The model level ones will also get this. Having these tags was the first thing I think of when seeing the spec, so that input plugin stats now also could have the tags defined on the plugin. Before there was no way to get this. Maybe that should also go into an opt-in configuration parameter? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think the currently collected statistics will have these tags added right now. You are changing the statistics (and only for the inputs) and I don't want to open that box! Please remove the copy statement! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about a config parameter for this? I would really like to have it, as it will make it possible to have more performant queries to the TSDB when added. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about removing the line from this PR and we discuss the matter in a separate PR? |
||
|
|
||
| inputErrorsRegister := selfstat.Register("gather", "errors", tags) | ||
| logger := logging.New("inputs", config.Name, config.Alias) | ||
| logger.RegisterErrorCallback(func() { | ||
|
|
@@ -55,6 +58,7 @@ func NewRunningInput(input telegraf.Input, config *InputConfig) *RunningInput { | |
| logger.Error(err) | ||
| } | ||
| SetLoggerOnPlugin(input, logger) | ||
| SetStatisticsOnPlugin(input, logger, tags) | ||
|
|
||
| return &RunningInput{ | ||
| Input: input, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.