redis/example/otel/README.md

35 lines
833 B
Markdown
Raw Permalink Normal View History

2021-09-08 15:54:10 +03:00
# Example for go-redis OpenTelemetry instrumentation
2021-11-05 17:17:17 +03:00
See [Monitoring performance and errors](https://redis.uptrace.dev/guide/tracing.html) for details.
This example requires Redis Server on port `:6379`. You can start Redis Server using Docker:
2021-09-08 15:54:10 +03:00
```shell
docker-compose up -d
```
2021-11-05 17:17:17 +03:00
You can run this example with different OpenTelemetry exporters by providing environment variables.
**Stdout** exporter (default):
2021-09-08 15:54:10 +03:00
```shell
go run .
```
2021-11-05 17:17:17 +03:00
**Jaeger** exporter:
```shell
OTEL_EXPORTER_JAEGER_ENDPOINT=http://localhost:14268/api/traces go run .
```
**Uptrace** exporter:
```shell
UPTRACE_DSN="https://<token>@uptrace.dev/<project_id>" go run .
```
## Links
- [Find instrumentations](https://opentelemetry.uptrace.dev/instrumentations/?lang=go)
- [OpenTelemetry Tracing API](https://opentelemetry.uptrace.dev/guide/go-tracing.html)