-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Milestone
Description
Description
As a:
- [ X] Application user
- Specification implementer
...I need to be able to:
Mark an interface for a rest-client so that certain return codes trigger marking the span as failed
Something like
@WithSpan(errorOn={4xx,5xx})
@GET
@Path("/access/") // trailing slash is required by api
@Consumes("application/json")
@Produces("application/json")
RbacRaw getRbacInfo(@QueryParam("application") String application,...)
and then in the interceptor code do
Span span = SpanBuilder.startNew()
try {
statusCode = doRemoteCall();
if (statusCode matches withSpan.errorOn) {
span.setStatus(StatusCode.ERROR);
}
} catch (Exception e) {
span.setStatus(StatusCode.ERROR);
span.recordException(e);
} finally {
span.end();
}
...which enables me to: Get non-behaving remote client calls into the trace without manually wrap all the remote client calls into the mentioned code manually.