Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/j-white/cloudflare-otlp-exporter
OpenTelemetry exporter for Cloudflare
https://github.com/j-white/cloudflare-otlp-exporter
cloudflare opentelemetry otlp-exporter rust webassembly workers
Last synced: about 1 month ago
JSON representation
OpenTelemetry exporter for Cloudflare
- Host: GitHub
- URL: https://github.com/j-white/cloudflare-otlp-exporter
- Owner: j-white
- License: apache-2.0
- Created: 2024-05-01T23:15:02.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-05-09T13:50:56.000Z (6 months ago)
- Last Synced: 2024-09-27T06:43:10.826Z (about 2 months ago)
- Topics: cloudflare, opentelemetry, otlp-exporter, rust, webassembly, workers
- Language: Rust
- Homepage:
- Size: 357 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cloudflare OpenTelemetry exporter
## Description
This worker was written to push Cloudflare Analytics data to an OpenTelemetry collector.
It is inspired by the [cloudflare-exporter](https://github.com/lablabs/cloudflare-exporter), which is unfortunately no longer maintained.
By running it as a worker and pushing metrics, we avoid the need to deploy a dedicated container and allow the worker to be run on [green compute](https://blog.cloudflare.com/announcing-green-compute).## Metrics currently supported
- [x] Workers
- [x] D1
- [x] Durable Objects
- [x] Queues
- [ ] Zones## Usage
* Clone the repo
* Modify the wrangler.toml file to include your Cloudflare account ID and API token and OTel collector endpoint
* Run `npx wrangler deploy --env dev` to deploy the worker## How it works
* Scrape the Cloudflare Analytics API via GraphQL
* Build the metrics in a Prometheus registry (ideally this would be directly with OTel, but ran into some challenges with threading and WASM for these SDKs)
* Convert the Prometheus registry to OTel metrics
* Push the OTel metrics to an OTel collector via protobuf (JSON encoding for OTel Metrics is broken in the Rust SDKs and is only used for testing)## Next steps
* Add more metrics
* Help improve OTel Rust SDKs and remove dependency on Prometheus