-
Notifications
You must be signed in to change notification settings - Fork 344
Add possibility to set the operation name after the span has been created #48
Comments
@felixbarny the APIs in the other languages do have |
Is it possible to create a span without a name in other languages like Yes, I'd like to craft a pull request for that. |
Span name is always required, but if it needs to be set later you can pass empty string to the builder. |
Some more questions: Why are there no getters defined in span? For example to get the operation name and to get logs. Can jaeger-core be seen as something like basictracer-java? |
Because there is no production use case for this. Think about slf4j, does it have getters? Same with span, it's essentially a write-only API (except for baggage). The only time you need getters is in unit tests, and for that the mock tracers do support getters. In fact many implementations might support getters (e.g. basictracer-go), but you need to downcast from the top-level Span interface.
Umm, this is a very broad statement so I am inclined to say no. |
One use case where the client might want to access the tags the tracing library has created is when the lib parses the |
Also, when implementing a reporter, you always have downcast to a specific implementation. |
I've just realized that reporting a span is always implementation specific because there is no |
I'm currently evaluating to use opentracing/jaeger as the foundation of stagemonitor and this is one of the things I've stumbled upon:
As of now, the operation name has to be provided in order to create a span:
The problem is that you often don't know the operation name when a HTTP request has just arrived. Setting the operation name to the URL may be sufficient in some cases but as soon as you have url schemes like
/item/{itemNumber}
you probably want to group them together.Stagemonitor instruments Spring MVC and JAX-RS to derive the operation name from the controller method. For example
Results in an operation name like
Show Item Details
orItemControler#showItemDetails
. Users also may choose to set the operation name at any time in stagemonitor. Note that the Span does not start at the controller method but as soon as the HTTP request hits the topmost servletFilter
.So I think it would be a useful addition to be able to set the operation name after the start of the span.
The text was updated successfully, but these errors were encountered: