Documentation

Wireguard Input Plugin

This plugin collects statistics on a local Wireguard server using the wgctrl library. The plugin reports gauge metrics for Wireguard interface device(s) and its peers.

Introduced in: Telegraf v1.14.0 Tags: network OS support: all

Global configuration options

Plugins support additional global and plugin configuration settings for tasks such as modifying metrics, tags, and fields, creating aliases, and configuring plugin ordering. See CONFIGURATION.md for more details.

Configuration

# Collect Wireguard server interface and peer statistics
[[inputs.wireguard]]
  ## Optional list of Wireguard device/interface names to query.
  ## If omitted, all Wireguard interfaces are queried.
  # devices = ["wg0"]

Troubleshooting

Error: operation not permitted

When the kernelspace implementation of Wireguard is in use (as opposed to its userspace implementations), Telegraf communicates with the module over netlink. This requires Telegraf to either run as root, or for the Telegraf binary to have the CAP_NET_ADMIN capability.

To add this capability to the Telegraf binary (to allow this communication under the default user telegraf):

sudo setcap CAP_NET_ADMIN+epi $(which telegraf)

N.B.: This capability is a filesystem attribute on the binary itself. The attribute needs to be re-applied if the Telegraf binary is rotated (e.g. on installation of new a Telegraf version from the system package manager).

Error: error enumerating Wireguard devices

This usually happens when the device names specified in config are invalid. Ensure that sudo wg show succeeds, and that the device names in config match those printed by this command.

Metrics

  • wireguard_device

    • tags:
      • name (interface device name, e.g. wg0)
      • type (Wireguard tunnel type, e.g. linux_kernel or userspace)
    • fields:
      • listen_port (int, UDP port on which the interface is listening)
      • firewall_mark (int, device’s current firewall mark)
      • peers (int, number of peers associated with the device)
  • wireguard_peer

    • tags:
      • device (associated interface device name, e.g. wg0)
      • public_key (peer public key, e.g. NZTRIrv/ClTcQoNAnChEot+WL7OH7uEGQmx8oAN9rWE=)
    • fields:
      • persistent_keepalive_interval_ns (int, keepalive interval in nanoseconds; 0 if unset)
      • protocol_version (int, Wireguard protocol version number)
      • allowed_ips (int, number of allowed IPs for this peer)
      • last_handshake_time_ns (int, Unix timestamp of the last handshake for this peer in nanoseconds)
      • rx_bytes (int, number of bytes received from this peer)
      • tx_bytes (int, number of bytes transmitted to this peer)
      • allowed_peer_cidr (string, comma separated list of allowed peer CIDRs)

Example Output

wireguard_device,host=WGVPN,name=wg0,type=linux_kernel firewall_mark=51820i,listen_port=58216i 1582513589000000000
wireguard_device,host=WGVPN,name=wg0,type=linux_kernel peers=1i 1582513589000000000
wireguard_peer,device=wg0,host=WGVPN,public_key=NZTRIrv/ClTcQoNAnChEot+WL7OH7uEGQmx8oAN9rWE= allowed_ips=2i,persistent_keepalive_interval_ns=60000000000i,protocol_version=1i,allowed_peer_cidr=192.168.1.0/24,10.0.0.0/8 1582513589000000000
wireguard_peer,device=wg0,host=WGVPN,public_key=NZTRIrv/ClTcQoNAnChEot+WL7OH7uEGQmx8oAN9rWE= last_handshake_time_ns=1582513584530013376i,rx_bytes=6484i,tx_bytes=13540i 1582513589000000000

Was this page helpful?

Thank you for your feedback!


InfluxDB OSS 2.9.0: API tokens are hashed by default

Stronger token security in InfluxDB OSS 2.9.0 — tokens are hashed on disk by default. Existing tokens are hashed on first startup and can’t be recovered afterward. Capture any plaintext tokens you still need before you upgrade.

View InfluxDB OSS 2.9.0 release notes

Hashed tokens authenticate exactly like unhashed tokens — clients and integrations keep working.

Also new in 2.9.0:

  • Configurable backup compression
  • Restore support for backups containing hashed tokens
  • Tighter Edge Data Replication queue validation
  • Flux upgrade
  • Compaction reliability improvements

Key enhancements in Explorer 1.8

Explorer 1.8 is now available with streaming data subscriptions (beta), line protocol preview, and query history & saved queries.

View Explorer 1.8 release notes

Explorer 1.8 includes new features and improvements that make it easier to ingest, explore, and manage data.

Highlights:

  • Streaming data subscriptions (beta): Stream data into Explorer from MQTT, Kafka, and AMQP sources.
  • Line protocol preview: Preview line protocol, schema, and parse errors before data is written.
  • Custom sample data: Generate custom sample datasets with line protocol and schema preview.
  • Query history and saved queries: Browse query history and save/re-run named queries.
  • Retention period management: Set, update, or clear retention periods on databases and tables.

For more details, see Explorer 1.8 release notes

InfluxDB 3.9: Performance upgrade preview

InfluxDB 3 Enterprise 3.9 includes a beta of major performance upgrades with faster single-series queries, wide-and-sparse table support, and more.

InfluxDB 3 Enterprise 3.9 includes a beta of major performance and feature updates.

Key improvements:

  • Faster single-series queries
  • Consistent resource usage
  • Wide-and-sparse table support
  • Automatic distinct value caches for reduced latency with metadata queries

Preview features are subject to breaking changes.

For more information, see:

Telegraf Enterprise now in public beta

Get early access to the Telegraf Controller and provide feedback to help shape the future of Telegraf Enterprise.

See the Blog Post

The upcoming Telegraf Enterprise offering is for organizations running Telegraf at scale and is comprised of two key components:

  • Telegraf Controller: A control plane (UI + API) that centralizes Telegraf configuration management and agent health visibility.
  • Telegraf Enterprise Support: Official support for Telegraf Controller and Telegraf plugins.

Join the Telegraf Enterprise beta to get early access to the Telegraf Controller and provide feedback to help shape the future of Telegraf Enterprise.

For more information:

Telegraf Controller v0.0.7-beta now available

Telegraf Controller v0.0.7-beta is now available with new features, improvements, bug fixes, and an important breaking change.

View the release notes
Download Telegraf Controller v0.0.7-beta

InfluxDB Docker latest tag changing to InfluxDB 3 Core

On May 27, 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