forked from mirror/redis
37 lines
860 B
Markdown
37 lines
860 B
Markdown
# Example for go-redis OpenTelemetry instrumentation
|
|
|
|
See
|
|
[Redis Monitoring Performance and Errors](https://redis.uptrace.dev/guide/redis-performance-monitoring.html)
|
|
for details.
|
|
|
|
This example requires Redis Server on port `:6379`. You can start Redis Server using Docker:
|
|
|
|
```shell
|
|
docker-compose up -d
|
|
```
|
|
|
|
You can run this example with different OpenTelemetry exporters by providing environment variables.
|
|
|
|
**Stdout** exporter (default):
|
|
|
|
```shell
|
|
go run .
|
|
```
|
|
|
|
**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)
|