‹ Plugins / Value Counter
Scheduled Data-write

Value Counter

Every status code and log level flowing through your systems tells a story, if someone’s counting. The Value Counter Plugin turns that stream into instant tallies inside InfluxDB 3, no external service, no batch job to babysit. Count HTTP statuses, log levels, or any categorical field as writes land, or on your own schedule. It’s the counting logic Telegraf users already trust, now running natively in the Processing Engine.

Configuration

Plugin parameters may be specified as key-value pairs in the --trigger-arguments flag (CLI) or in the trigger_arguments field (API) when creating a trigger. Some plugins support TOML configuration files, which can be specified using the plugin’s config_file_path parameter.

If a plugin supports multiple trigger specifications, some parameters may depend on the trigger specification that you use.

Plugin metadata

This plugin includes a JSON metadata schema in its docstring that defines supported trigger types and configuration parameters. This metadata enables the InfluxDB 3 Explorer UI to display and configure the plugin.

Required parameters

Parameter Type Default Description
fields string required Space-separated list of field names whose unique values are counted (for example, status method)
table string required (scheduled only) Source table to query. Mode A derives the source table from the trigger spec and rejects this key

Data write trigger parameters

Parameter Type Default Description
period_seconds integer 60 Emission period in seconds, at least 1. Cache TTL is set to 2 * period_seconds
period string 60s Emission period as a duration, at least 1s. Units: s, min, h, d, w. Overridden by period_seconds when both are set
output_suffix string _valuecounts Suffix appended to the source measurement name for rollup output. Must be non-empty
dest_database string trigger’s own DB Optional database to write rollups to via write_sync_to_db

Scheduled trigger parameters

Parameter Type Default Description
output_suffix string _valuecounts Suffix appended to the source measurement name for rollup output. Must be non-empty
dest_database string trigger’s own DB Optional database to write rollups to via write_sync_to_db

Mode B is drift-based: the trigger’s every:duration spec is the only cadence knob. The plugin queries the window between the previous successful fire and the current call_time, so it self-aligns to whatever the scheduler delivers. Mode B rejects period_seconds and period keys.

TOML configuration

Parameter Type Default Description
config_file_path string none TOML config file path relative to PLUGIN_DIR (required for TOML configuration)

To use a TOML configuration file, set the PLUGIN_DIR environment variable and specify the config_file_path in the trigger arguments. This is in addition to the --plugin-dir flag when starting InfluxDB 3. Relative paths are resolved against PLUGIN_DIR, then INFLUXDB3_PLUGIN_DIR, then the parent of VIRTUAL_ENV.

If config_file_path is set, no other inline arguments may be set on the trigger. The TOML accepts the same keys as inline arguments.

Example TOML configuration

For more information on using TOML configuration files, see the Using TOML Configuration Files section in the influxdb3_plugins/README.md.

Schema requirement

The plugin reads tag column names from information_schema.columns for the source table; the source measurement must exist before the trigger fires. The watched fields named in fields must be of categorical type (string or low-cardinality numeric). The rollup measurement is created on first emission; do not pre-create it with a conflicting schema.

The rollup measurement name is always source_table:output_suffix. The default suffix (_valuecounts) keeps the rollup separate from the source table so the WAL trigger does not feed itself. An empty output_suffix is rejected at trigger creation.

Ready to get started?

Download InfluxDB 3 and have Value Counter running in minutes.