MicroProfile OpenTracing 1.3

With MicroProfile OpenTracing 1.3, we can get more targeted tracing results and more easily correlate tracing requests with the application URL. Stabilized features: The MicroProfile OpenTracing 1.3 feature is stabilized. The strategic alternative is mpTelemetry-1.0, a MicroProfile Telemetry feature.

See the MicroProfile OpenTracing to MicroProfile Telemetry 1.0 migration document.

MicroProfile OpenTracing version 1.3 introduces a new operation name format and the ability to exclude server-side tracing.

    Excluding server-side tracing

    Server-side tracing can be excluded by specifying a skip pattern. We might want to exclude some trace information so that you get tracing for specific things. In that case, we might choose to exclude server-side tracing to reduce the number of spans created.

    Operation name

    The following operation name format makes it easier to correlate with the request URL:<@path value of endpoint's class>/<@path value of endpoint's method>

  • Define the skip pattern using the MicroProfile Config version 1.3 specification. The configuration key is mp.opentracing.ser ver.skip-pattern. The value is a regular expression that complies with java.util.regex.Pattern. If UriInfo.getPath() of the incoming server URL matches with the regular expression, this request is excluded from tracing.

    1. One way to define the skip pattern is to add it to server.env file. If the operating systems do not allow you to use characters such as dot (.) and dash (-) in the environment names, then we can substitute those characters with an underscore (_). For example, add mp_opentracing_server_skip_pattern=/inventory.* to the server.env file to exclude server-side tracing of the URL that matches /inventory.*.

  • To use the operation name format, set a MicroProfile Config version 1.3 compliant configuration key, mp.opentracing.server.operation-name-provider, to http-path. The default value is class-method. For example, add mp_opentracing_server_operation_name_provider=http-path to the server.env file to change the operation name to the new format.