@@ -15,4 +15,119 @@ This plugin starts a [Prometheus](https://prometheus.io/) Client, it exposes all
1515
1616 # Expiration interval for each metric. 0 == no expiration
1717 expiration_interval = "60s"
18+
19+ # Unregister internal metrics for prometheus client
20+ # If you plan on using this output along with the prometheus input, this may be necessary to prevent metrics conflicts
21+ unregister_metrics = false
22+ ```
23+
24+ ## Example
25+
26+ Telegraf inputs values such as:
27+ ```
28+ > cpu,cpu=cpu0 usage_user=0,usage_iowait=0,usage_irq=0,usage_guest_nice=0,usage_system=0,usage_idle=100,usage_nice=0,usage_softirq=0,usage_steal=0,usage_guest=0 1507833663000000000
29+ ```
30+ will get output in Prometheus exposition format:
31+ ```
32+ # HELP cpu_usage_guest Telegraf collected metric
33+ # TYPE cpu_usage_guest gauge
34+ cpu_usage_guest{cpu="cpu0"} 0
35+ # HELP cpu_usage_guest_nice Telegraf collected metric
36+ # TYPE cpu_usage_guest_nice gauge
37+ cpu_usage_guest_nice{cpu="cpu0"} 0
38+ # HELP cpu_usage_idle Telegraf collected metric
39+ # TYPE cpu_usage_idle gauge
40+ cpu_usage_idle{cpu="cpu0"} 99.79939819439636
41+ # HELP cpu_usage_iowait Telegraf collected metric
42+ # TYPE cpu_usage_iowait gauge
43+ cpu_usage_iowait{cpu="cpu0"} 0
44+ # HELP cpu_usage_irq Telegraf collected metric
45+ # TYPE cpu_usage_irq gauge
46+ cpu_usage_irq{cpu="cpu0"} 0
47+ # HELP cpu_usage_nice Telegraf collected metric
48+ # TYPE cpu_usage_nice gauge
49+ cpu_usage_nice{cpu="cpu0"} 0
50+ # HELP cpu_usage_softirq Telegraf collected metric
51+ # TYPE cpu_usage_softirq gauge
52+ cpu_usage_softirq{cpu="cpu0"} 0
53+ # HELP cpu_usage_steal Telegraf collected metric
54+ # TYPE cpu_usage_steal gauge
55+ cpu_usage_steal{cpu="cpu0"} 0
56+ # HELP cpu_usage_system Telegraf collected metric
57+ # TYPE cpu_usage_system gauge
58+ cpu_usage_system{cpu="cpu0"} 0.10030090270831422
59+ # HELP cpu_usage_user Telegraf collected metric
60+ # TYPE cpu_usage_user gauge
61+ cpu_usage_user{cpu="cpu0"} 0.10030090270831422
1862```
63+ And Telegraf-Prometheus inputs (Prometheus pass through), such as:
64+ (Prometheus)
65+ ```
66+ # HELP my_counter This is a counter
67+ # TYPE my_counter counter
68+ my_counter 100
69+ # HELP my_gauge This is a gauge
70+ # TYPE my_gauge gauge
71+ my_gauge 50
72+ # HELP my_histogram This is a histogram
73+ # TYPE my_histogram histogram
74+ my_histogram_bucket{le="0"} 1
75+ my_histogram_bucket{le="1"} 2
76+ my_histogram_bucket{le="2"} 3
77+ my_histogram_bucket{le="3"} 4
78+ my_histogram_bucket{le="+Inf"} 5
79+ my_histogram_count 5
80+ my_histogram_sum 10
81+ # HELP my_summary This is a summary
82+ # TYPE my_summary summary
83+ my_summary{quantile="0"} 1
84+ my_summary{quantile="0.25"} 2
85+ my_summary{quantile="0.5"} 3
86+ my_summary{quantile="0.75"} 4
87+ my_summary{quantile="1"} 5
88+ my_summary_count 5
89+ my_summary_sum 10
90+ ```
91+ (Telegraf)
92+ ```
93+ > my_counter counter=100 1507833971000000000
94+ > my_gauge gauge=50 1507833971000000000
95+ > my_histogram 1=2,2=3,3=4,+Inf=5,count=5,sum=10,0=1 1507833971000000000
96+ > my_summary 0.75=4,1=5,count=5,sum=10,0=1,0.25=2,0.5=3 1507833971000000000
97+ ```
98+ will be formatted as:
99+ ```
100+ # HELP my_counter Telegraf collected metric
101+ # TYPE my_counter untyped
102+ my_counter 100
103+ # HELP my_gauge Telegraf collected metric
104+ # TYPE my_gauge untyped
105+ my_gauge 50
106+ # HELP my_histogram_bucket Telegraf collected metric
107+ # TYPE my_histogram_bucket untyped
108+ my_histogram_bucket{le="+Inf"} 5
109+ my_histogram_bucket{le="0"} 1
110+ my_histogram_bucket{le="1"} 2
111+ my_histogram_bucket{le="2"} 3
112+ my_histogram_bucket{le="3"} 4
113+ # HELP my_histogram_count Telegraf collected metric
114+ # TYPE my_histogram_count untyped
115+ my_histogram_count 5
116+ # HELP my_histogram_sum Telegraf collected metric
117+ # TYPE my_histogram_sum untyped
118+ my_histogram_sum 10
119+ # HELP my_summary Telegraf collected metric
120+ # TYPE my_summary untyped
121+ my_summary{quantile="0"} 1
122+ my_summary{quantile="0.25"} 2
123+ my_summary{quantile="0.5"} 3
124+ my_summary{quantile="0.75"} 4
125+ my_summary{quantile="1"} 5
126+ # HELP my_summary_count Telegraf collected metric
127+ # TYPE my_summary_count untyped
128+ my_summary_count 5
129+ # HELP my_summary_sum Telegraf collected metric
130+ # TYPE my_summary_sum untyped
131+ my_summary_sum 10
132+ ```
133+
0 commit comments