Optimize Telemetry Data Transfer
The data plane (DP) periodically reports operational metrics to the control plane (CP) to enable centralized monitoring, alerting, and dashboard visualizations. This telemetry includes API traffic volumes, request latency, HTTP status codes, bandwidth, and connection counts in prometheus format.
By default, the DP reports telemetry data every 15 seconds with Gzip compression enabled. This guide explains how to configure the telemetry behavior, tune compression levels, and opt out if needed.
Telemetry Configuration
Configure telemetry settings in the data plane's config.yaml:
api7ee:
telemetry:
# Whether to enable telemetry data reporting to the control plane
enable: true
# Time interval between telemetry reports (seconds)
interval: 15
# Maximum size of metrics data per report (bytes, default 32 MB)
max_metrics_size: 33554432
# Maximum batch size before compression (bytes, default 4 MB)
metrics_batch_size: 4194304
# Gzip compression level (-1 = library default, 0 = none, 1-9)
compression_level: -1
Compression Levels
Gzip compression reduces the network overhead of telemetry transfers. The compression level controls the trade-off between CPU usage and data size:
| Level | Description | Characteristics |
|---|---|---|
| -1 | Library default | Typically level 6 (balanced) |
| 0 | No compression | No CPU overhead; largest data size |
| 1 | Fastest compression | Lowest CPU usage; lowest compression ratio |
| 6 | Balanced compression | Best balance between CPU usage and compression ratio |
| 9 | Maximum compression | Highest compression ratio; highest CPU usage |
Performance Comparison
The following table shows example results from a test environment with 3600 routes:
| Measurement | Level 1 | Level 6 | Level 9 |
|---|---|---|---|
| Original Metrics Size | 7.71 MB | 6.60 MB | 6.45 MB |
| Compressed Size | 0.22 MB | 0.16 MB | 0.12 MB |
| Compression Ratio | 97.10% | 97.54% | 97.98% |
| DP CPU Usage | 17.39% | 21.57% | 29.61% |
For most deployments, the default level (-1, typically 6) provides a good balance. Consider level 1 if CPU resources are constrained, or level 9 if bandwidth is limited.
Disable Telemetry
To disable telemetry data transfer from the DP to the CP, set enable to false:
api7ee:
telemetry:
enable: false
Restart or reload the gateway for the change to take effect.
Disabling telemetry has significant operational impacts:
| Impact | Details |
|---|---|
| Loss of Observability | The control plane will no longer receive performance metrics. Monitoring dashboards and alerting systems will not function. |
| Impaired Operations | Teams lose the ability to assess service health, plan capacity, and troubleshoot issues using centralized metrics. |
| Compliance Risks | Industry compliance requirements for system monitoring and auditing may not be met. |
Only disable telemetry in special circumstances, such as isolated debugging environments.
This telemetry is internal DP-to-CP communication only. API7 Gateway does not send anonymous usage data or "phone home" to external services.