2022-05-11 15:39:36 +01:00
|
|
|
---
|
|
|
|
title: Setup
|
|
|
|
parent: OpenTracing
|
|
|
|
grand_parent: Development
|
|
|
|
permalink: /development/opentracing/setup
|
|
|
|
---
|
2020-08-27 10:24:56 +01:00
|
|
|
|
2022-05-11 15:39:36 +01:00
|
|
|
# OpenTracing Setup
|
2020-08-27 10:24:56 +01:00
|
|
|
|
|
|
|
Dendrite uses [Jaeger](https://www.jaegertracing.io/) for tracing between microservices.
|
|
|
|
Tracing shows the nesting of logical spans which provides visibility on how the microservices interact.
|
|
|
|
This document explains how to set up Jaeger locally on a single machine.
|
|
|
|
|
2022-05-11 15:39:36 +01:00
|
|
|
## Set up the Jaeger backend
|
2020-08-27 10:24:56 +01:00
|
|
|
|
|
|
|
The [easiest way](https://www.jaegertracing.io/docs/1.18/getting-started/) is to use the all-in-one Docker image:
|
2022-05-11 15:39:36 +01:00
|
|
|
|
2020-08-27 10:24:56 +01:00
|
|
|
```
|
|
|
|
$ 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 14250:14250 \
|
|
|
|
-p 9411:9411 \
|
|
|
|
jaegertracing/all-in-one:1.18
|
|
|
|
```
|
|
|
|
|
2022-05-11 15:39:36 +01:00
|
|
|
## Configuring Dendrite to talk to Jaeger
|
2020-08-27 10:24:56 +01:00
|
|
|
|
|
|
|
Modify your config to look like: (this will send every single span to Jaeger which will be slow on large instances, but for local testing it's fine)
|
2022-05-11 15:39:36 +01:00
|
|
|
|
2020-08-27 10:24:56 +01:00
|
|
|
```
|
|
|
|
tracing:
|
|
|
|
enabled: true
|
|
|
|
jaeger:
|
|
|
|
serviceName: "dendrite"
|
|
|
|
disabled: false
|
|
|
|
rpc_metrics: true
|
|
|
|
tags: []
|
|
|
|
sampler:
|
|
|
|
type: const
|
|
|
|
param: 1
|
|
|
|
```
|
|
|
|
|
2023-02-14 11:47:47 +00:00
|
|
|
then run the monolith server:
|
2022-05-11 15:39:36 +01:00
|
|
|
|
2020-08-27 10:24:56 +01:00
|
|
|
```
|
2023-02-14 11:47:47 +00:00
|
|
|
./dendrite-monolith-server --tls-cert server.crt --tls-key server.key --config dendrite.yaml
|
2020-08-27 10:24:56 +01:00
|
|
|
```
|
|
|
|
|
2022-05-11 15:39:36 +01:00
|
|
|
## Checking traces
|
2020-08-27 10:24:56 +01:00
|
|
|
|
2022-05-11 15:39:36 +01:00
|
|
|
Visit <http://localhost:16686> to see traces under `DendriteMonolith`.
|