influxdata / influxdata/telegraf

[[output.nats]] Bytes limits on output size

Open
#17,824 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
Go
Stars
17.8k
Forks
5.8k
Avg merge
1d 20h
Merged PRs (30d)
161

Description

Use Case

In NATS, messages have a max size (1Mb by default).

As telegraf limits the size of the batch in number of messages (instead of bytes), it's not very useful in the case when one message can contain multiple lines of lineprotocol output, making messages' actual length very wide.

Expected behavior

It is possible to limit the messages sent to NATS to avoid triggering the message limit size.

This feature is already implemented on other output plugins such as cloud_pubsub, event_hubs, file, graylog and influxdb (thanks @Hipska for the research).

Actual behavior

Given a big enough metric_batch_size value, NATS max message size error is triggered when the serialized message exceeds the max message size (1Mb by default).

Additional info

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the output.nats plugin and compare its batching behavior with the cloud_pubsub, event_hubs, file, graylog, and influxdb output plugins, which already support size limits. Trace how serialized messages are formed and identify the existing tests for these plugins. Done means NATS messages can be limited by bytes as well as metric_batch_size, preventing the reported maximum-size error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.