unpoller_unpoller/pkg/datadogunifi
Cody Lee 18c6e66a8e
feat: add Site Magic site-to-site VPN metrics (closes #926) (#983)
* feat: add Site Magic site-to-site VPN metrics (closes #926)

Bump github.com/unpoller/unifi/v5 to v5.25.0 which adds:
- GetMagicSiteToSiteVPN / GetMagicSiteToSiteVPNSite API methods
- MagicSiteToSiteVPN types with mesh, connection, device, and status structs
- Missing VPN health fields on Site.Health (SiteToSiteNumActive/Inactive,
  SiteToSiteRxBytes/TxBytes/RxPackets/TxPackets)

Implement VPN metrics collection across all output plugins:
- Collect Site Magic VPN mesh data per-site in inputunifi pollController
- Propagate VPNMeshes through poller.Metrics / AppendMetrics
- Apply DefaultSiteNameOverride for VPN meshes in augmentMetrics /
  applySiteNameOverride
- influxunifi: vpn_mesh, vpn_mesh_connection, vpn_mesh_status tables
- promunifi: vpn_mesh_*, vpn_tunnel_*, vpn_mesh_status_* gauges
- datadogunifi: unifi.vpn_mesh.*, unifi.vpn_tunnel.*, unifi.vpn_mesh_status.*

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

* feat(otelunifi): add Site Magic VPN metrics to OpenTelemetry output

Adds exportVPNMeshes to the otel output plugin, emitting the same
unifi_vpn_mesh_*, unifi_vpn_tunnel_*, and unifi_vpn_mesh_status_*
gauges as the other output plugins.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 21:08:09 -05:00
..
LICENSE
README.md
alarms.go painful upgrade for dumb go versioning 2024-12-31 14:44:10 -06:00
clients.go painful upgrade for dumb go versioning 2024-12-31 14:44:10 -06:00
datadog.go feat: add Site Magic site-to-site VPN metrics (closes #926) (#983) 2026-03-23 21:08:09 -05:00
events.go fix vet 2024-12-31 14:47:06 -06:00
firewall_policies.go feat: firewall policy metrics across all output plugins (closes #928) (#979) 2026-03-23 18:26:27 -05:00
integration_test.go fix dd client interface change, update deprecated context lib in influxdb 2025-12-03 11:51:40 -06:00
integration_test_expectations.yaml feat(devices): add UDB (UniFi Device Bridge) support (#968) 2026-03-22 15:00:18 -05:00
logger.go
pdu.go painful upgrade for dumb go versioning 2024-12-31 14:44:10 -06:00
points.go
port_anomalies.go feat: add port anomaly metrics (closes #929) (#982) 2026-03-23 18:56:37 -05:00
report.go
site.go Populate num_user field for VPN subsystem metrics 2026-01-25 12:09:01 -06:00
speedtest.go Fix multi-WAN speed test reporting (issue #841) 2025-12-09 16:46:14 -06:00
topology.go feat: add network topology metrics (closes #931) (#981) 2026-03-23 18:44:51 -05:00
uap.go fix: remove age==0 guard that silently dropped all rogue AP metrics (#972) 2026-03-23 14:53:07 -05:00
ubb.go feat: Add WAN metrics to InfluxDB and Datadog exporters 2026-01-29 17:27:28 -05:00
uci.go fixes metrics prefix names for ubb and uci devices 2025-01-15 15:50:47 -06:00
udb.go feat(devices): add UDB (UniFi Device Bridge) support (#968) 2026-03-22 15:00:18 -05:00
udm.go painful upgrade for dumb go versioning 2024-12-31 14:44:10 -06:00
usg.go adds device uplink stats for issue #585 2025-01-02 12:41:34 -06:00
usw.go Allow PoE-providing ports to be scraped even when disabled 2026-01-25 11:31:39 -06:00
uxg.go adds device uplink stats for issue #585 2025-01-02 12:41:34 -06:00
vpn.go feat: add Site Magic site-to-site VPN metrics (closes #926) (#983) 2026-03-23 21:08:09 -05:00
wan.go chore: Update go.sum for unifi v5.11.0 and fix formatting 2026-01-29 17:37:33 -05:00

README.md

datadogunifi

UniFi Poller Output Plugin for DataDog

Configuration

datadog:
  # How often to poll UniFi and report to Datadog.
  interval: "2m"

  # To disable this output plugin
  disable: false

  # Datadog Custom Options

  # address to talk to the datadog agent, by default this uses the local statsd UDP interface
  # address: "..."

  # namespace to prepend to all data
  # namespace: ""

  # tags to append to all data
  # tags:
  #  - foo
  
  # max_bytes_per_payload is the maximum number of bytes a single payload will contain.
  # The magic value 0 will set the option to the optimal size for the transport
  # protocol used when creating the client: 1432 for UDP and 8192 for UDS.
  # max_bytes_per_payload: 0
  
  # max_messages_per_payload is the maximum number of metrics, events and/or service checks a single payload will contain.
  # This option can be set to `1` to create an unbuffered client.
  # max_messages_per_payload: 0
  
  # BufferPoolSize is the size of the pool of buffers in number of buffers.
  # The magic value 0 will set the option to the optimal size for the transport
  # protocol used when creating the client: 2048 for UDP and 512 for UDS.
  # buffer_pool_size: 0

  # buffer_flush_interval is the interval after which the current buffer will get flushed.
  # buffer_flush_interval: 0
  
  # buffer_shard_count is the number of buffer "shards" that will be used.
  # Those shards allows the use of multiple buffers at the same time to reduce
  # lock contention.
  # buffer_shard_count: 0
  
  # sender_queue_size is the size of the sender queue in number of buffers.
  # The magic value 0 will set the option to the optimal size for the transport
  # protocol used when creating the client: 2048 for UDP and 512 for UDS.
  # sender_queue_size: 0
  
  # write_timeout_uds is the timeout after which a UDS packet is dropped.
  # write_timeout_uds: 5000
  
  # receive_mode determines the behavior of the client when receiving to many
  # metrics. The client will either drop the metrics if its buffers are
  # full (ChannelMode mode) or block the caller until the metric can be
  # handled (MutexMode mode). By default the client will MutexMode. This
  # option should be set to ChannelMode only when use under very high
  # load.
  # 
  # MutexMode uses a mutex internally which is much faster than
  # channel but causes some lock contention when used with a high number
  # of threads. Mutex are sharded based on the metrics name which
  # limit mutex contention when goroutines send different metrics.
  # 
  # ChannelMode: uses channel (of ChannelModeBufferSize size) to send
  # metrics and drop metrics if the channel is full. Sending metrics in
  # this mode is slower that MutexMode (because of the channel), but
  # will not block the application. This mode is made for application
  # using many goroutines, sending the same metrics at a very high
  # volume. The goal is to not slow down the application at the cost of
  # dropping metrics and having a lower max throughput.
  # receive_mode: 0
  
  # channel_mode_buffer_size is the size of the channel holding incoming metrics
  # channel_mode_buffer_size: 0
  
  # aggregation_flush_interval is the interval for the aggregator to flush metrics
  # aggregation_flush_interval: 0