Wasm Stats Filter (proto)
This extension has the qualified name envoy.stat_sinks.wasm_filter
Note
This extension is only available in contrib images.
Note
This extension is functional but has not had substantial production burn time, use only with this caveat.
This extension does not operate on the data plane and hence is intended to be robust against untrusted traffic.
Tip
This extension extends and can be used with the following extension category:
This extension must be configured with one of the following type URLs:
Wasm-based stats filter middleware that wraps an inner stats sink.
extensions.stat_sinks.wasm_filter.v3.WasmFilterStatsSinkConfig
[extensions.stat_sinks.wasm_filter.v3.WasmFilterStatsSinkConfig proto]
A stats sink that runs a WASM plugin to filter, transform, and enrich metrics before delegating to an inner sink. The plugin can:
Filter: keep/drop counters, gauges, and histograms by index
Enrich: inject global tags (e.g. datacenter, pod) from node metadata
Rename: override metric names (e.g. prefix with
envoy.)Inject: add synthetic counters/gauges (e.g. version metrics)
- Available foreign functions:
stats_filter_emit– declare kept metric indicesstats_filter_set_global_tags– set tags applied to all metrics (once at startup)stats_filter_set_name_overrides– rename specific metrics (per flush)stats_filter_inject_metrics– inject synthetic counters/gauges (per flush)stats_filter_get_histograms– get histogram namesstats_filter_get_metric_tags– get tags for a single metricstats_filter_get_all_metric_tags– get tags for all metrics (bulk)
Metrics that the plugin does not emit are dropped. Text readouts pass through to the inner sink unfiltered.
{
"wasm_config": {...},
"inner_sink": {...}
}
- wasm_config
(extensions.wasm.v3.PluginConfig, REQUIRED) WASM plugin that implements the filter/transform/enrichment logic.
- inner_sink
(config.metrics.v3.StatsSink, REQUIRED) The inner sink to delegate filtered metrics to.