cloudflare / foundations

Cloudflare's Rust service foundations library.
https://blog.cloudflare.com/introducing-foundations-our-open-source-rust-service-foundation-library
BSD 3-Clause "New" or "Revised" License
1.2k stars 44 forks source link

Consider supporting OpenTelemetry #9

Open ibotty opened 4 months ago

ibotty commented 4 months ago

We are already running OpenTelemetry so it would be great to allow easy intergration into apps using foundations.

inikulin commented 4 months ago

Could you elaborate a bit more about what kind of integration you expect?

Noah-Kennedy commented 4 months ago

@ibotty which apis are you interested in here?

Generic OTEL support for tracing and logging is likely to be fairly simple, metrics would be more complicated though.

ibotty commented 4 months ago

Sorry for not answering earlier. I was busy.

For some rust projects we are using tracing, tracing-opentelemetry and opentelemetry-otlp to export traces. We don't yet use metrics via OpenTelemetry.

ATM setting that up is quiet a handful of boilerplate in Rust. It seems to be kind-of in scope for foundations to make that easier.

Noah-Kennedy commented 4 months ago

Foundations doesn't use tracing, and instead has it's own competing system, but does handle all the stuff you are talking about here already, albeit the exporting is slightly hardcoded around jaeger OTEL, but that can easily be changed.

ibotty commented 4 months ago

Sorry for the incomplete post.

Is there some documentation on why foundations is not using tokio's tracing? I would have hoped, that the enhancements in the blog post could be made in upstream tracing as well. It's a little unfortunate to not have the native tracing of tokio's crates.

inikulin commented 4 months ago

There is certain functionality in foundations that can't be implemented with tracing's design. Also, there are certain unresolved bugs in tracing that prevented it's adoption for certain scenarios that we have.

However, there's a plan to release an adapter crate that will allow funnelling of tracing-produced output to Foundations. cc @evanrittenhouse

evanrittenhouse commented 4 months ago

Hopefully I can start work on the adapter crate in the next couple of days. I'm thinking we can start with an OTEL appender as shown in https://github.com/open-telemetry/opentelemetry-rust

inikulin commented 3 months ago

v4 will have native support for OTLP gRPC exporters for traces and logs. Please, let me us know if you also need any of those:

nifty-bytes commented 3 months ago

+ for

inikulin commented 1 month ago

https://github.com/cloudflare/foundations/pull/34 adds support for OTLP tracing reporting. External reviews are vey much appreciated

davidbarsky commented 1 month ago

There is certain functionality in foundations that can't be implemented with tracing's design. Also, there are certain unresolved bugs in tracing that prevented it's adoption for certain scenarios that we have.

Hi! I'm a tracing maintainer. Can you share these limitations/bugs are? I'm not aware of what you're missing, but I'd like to be able to close those gaps.