redis/example/otel/README.md

37 lines
860 B
Markdown
Raw Normal View History

2021-09-08 15:54:10 +03:00
# Example for go-redis OpenTelemetry instrumentation
2022-04-13 15:53:17 +03:00
See
[Redis Monitoring Performance and Errors](https://redis.uptrace.dev/guide/redis-performance-monitoring.html)
for details.
2021-11-05 17:17:17 +03:00
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)