Skip to content

feat: integrate OpenTelemetry tracing into collector#147

Merged
d0ugal merged 5 commits intomainfrom
integrate-tracing
Oct 29, 2025
Merged

feat: integrate OpenTelemetry tracing into collector#147
d0ugal merged 5 commits intomainfrom
integrate-tracing

Conversation

@d0ugal
Copy link
Copy Markdown
Owner

@d0ugal d0ugal commented Oct 29, 2025

Integrate OpenTelemetry Tracing into Collector

This PR adds full OpenTelemetry tracing integration to the ghcr-exporter collector.

🚀 Changes

  • GHCRCollector: Added tracing spans for each package collection cycle

    • Span attributes include: package name, owner, repo, interval
    • Duration tracking in spans
    • Error recording for failed collections
    • Collection completion events
  • Main.go: Updated to pass app instance to collector for tracing access

  • Tests: Updated all tests to include app parameter

📊 Tracing Features

Each collection cycle now creates a span with:

  • Package metadata (name, owner, repo, interval)
  • Collection duration
  • Success/failure status
  • Error details (when applicable)

🧪 Testing

  • Builds Successfully: All dependencies resolved
  • Tests Pass: All unit and integration tests updated and passing
  • Tracing Integration: Spans created for collection operations
  • Ready for Testing: Test with docker-compose.dev.yaml

📝 Usage

Tracing is automatically enabled when configured via environment variables:

environment:
  - TRACING_ENABLED=true
  - TRACING_SERVICE_NAME=ghcr-exporter
  - TRACING_ENDPOINT=http://your-otel-collector:4318/v1/traces

Ready for review and merge! 🎯

d0ugal and others added 5 commits October 29, 2025 11:47
- Added app reference to GHCRCollector
- Added tracing spans for each package collection cycle
- Spans include package name, owner, repo, interval, and duration
- Error recording in spans for failed collections
- Updated main.go to pass app instance to collector
- Updated tests to include app parameter
@d0ugal d0ugal enabled auto-merge (rebase) October 29, 2025 12:07
@d0ugal d0ugal merged commit a8c59e4 into main Oct 29, 2025
7 checks passed
@d0ugal d0ugal deleted the integrate-tracing branch October 29, 2025 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant