Skip to content

Commit 162f19a

Browse files
committed
docs: expand OpenTelemetry section in README.md with setup instructions for dockotlp, Grafana Cloud, and Jaeger
1 parent b4c2a9f commit 162f19a

File tree

1 file changed

+85
-1
lines changed

1 file changed

+85
-1
lines changed

README.md

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,89 @@ export RUST_LOG=debug
251251
export OTEL_RESOURCE_ATTRIBUTES='service.name=my-service,service.version=1.0.0'
252252
```
253253

254+
### OpenTelemetry
255+
256+
All observability backends use the standard OTLP (OpenTelemetry Protocol) for data export. You can choose from the following options:
257+
258+
#### 1: dockotlp (Self-Hosted Grafana Stack)
259+
260+
[dockotlp](https://github.com/iamnivekx/dockotlp) provides a complete self-hosted observability stack with Grafana, Prometheus, Loki, Tempo, OpenTelemetry Collector, and more.
261+
262+
Perfect for self-hosted deployments where you want full control over your observability infrastructure.
263+
264+
**Quick Start:**
265+
266+
Follow the [dockotlp Quick Start guide](https://github.com/iamnivekx/dockotlp?tab=readme-ov-file#quick-start) to set up the stack.
267+
268+
**Configure your application:**
269+
270+
```bash
271+
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
272+
export OTEL_EXPORTER_OTLP_PROTOCOL=grpc
273+
```
274+
275+
#### 2: Grafana Cloud
276+
277+
**Setup:**
278+
279+
```bash
280+
# Grafana Cloud OTLP endpoint (replace with your region and instance URL)
281+
export OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp-gateway-prod-<region>.grafana.net/otlp
282+
283+
# Use HTTP/Protobuf protocol for Grafana Cloud
284+
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
285+
286+
# Authentication header (Basic auth with instance ID and API token)
287+
# Format: Authorization=Basic <base64(instanceId:apiToken)>
288+
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic <your-base64-credentials>"
289+
```
290+
291+
**Getting Grafana Cloud Credentials:**
292+
293+
1. Log in to your Grafana Cloud account
294+
2. Navigate to **Connections****OpenTelemetry**
295+
3. Copy the **OTLP Endpoint URL** and **Basic Auth** credentials
296+
4. Set the environment variables as shown above
297+
298+
**Example `.env` file for Grafana Cloud:**
299+
300+
```bash
301+
OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
302+
OTEL_EXPORTER_OTLP_ENDPOINT="https://otlp-gateway-prod-ap-southeast-1.grafana.net/otlp"
303+
OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic <your-base64-credentials>"
304+
OTEL_RESOURCE_ATTRIBUTES="service.name=my-service,service.version=1.0.0"
305+
RUST_LOG=info
306+
```
307+
308+
**Note:** Replace `<your-base64-credentials>` with your actual Base64-encoded credentials from Grafana Cloud. The format is `Base64(instanceId:apiToken)`.
309+
310+
#### Option 3: Jaeger
311+
312+
[Jaeger](https://www.jaegertracing.io/) is a popular open-source distributed tracing system, originally developed by Uber. It provides:
313+
- **Distributed Tracing** - End-to-end request tracing
314+
- **Jaeger UI** - Web-based trace visualization
315+
- **Multiple Storage Backends** - Supports various storage options (Elasticsearch, Cassandra, etc.)
316+
317+
Great for teams already using Jaeger or preferring its specific features.
318+
319+
**Setup:**
320+
321+
```bash
322+
# Start Jaeger All-in-One (includes collector, query, and UI)
323+
docker run -d \
324+
-p 6831:6831/udp \
325+
-p 6832:6832/udp \
326+
-p 16686:16686 \
327+
-p 4317:4317 \
328+
jaegertracing/all-in-one:latest
329+
330+
# Configure your application
331+
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
332+
export OTEL_EXPORTER_OTLP_PROTOCOL=grpc
333+
```
334+
335+
**Access Jaeger UI:** http://localhost:16686
336+
254337
### Sampling Configuration
255338

256339
```rust
@@ -332,4 +415,5 @@ at your option.
332415
- [Crates.io](https://crates.io/crates/tracing-otel-extra)
333416
- [GitHub Repository](https://github.com/iamnivekx/tracing-otel-extra)
334417
- [OpenTelemetry](https://opentelemetry.io/)
335-
- [Axum Framework](https://github.com/tokio-rs/axum)
418+
- [Axum Framework](https://github.com/tokio-rs/axum)
419+
- [dockotlp](https://github.com/iamnivekx/dockotlp)

0 commit comments

Comments
 (0)