zopapublic / ktor-opentracing Goto Github PK
View Code? Open in Web Editor NEWKtor features for OpenTracing instrumentation.
License: MIT License
Ktor features for OpenTracing instrumentation.
License: MIT License
Hi,
I'm using version 0.3.6
and everything works correctly for responses that are not in error. However, when I have an exception on my backend, no root span is created by the OpenTracingServer
feature. It seems to be linked with the use of the StatusPages
feature.
For ex. if I have the StatusPages
feature installed with this configuration :
install(StatusPages) {
exception<Throwable> { cause ->
call.respond(HttpStatusCode.InternalServerError)
}
}
and throw an exception in a get
mapping :
get("test") {
throw IllegalArgumentException()
}
-> then no span is created.
And if I uninstall the StatusPages
feature and modify my mapping to do :
get("test") {
call.respond(HttpStatusCode.InternalServerError)
}
-> then a span is created as expected.
I think it is linked to phases but I know very little on the topic so....
Thanks
Hi there!
Thanks for your super nice project, we wan't to use it :)
I noticed that hosting is currently done on jcenter, which will be shut down soon (https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/)
Can you please use a differnt hoster, ideally maven central?
Thx!
Hannes
At least in our use case, it's fairly common that the request will not contain the headers required for context propagation and this info log creates quite a bit of unnecessary spam in the log for each request: https://github.com/zopaUK/ktor-opentracing/blob/3cf825cdd1262c86642d624b9c2feb946d5029d8/src/main/kotlin/com/zopa/ktor/opentracing/OpenTracingServer.kt#L63
We can configure the log level for the com.zopa.ktor.opentracing.Utils
logger as warn as a workaround, but it makes more sense to me for this to be a debug or even trace-level message
Hello! Thanks a lot for this library!
I would like to use MDC.put
to put the trace-id into the logging context so that it gets included in all logs. But when I should do that? I guess I would need to define my own phase and insert it between Features and OpenTracingStart. Or? Thank you!
Hi there, it's me again :)
I integrated your library successfully and for the "normal use case" everything is fine. However, we have the following requirement: Our service has to include trace ids in all log statements coming from the service.
I have a Layout implementation for logback and everything works fine for regular logging - I just use GlobalTracer.get().activeSpan() in the Layout and fine. However, when the CallLogging is done (Ktor included feature), the span/trace is already closed. That's likely because the finishTracingPhase is happening before the call logging is done.
Is there any chance we can have the span (given by an external trace id through the request) active until the CallLogging phase is done?
My current workaround is to evaluate the MDC in case there is no active span, and the MDC is populated in an early phase manually. That works, but it's not the nicest thing I ever implemented :)
Thank you in advance!
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.