2022-01-23 09:36:24 +02:00
|
|
|
# Example for go-clickhouse OpenTelemetry instrumentation
|
|
|
|
|
2022-06-20 10:03:17 +03:00
|
|
|
To run this example, you need to create `test` ClickHouse database:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
clickhouse-client -q "CREATE DATABASE test"
|
|
|
|
```
|
2022-01-23 09:36:24 +02:00
|
|
|
|
|
|
|
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](https://github.com/uptrace/uptrace) exporter:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
UPTRACE_DSN="https://<token>@uptrace.dev/<project_id>" go run .
|
|
|
|
```
|
|
|
|
|
2022-06-20 10:03:17 +03:00
|
|
|
See
|
|
|
|
[Performance and errors monitoring](https://clickhouse.uptrace.dev/guide/clickhouse-monitoring-performance.html)
|
|
|
|
for details.
|
|
|
|
|
2022-01-23 09:36:24 +02:00
|
|
|
## Links
|
|
|
|
|
|
|
|
- [Find instrumentations](https://opentelemetry.uptrace.dev/instrumentations/?lang=go)
|
|
|
|
- [OpenTelemetry Go Tracing API](https://opentelemetry.uptrace.dev/guide/go-tracing.html)
|