From e0071f365acbd9471a50b4d01a0c33428dc0da07 Mon Sep 17 00:00:00 2001
From: Piotr Popieluch <piotr1212@gmail.com>
Date: Thu, 31 May 2018 20:56:49 +0200
Subject: [PATCH] Print the enabled aggregator and processor plugins on startup
 (#4212)

---
 cmd/telegraf/telegraf.go  |  4 +++-
 internal/config/config.go | 18 ++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/cmd/telegraf/telegraf.go b/cmd/telegraf/telegraf.go
index 2e6ee3fe..e3ab1102 100644
--- a/cmd/telegraf/telegraf.go
+++ b/cmd/telegraf/telegraf.go
@@ -166,8 +166,10 @@ func reloadLoop(
 		}()
 
 		log.Printf("I! Starting Telegraf %s\n", displayVersion())
-		log.Printf("I! Loaded outputs: %s", strings.Join(c.OutputNames(), " "))
 		log.Printf("I! Loaded inputs: %s", strings.Join(c.InputNames(), " "))
+		log.Printf("I! Loaded aggregators: %s", strings.Join(c.AggregatorNames(), " "))
+		log.Printf("I! Loaded processors: %s", strings.Join(c.ProcessorNames(), " "))
+		log.Printf("I! Loaded outputs: %s", strings.Join(c.OutputNames(), " "))
 		log.Printf("I! Tags enabled: %s", c.ListTags())
 
 		if *fPidfile != "" {
diff --git a/internal/config/config.go b/internal/config/config.go
index e7a008f4..8a31c271 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -156,6 +156,24 @@ func (c *Config) InputNames() []string {
 	return name
 }
 
+// Outputs returns a list of strings of the configured aggregators.
+func (c *Config) AggregatorNames() []string {
+	var name []string
+	for _, aggregator := range c.Aggregators {
+		name = append(name, aggregator.Name())
+	}
+	return name
+}
+
+// Outputs returns a list of strings of the configured processors.
+func (c *Config) ProcessorNames() []string {
+	var name []string
+	for _, processor := range c.Processors {
+		name = append(name, processor.Name)
+	}
+	return name
+}
+
 // Outputs returns a list of strings of the configured outputs.
 func (c *Config) OutputNames() []string {
 	var name []string
-- 
GitLab