influxdata/telegraf

Use payload key to define MongoDB Collection for Output

Open

#11,756 opened on Sep 4, 2022

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Go (4,161 forks)batch import
feature requesthelp wantedsize/m

Repository metrics

Stars
 (9,892 stars)
PR merge metrics
 (Avg merge 2d 12h) (136 merged PRs in 30d)

Description

Use Case

Currently the influxdb_v2 has a configurable "bucket_tag" property in the output configuration which allows for a payload tag to determine the bucket that the data is written to in InfluxDB. We use this tag to isolate metrics for sane retrieval later on.

It would be great if the MongoDB output had the option for a "collection_tag" which would allow for sorting of data into easily retrievable collections, rather than needing to aggregate multiple collections on retrieval.

Expected behavior

"collection_tag" in configuration defines the collection that the data is written to. (same behaviour as the influxdb_v2 bucket_tag)

Actual behavior

Currently the collection name seems to be defined by a key 'device_id' which separates every device into a separate collection making aggregate queries (queries with more than one device) unweildy.

Additional info

I am sure that for a Go programmer this would be a trivial change... but I'm having some difficulties wrapping my head around where the changes need to be made to allow for the change. Otherwise this would be a PR.

Contributor guide