influxdata / influxdata/telegraf

Use payload key to define MongoDB Collection for Output

Open
#11,756 1 comment 0 reactions 0 assignees View on GitHub
feature request help wanted size/m
Dominant language
Go
Stars
17.8k
Forks
5.8k
Avg merge
1d 20h
Merged PRs (30d)
161

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

Open the contributing guide

Research direction

Start by locating the MongoDB output implementation and configuration, then compare its collection selection with the influxdb_v2 bucket_tag behavior described in the issue. Done means a collection_tag option can select the destination collection from the payload instead of always separating data by device_id.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, mongodb
Domain
databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.