proxy-wasm / spec

WebAssembly for Proxies (ABI specification)
Apache License 2.0
545 stars 27 forks source link

Create TextReadout metrics #45

Open seblaz opened 5 months ago

seblaz commented 5 months ago

Allow wasm filters to create TextReadout metrics, currently it only supports Counters, Gauges, and Histograms.

Possible use case:

A WASM filter with asynchronous initialization was developed, which fetches necessary configuration data. To allow other components to query the initialization status, the filter sets a gauge metric to signal when initialization is complete. Additionally, we want to expose a TextReadout metric to display an error message if the initialization fails. Currently, the filter logs errors, but we want other components to be able to query the error value directly, instead of searching through logs.

mpwarres commented 5 months ago

ISTM we'd need to add a new proxy_metric_type_t enum value, and a new variation of proxy_record_metric that accepts a string. @PiotrSikora WDYT?