-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Labels
bugunexpected problem or unintended behaviorunexpected problem or unintended behavior
Description
Relevant telegraf.conf
[[outputs.influxdb]]
urls = ["http://localhost:8086"]
retention_policy= "autogen"
write_consistency = "any"
timeout = "30s"
[[inputs.mongodb]]
servers = [ "mongodb://test:test@<replicasetnode>:27017/?connect=direct" ]
gather_perdb_stats = true
gather_col_stats = true
gather_top_stat = true
[inputs.mongodb.tags]
"component_name" = "mgs"
"ReplicaSet_name" = "test"
Logs from Telegraf
n/a
System info
master (https://github.com/influxdata/telegraf/tree/master)
Docker
No response
Steps to reproduce
I have a replica set with 3 nodes. I'm looking at the update_count metric to check the rate for a particular collection for a particular host. I have host label = my target host and hostname = the 2nd or the 3rd node in the replica set. Checked and debugged the code and saw that you:
- Set the 'original' host's tag first:
tags["hostname"] = s.hostname - Override it with another value:
d.Tags["hostname"] = host.Name - In the end, when constructing a query for host = host1 I get two chart with (host=host1, hostname=host2) and (host=host1m hostname=host3) and I don't get a chart to see how many updates have been executed for my host1.
Expected behavior
Create a metric to show stats for a necessary host
Actual behavior
Two metrics are created; each looks like a separate counter; it's impossible to get the query to show the data for the dedicated primary.

Additional info
I may be missing something so would be grateful if you show me the proper way to set this up.
Metadata
Metadata
Assignees
Labels
bugunexpected problem or unintended behaviorunexpected problem or unintended behavior