Skip to content

Allow to mark REST-Client code as failure #35

@pilhuhn

Description

@pilhuhn

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions