outtherelabs / actix-web-opentelemetry Goto Github PK
View Code? Open in Web Editor NEWOpenTelemetry integration for Actix Web
License: MIT License
OpenTelemetry integration for Actix Web
License: MIT License
I just tried the server middleware example in from the doc and jaeger doesn't find the service and requests.
The client example on this repo work :)
I've tested by using the example provided from the main branch. I was trying to refresh the same page (e.g. /metrics) again and again, then I found that, after some period of time, http_server_active_requests got duplicated. I'm not sure whether this is intended behavior or not, but it looks strange for me.
Why does this crate force the use of actix-http/zstd
?
It looks like this was introduced by 10bee3e, cc @fourbytes .
Can you enable "process" feature for Prometheus metrics like this?
https://docs.rs/actix-web-prometheus/0.1.2/actix_web_prometheus/
It seems currently the client span won't set span status to error when the http request fails in some ways (5xx, 4xx, etc), so the resulting spans' status are always UNSET. Do you think its reasonable to automatically set the span status according to the http status similar to what golang's contrib net/http
do? (https://github.com/open-telemetry/opentelemetry-go-contrib/blob/6c86403/instrumentation/net/http/otelhttp/handler.go#L219)
The spec have this included so at least we have a standard to follow.
The dependency in Cargo.toml should ideally be:
- actix-web = "3.0.2"
+ actix-web = { version = "3.0.2", default-features = false }
Could you release the v3 of this module on cargo please ? ๐
This may not be possible but as of today I haven't found a way to access the context created by this middleware in my own middleware. Is this possible or am I missing something. I have tried ordering my middleware registration in all the combinations I could think of.
I would love some guidance on what might be possible today.
Thank you.
Opentelemetry v1.19 was released and It would be really lovely to update all crates, not just the Opentelemetry
This code (from your example, with 1 small change)
let (_tracer, _uninstall) = opentelemetry_jaeger::new_pipeline()
.with_agent_endpoint("localhost:6831")
.install()
.expect("pipeline install error");
produces this error:
thread 'main' panicked at 'there is no reactor running, must be called from the context of a Tokio 1.x runtime'
In your example, there is no special Tokio runtime created to run this code, and I'd like to avoid it too :)
Could you please give me a hint on how to make it work?
Hello,
I am not seeing the status code that was returned from the actix-web server span. Is this expected or maybe I have missed something?
Thank you for your work.
Hello,
Thanks for this library! We would like to filter requests being traced to exclude healthchecks ones, is there a way to implement a filter determining if a request needs to be traced?
hey ๐ thanks for putting together this crate!
I see you've defined the type RequestTracingMiddleware
to be generic in terms of an HttpTextFormat
, and was hoping to use this type like RequestTracing
does, but with TraceContextPropagator
instead of B3Propagator
.
In trying to do the above myself, I found that RequestTracingMiddleware
is public but not exposed in lib.rs
.
actix-web-opentelemetry/src/middleware/trace.rs
Lines 130 to 135 in 5a58b82
actix-web-opentelemetry/src/lib.rs
Lines 68 to 73 in 5a58b82
Have you given thought to how library users can do this, and what the desired api would be? Ideally I could write something as simple as:
use actix_web_opentelemetry::RequestTracing
...
App::new().wrap(RequestTracing::new(TextContextPropagator::new()))
thanks for everything ๐
Now that actix-web 3.0 is released, is it possible to upgrade to the dependency to actix-web 3.0?
If i try to use zipkin pipeline instead of jaeger it fail with: Cannot drop a runtime in a context where blocking is not allowed. This happens when a runtime is dropped from within an asynchronous context.
Code:
[dependencies]
actix-web = "3.2"
actix-web-opentelemetry = "0.7"
opentelemetry-zipkin = "0.7"
use actix_web::{get, web, App, HttpServer, Responder};
use actix_web_opentelemetry::RequestTracing;
#[get("/{id}/{name}/index.html")]
async fn index(web::Path((id, name)): web::Path<(u32, String)>) -> impl Responder {
format!("Hello {}! id:{}", name, id)
}
#[actix_web::main]
async fn main() -> std::io::Result<()> {
opentelemetry_zipkin::new_pipeline()
.install()
.expect("pipeline install error");
HttpServer::new(|| App::new().service(index).wrap(RequestTracing::new()))
.bind("127.0.0.1:8080")?
.run()
.await
}
Hi,
Just wanted to ask if it's possible to add an example of using actix-web-opentelemetry with a pipeline using OTLP.
That will allow people to start quickly and send traces to Observability tools.
open-telemetry/opentelemetry-specification#394 can be determined at build time via CARGO_PKG_VERSION
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.