batch

package
v1.40.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 5 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Batch Processor Plugin

This plugin groups metrics into batches by adding a batch tag. This is useful for parallel processing of metrics where downstream processors, aggregators or outputs can then select a batch using tagpass or metricpass.

Metrics are distributed across batches using the round-robin scheme.

⭐ Telegraf v1.33.0 🏷️ grouping 💻 all

Global configuration options

In addition to the plugin-specific configuration settings, plugins support additional global and plugin configuration settings. These settings are used to modify metrics, tags, and field or create aliases and configure ordering, etc. See the CONFIGURATION.md for more details.

Configuration

## Batch metrics into separate batches by adding a tag indicating the batch index.
[[processors.batch]]
  ## The name of the tag to use for adding the batch index
  batch_tag = "my_batch"

  ## The number of batches to create
  batches = 16

  ## Do not assign metrics with an existing batch assignment to a
  ## different batch.
  # skip_existing = false

Example

The example below uses these settings:

[[processors.batch]]
  ## The tag key to use for batching
  batch_tag = "batch"

  ## The number of batches to create
  batches = 3
- temperature cpu=25
- temperature cpu=50
- temperature cpu=75
- temperature cpu=25
- temperature cpu=50
- temperature cpu=75
+ temperature,batch=0 cpu=25
+ temperature,batch=1 cpu=50
+ temperature,batch=2 cpu=75
+ temperature,batch=0 cpu=25
+ temperature,batch=1 cpu=50
+ temperature,batch=2 cpu=75

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

type Batch struct {
	BatchTag     string `toml:"batch_tag"`
	NumBatches   uint64 `toml:"batches"`
	SkipExisting bool   `toml:"skip_existing"`
	// contains filtered or unexported fields
}

func (*Batch) Apply

func (b *Batch) Apply(in ...telegraf.Metric) []telegraf.Metric

func (*Batch) SampleConfig

func (*Batch) SampleConfig() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL