Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ Example screenshot of OTEL tracing captured and shown in Jeager UI:

Type `make install-dependencies` to retrieve Go packages needed by the project.

### Configuration

Open telemetry sampling rate can be configured by setting the `OTEL_SAMPLING_RATE`
environmental variable from 0.0 to 1.0.
0.0 means no tracing and 1.0 means include all traces.
Value is measured in percents.
Therefore 0.5 means 50% of the samples will be collected.

### Demoing usage

```bash
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ services:
volumes:
- ./otel-collector.yaml:/etc/otel-collector.yaml
ports:
- 4317:4317
- 127.0.0.1:4317:4317

prometheus:
image: prom/prometheus:v3.1.0
volumes:
- ./prometheus.yaml:/etc/prometheus/prometheus.yml
ports:
- 9090:9090
- 127.0.0.1:9090:9090

jaeger:
image: jaegertracing/all-in-one:1.60
ports:
- 16686:16686
- 127.0.0.1:16686:16686
1 change: 1 addition & 0 deletions pkg/tracer/otel.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ func (o *OtelTracerMetrics) defaultTracerProvider(ctx context.Context) error {
}

samplingRate := getSamplerFromEnv()
l.Logger.Info().Msgf("Set OTEL sampling rate to %.2f", samplingRate)

// Register the trace exporter with a TracerProvider, using a batch
// span processor to aggregate spans before export.
Expand Down