OpenTelemetry building blocks to instrument KrakenD and Lura based API Gateways.
Documentation:
For a quick look at the observability the library can provide, check the example documentation.
Configuration from Lura's ServiceConfig
In order to configure the open telemetry stack to instrument the API Gateway, a
new entry must be added to the ExtraConfig
root propertry of ServiceConfig
using the telemetry/opentelemetry
key, with the krakend-otel
's configuration.
See the configuration of the component.
In a visual way, this is the relation between the exporters
configuration, and
how we select as metric_providers
or trace_providers
:
The most up to date documentation about the different supported layers, and the produced metrics and traces is available in the Understanding OpenTelemetry layers and metrics documentation.
We can differentiate the processing of a request in KrakenD in 3 main stages (each one including or wrapping the inner stage):
-
global
: this part that comes before theLura
's framework starts working with the request. In the case of KrakenD CE, this stage is implemented using gin. See the Data exposed in the global layer and its configuration options -
proxy
: this is theLura
's framework part where it deals with one of the API Gateway exposed endpoints, and includes spawning the required requests to the backends, as well as the manipulation at the endpoint level before and after the requests are performed. See the Data exposed in the proxy layer and its configuration options -
backend
: this is theLura
's framework part where it deals with each single backend request (including the manipulation at that request level). See the Data exposed in the backend layer and its configuration options
- Check the example documentation
- Some notes about current implementation