...
The actual invocation of the request by the client (with service name tracer-client) and consequent invocation of the service on the server side (service name traceser-server) is going to generate the following sample traces (taken from Jaeger UI):
Info |
---|
Please notice that timelines are treated as logs events in Jaeger. |
...
Most of the distributed tracers compatible with OpenTracing API could be deployed into OSGi container and as such, the integration is fully available for Apache CXF services running inside the container. For a complete example please take a look on jax_rs_tracing_opentracing_osgi sample project, but here is the typical OSGi Blueprint snippet in case of Jaeger.
Code Block | ||
---|---|---|
| ||
<?xml version="1.0" encoding="UTF-8"?> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cxf="http://cxf.apache.org/blueprint/core" xmlns:jaxrs="http://cxf.apache.org/blueprint/jaxrs" xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/blueprint/jaxrs.xsd"> <bean id="tracingFeature" class="org.apache.cxf.tracing.opentracing.jaxrs.OpenTracingFeature"> <argument index="0"> <bean factory-ref="builder" factory-method="build" /> </argument> </bean> <bean id="metrics" class="com.uber.jaeger.metrics.Metrics"> <argument index="0"> <bean class="com.uber.jaeger.metrics.StatsFactoryImpl"> <argument index="0"> <bean class="com.uber.jaeger.metrics.NullStatsReporter" /> </argument> </bean> </argument> </bean> <bean id="builder" class="com.uber.jaeger.Tracer.Builder"> <argument index="0" value="cxf-server" /> <argument index="1"> <bean class="com.uber.jaeger.reporters.RemoteReporter"> <argument index="0" ref="sender" /> <argument index="1" value="1000"/> <argument index="2" value="100"/> <argument index="3" ref="metrics"/> </bean> </argument> <argument index="2"> <bean class="com.uber.jaeger.samplers.ConstSampler"> <argument index="0" value="true" /> </bean> </argument> </bean> <bean id="sender" class="com.uber.jaeger.senders.HttpSender"> <argument index="0" value="http://localhost:14268/api/traces" /> </bean> <cxf:bus> <cxf:features> <cxf:logging /> </cxf:features> </cxf:bus> <jaxrs:server id="catalogServer" address="/"> <jaxrs:serviceBeans> ... </jaxrs:serviceBeans> <jaxrs:providers> <ref component-id="tracingFeature" /> </jaxrs:providers> </jaxrs:server> </blueprint> |
...
Most of the distributed tracers compatible with OpenTracing API could be deployed into OSGi container and as such, the integration is fully available for Apache CXF services running inside the container. For a complete example please take a look on jax_rs_tracing_opentracing_osgi sample project, but here is the typical OSGi Blueprint snippet in case of Jaeger.
...
- https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/tracing_opentracing
- https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/tracing_opentracing_camel
- https://github.com/apache/cxf/tree/master3.6.x-fixes/distribution/src/main/release/samples/jax_rs/tracing_opentracing_osgi
Accessing OpenTracing APIs
...