Gravitee's OpenTracing solution with Jaeger allows you to trace every request that comes through the API Management (APIM) Gateway. This provides enhanced monitoring capabilities, such as in-depth visibility into API policies and requests across multiple services, and simplifies debugging.
This page describes how to:
To enable OpenTracing on APIM Gateway, add the following to the gravitee.yaml file:
tracing:
enabled: true
type: jaeger
jaeger:
host: localhost
port: 14250
To test OpenTracing in Docker:
-
Use the Docker run command for installing Jaeger with no customizations:
{% code overflow="wrap" %}
docker run -d --name jaeger \ -p 5775:5775/udp \ -p 6831:6831/udp \ -p 6832:6832/udp \ -p 5778:5778 \ -p 16686:16686 \ -p 14268:14268 \ -p 14250:14250 \ -p 9411:9411 \ jaegertracing/all-in-one:1.24
{% endcode %}
{% hint style="info" %} Running this Docker command will also provide access to the JaegerUI, which can be reached on its default port:
http://localhost:16686
{% endhint %} -
Confirm Jaeger has been enabled and is running by checking Docker
-
Install the .ZIP file for the Jaeger tracer plugin:
- Since the Jaeger tracer is not bundled by default, click here to download it
- Add the plugin for the Gravitee Jaeger tracer .ZIP file to the configuration of your APIM Gateway instance
-
Run your API Gateway and APIM.
-
Open Gravitee APIM and choose an API with a policy assigned to it
-
Call your API
-
To see your calls:
-
Open JaegerUI by visiting
http://localhost:16686
(note that JaegerUI was automatically installed earlier in the process) -
Select Search and find the API you called
See API calls using JaegerUI
Each policy traversed is listed on a different line to provide greater visibility and assist with debugging. Timestamp info is included in the detailed view.
Timestamp information in the detailed view
-
Configure environment variables as needed in the Jaeger Gateway. For example:
gravitee_service_tracing_enabled: true
gravitee_services_tracing_jaegar_host: localhost
gravitee_services_tracing_jaeger_port: 14250
To enable OpenTracing using Jaeger as a tracer, use this docker-compose.yml
.
With this option enabled, you can continue to call your APIs through your Gateway with the usual host: http://localhost:8082/myapi
.
-
Since the Jaeger tracer is not bundled by default, you must download the .ZIP file for the version you want to run here
-
Copy the .ZIP into the
opentracing-jaeger/.plugins
directory:APIM_VERSION={APIM_VERSION} docker-compose up -d
-
Fetch the last version of images:
export APIM_VERSION={APIM_VERSION} && docker-compose down -v && docker-compose pull && docker-compose up