Skip to content

Add optional OpenTelemetry instrumentation#37

Merged
justinabrahms merged 2 commits into
mainfrom
work/brave-platypus
Jan 22, 2026
Merged

Add optional OpenTelemetry instrumentation#37
justinabrahms merged 2 commits into
mainfrom
work/brave-platypus

Conversation

@justinabrahms
Copy link
Copy Markdown
Owner

Summary

Adds OpenTelemetry tracing to monitor sync operation performance. The instrumentation is completely optional and only activates when OTEL environment variables are configured.

Changes

  • Created otel package with optional initialization logic
  • Instrumented fetchActivity function with main sync span
  • Added per-user API operation spans (starred/owned repos, events)
  • Instrumented GitHub client pagination to show individual page fetches
  • Added Docker Compose setup for local testing with Jaeger
  • Comprehensive documentation in OTEL_SETUP.md

Features

  • Optional: Zero overhead when disabled (uses no-op tracer)
  • Easy to enable: Just set OTEL_EXPORTER_OTLP_ENDPOINT environment variable
  • Comprehensive spans: Tracks overall operation, per-user calls, and pagination
  • Works with any OTLP collector: Jaeger, Honeycomb, etc.

Testing

All existing tests pass. The instrumentation is transparent and doesn't change application behavior.

To test with local collector:
```bash
docker-compose up -d
export OTEL_EXPORTER_OTLP_ENDPOINT=localhost:4318
./gitstreams

Open http://localhost:16686 to view traces in Jaeger UI

```

Benefits

  • Monitor sync operation duration over time
  • Identify slow users or API calls
  • Understand pagination patterns
  • Debug performance issues

See OTEL_SETUP.md for full documentation.

justinabrahms and others added 2 commits January 22, 2026 11:27
Adds OpenTelemetry tracing to monitor sync operation performance:
- Traces overall fetchActivity operation with user count
- Spans for per-user API calls (starred/owned repos, events)
- Pagination instrumentation showing page fetches

Features:
- Optional: only enabled when OTEL_EXPORTER_OTLP_ENDPOINT is set
- Zero overhead when disabled (uses no-op tracer)
- Works with any OTLP-compatible collector (e.g., Jaeger)

Usage:
export OTEL_EXPORTER_OTLP_ENDPOINT=localhost:4318
./gitstreams

Includes:
- otel package for setup/initialization
- Docker Compose + config for local testing with Jaeger
- OTEL_SETUP.md with full documentation

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@justinabrahms justinabrahms added the multiclaude PR created by multiclaude worker label Jan 22, 2026
@justinabrahms justinabrahms merged commit fb561c7 into main Jan 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

multiclaude PR created by multiclaude worker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant