google / slo-generator

SLO Generator computes SLIs, SLOs, Error Budgets and Burn Rates from supported backends, then exports an SLO report to supported targets.
Apache License 2.0
489 stars 78 forks source link

💡 [REQUEST] - Add OpenTelemetry Exporter plugin #347

Open skinlayers opened 1 year ago

skinlayers commented 1 year ago

Summary

It would be useful to be able to export SLO reports to OpenTelemetry. I've already done some initial work, but ran into a stumbling block when trying to leverage the existing prometheus exporter as a template. The prometheus exporter creates a Gauge to build the time_series. OpenTelemetry says that prometheus gauges must be converted to OTLP Gauges. Unfortunately, at the moment, OpenTelemetry only supports async gauges, while slo-generator's design calls for a synchronous gauge. I'm currently looking at ways to wrap the async gauge to make it synchronous.

Basic Example

In the case of writing to Grafana Mimir, it would provide a future-facing alternative to pushgateway or remote write. Ideally both grpc and http would be supported.

Screenshots

![DESCRIPTION](LINK.png)

Drawbacks

It would add more code to slo-generator that would need to be maintained.

Unresolved questions

No response

Code of Conduct

lvaylet commented 1 year ago

Hi @skinlayers, thanks for suggesting this new exporter. Can you share your existing code, for example in a new Pull Request (PR), so it can be reviewed by external pairs of eyes? Then we can work on the gauges all together.