Hasura Adds Support for OpenTelemetry Logs Exports 🎉
First off, this post is a bit late... The official release announcement was in late October, but I have been too excited (and busy) to get around to write about it. This. Is. Big.
Wait. So.. What is OpenTelemetry?
Well, I am glad you asked. OpenTelemetry, at its core, is an open-source observability framework designed to collect, export, and analyze telemetry data such as logs, metrics, and traces from cloud-native applications. This framework standardizes and simplifies the process of instrumenting your software and enables developers and operations teams to gain a comprehensive view of their systems. OpenTelemetry takes a vendor-neutral approach means it can be integrated with a wide range of monitoring tools, making it a flexible and powerful solution for modern software observability.
Why is this useful for API Metering?
To be able to effectively and efficiently meter GraphQL APIs using data throughput as a metric you need to track response sizes of requests. Hasura's http-log records this data, but in order to turn it into a metric useful for API metering we need to ingest and process these logs via an external system. Previously this was not technically feasible from their Hasura Cloud offering. The "workaround" was to self-host Hasura Engine and scrape the logs from the host; however, this is not always an option or desired approach for fast moving startups or small teams. I reached out to Hasrua in early 2023 to begin down the path of developing a log exports integration for MeterMonkey to enable support for Hasura Cloud based APIs. I was pleasantly surprised when their response indicated that development to support OTel Metrics, Logs, and Tracing exports was underway with Traces already being available to Cloud Professional and above subscriptions (OTel export of metrics, logs, and tracing is presently available to all tiers -- including free!).
Next Steps
With logs able to freely flow out of Hasura Cloud full support for API metering solutions, such as MeterMonkey, can be readily implemented by setting the Logs Endpoint in Settings -> Monitoring & Observability -> OpenTelemetry Exporter (Beta). We'll cover setup and a full example in a future post. It's been a big year for the Hasura team and I am eager to see what innovations and product improvements 2024 will bring.