Documentation

Telegraf output data formats

Telegraf uses serializers to convert metrics into output data formats. Many output plugins support the data_format option, which lets you choose how metrics are formatted before writing.

How output plugins use serializers

When you configure data_format in an output plugin, Telegraf uses a serializer to convert metrics into that format before writing. The output plugin controls where data goes; the serializer controls how it’s formatted.

Some output plugins support use_batch_format, which changes how the serializer processes metrics. When enabled, the serializer receives all metrics in a batch together rather than one at a time, enabling more efficient encoding and formats that represent multiple metrics as a unit (like JSON arrays).

[[outputs.file]]
  files = ["stdout"]

  ## Output plugin option: process metrics as a batch
  use_batch_format = true

  ## Serializer selection: format metrics as JSON
  data_format = "json"

Output plugins that support use_batch_format: file, http, amqp, kafka, nats, mqtt, exec, execd, remotefile

Choosing an output approach

By destination

DestinationRecommended Approach
Prometheus scrapingprometheus_client output plugin (exposes /metrics endpoint)
InfluxDBinfluxdb or influxdb_v2 output plugin (native protocol)
Remote HTTP endpointshttp output + serializer
Filesfile output + serializer
Message queueskafka, nats, amqp + serializer

By metric type

Some metric types require state across collection intervals:

  • Histograms accumulate observations into buckets
  • Summaries track quantiles over a sliding window

Serializers process each batch independently and cannot maintain this state. When a histogram or summary spans multiple batches, the serializer may produce incomplete or incorrect output.

For these metric types, use a dedicated output plugin that maintains state–for example:

Available serializers


Was this page helpful?

Thank you for your feedback!


New in InfluxDB 3.8

Key enhancements in InfluxDB 3.8 and the InfluxDB 3 Explorer 1.6.

See the Blog Post

InfluxDB 3.8 is now available for both Core and Enterprise, alongside the 1.6 release of the InfluxDB 3 Explorer UI. This release is focused on operational maturity and making InfluxDB easier to deploy, manage, and run reliably in production.

For more information, check out:

InfluxDB Docker latest tag changing to InfluxDB 3 Core

On February 3, 2026, the latest tag for InfluxDB Docker images will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments.

If using Docker to install and run InfluxDB, the latest tag will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments. For example, if using Docker to run InfluxDB v2, replace the latest version tag with a specific version tag in your Docker pull command–for example:

docker pull influxdb:2