Skip to content

Commit

Permalink
remove deprecation warning (influxdata#9125)
Browse files Browse the repository at this point in the history
  • Loading branch information
helenosheaa authored Apr 13, 2021
1 parent 842a788 commit 66e12e0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions etc/telegraf.conf
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@
# ## Prometheus format. When using the prometheus input, use the same value in
# ## both plugins to ensure metrics are round-tripped without modification.
# ##
# ## example: metric_version = 1; deprecated in 1.13
# ## example: metric_version = 1;
# ## metric_version = 2; recommended version
# # metric_version = 1
#
Expand Down Expand Up @@ -7577,7 +7577,7 @@
# ## value in both plugins to ensure metrics are round-tripped without
# ## modification.
# ##
# ## example: metric_version = 1; deprecated in 1.13
# ## example: metric_version = 1;
# ## metric_version = 2; recommended version
# # metric_version = 1
#
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/prometheus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ in Prometheus format.
## value in both plugins to ensure metrics are round-tripped without
## modification.
##
## example: metric_version = 1; deprecated in 1.13
## example: metric_version = 1;
## metric_version = 2; recommended version
# metric_version = 1

Expand Down
5 changes: 1 addition & 4 deletions plugins/inputs/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ var sampleConfig = `
## value in both plugins to ensure metrics are round-tripped without
## modification.
##
## example: metric_version = 1; deprecated in 1.13
## example: metric_version = 1;
## metric_version = 2; recommended version
# metric_version = 1
Expand Down Expand Up @@ -155,9 +155,6 @@ func (p *Prometheus) Description() string {
}

func (p *Prometheus) Init() error {
if p.MetricVersion != 2 {
p.Log.Warnf("Use of deprecated configuration: 'metric_version = 1'; please update to 'metric_version = 2'")
}

// Config proccessing for node scrape scope for monitor_kubernetes_pods
p.isNodeScrapeScope = strings.EqualFold(p.PodScrapeScope, "node")
Expand Down
2 changes: 1 addition & 1 deletion plugins/outputs/prometheus_client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ all metrics on `/metrics` (default) to be polled by a Prometheus server.
## Prometheus format. When using the prometheus input, use the same value in
## both plugins to ensure metrics are round-tripped without modification.
##
## example: metric_version = 1; deprecated in 1.13
## example: metric_version = 1;
## metric_version = 2; recommended version
# metric_version = 1

Expand Down
3 changes: 1 addition & 2 deletions plugins/outputs/prometheus_client/prometheus_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var sampleConfig = `
## Prometheus format. When using the prometheus input, use the same value in
## both plugins to ensure metrics are round-tripped without modification.
##
## example: metric_version = 1; deprecated in 1.13
## example: metric_version = 1;
## metric_version = 2; recommended version
# metric_version = 1
Expand Down Expand Up @@ -133,7 +133,6 @@ func (p *PrometheusClient) Init() error {
default:
fallthrough
case 1:
p.Log.Warnf("Use of deprecated configuration: metric_version = 1; please update to metric_version = 2")
p.collector = v1.NewCollector(time.Duration(p.ExpirationInterval), p.StringAsLabel, p.Log)
err := registry.Register(p.collector)
if err != nil {
Expand Down

0 comments on commit 66e12e0

Please sign in to comment.