Document updated on Feb 3, 2023
Since | v0.5 |
---|---|
Namespace | telemetry/opencensus |
Log prefix | [SERVICE: Opencensus] |
Scope | service |
Source | krakend/krakend-opencensus |
The KrakenD exporter to Jaeger allows you to submit spans to a Jaeger Collector (HTTP) or Jaeger Agent (UDP) automatically.
Jaeger is an open-source, end-to-end distributed tracing system that allows you to monitor and troubleshoot transactions in complex distributed systems. Use Jaeger when you want to see the complete flow of a user request through KrakenD and its connected services.
The Opencensus Jaeger exporter allows you to export spans to Jaeger. Enabling it only requires you to add the jaeger
exporter in the opencensus module. You can post spans using two different approaches:
agent_endpoint
endpoint
You can test this setup by running the All in One official Jaeger image and opening the necessary ports. For instance, to run a Jaeger container for UDP and HTTP support do:
$docker run -d --name jaeger -e COLLECTOR_ZIPKIN_HTTP_PORT=9411 \
-p 5775:5775/udp -p 6831:6831/udp -p 6832:6832/udp \
-p 5778:5778 -p 16686:16686 -p 14268:14268 -p 9411:9411 \
jaegertracing/all-in-one:latest
Then use agent_endpoint
pointing to jaeger:6831
for the Jaeger Agent (UDP) or endpoint
pointing to http://jaeger:14268
for the Jaeger Collector (HTTP).
When you don’t have a Jaeger Agent deployed next to the application, you can submit all spans to a Jaeger Collector over HTTP/HTTPS somewhere else. To do that, use the endpoint
configuration option inside jaeger
, as follows:
{
"extra_config":{
"telemetry/opencensus": {
"sample_rate": 100,
"reporting_period": 0,
"exporters": {
"jaeger": {
"endpoint": "http://jaeger:14268/api/traces",
"service_name":"krakend",
"buffer_max_count": 1000
}
}
}
}
}
You can find a running demo with Jaeger using docker-compose on KrakenD Playground.
When you want to send spans to a Jaeger Agent locally over UDP in Thrift format, you need to use the agent_endpoint
configuration. To configure the gateway to work with an agent, you will need the following:
{
"extra_config":{
"telemetry/opencensus": {
"sample_rate": 100,
"reporting_period": 0,
"exporters": {
"jaeger": {
"agent_endpoint": "jaeger:6831",
"service_name":"krakend",
"buffer_max_count": 1000
}
}
}
}
}
As with all OpenCensus exporters, you can add optional settings in the telemetry/opencensus
level:
"telemetry/opencensus"
| Lets you specify what data you want to export. All layers are enabled by default unless you declare this section.
| ||||||
| The number of seconds passing between reports. If duration is less than or equal to zero, it enables the default behavior of each exporter. Defaults to 0 | ||||||
| A number between 0 (no requests at all) and 100 (all requests) representing the percentage of sampled requests you want to send to the exporter. Sampling the 100% of the requests is generally discouraged when the relationship between traffic and dedicated resources is sparse. Defaults to 0 |
Then, the exporters
key must contain the jaeger
entry with the following properties:
"telemetry/opencensus": { "exporters":{} }
| Submit spans to a Jaeger Collector (HTTP) with endpoint or to a Jaeger Agent (UDP) with agent_endpoint .* Required one of: ( endpoint
+
service_name
)
, or
(
agent_endpoint
+
service_name
)
|
The documentation is only a piece of the help you can get! Whether you are looking for Open Source or Enterprise support, see more support channels that can help you.