Skip to content

[!] add OpenTelemetry tracing and metrics support#768

Open
pashagolub wants to merge 4 commits into
masterfrom
add-otel
Open

[!] add OpenTelemetry tracing and metrics support#768
pashagolub wants to merge 4 commits into
masterfrom
add-otel

Conversation

@pashagolub

Copy link
Copy Markdown
Collaborator
  • Add OTelOpts config struct
  • Add internal/otel package: Provider, Tracer, Meter, Shutdown, Noop
  • Add 5 metric instruments
  • Instrument executeChain and executeTask with spans and metrics
  • Wire real provider in main.go with graceful shutdown
  • ValidateOTel() validates endpoint scheme, ratio, and timeouts
  • Protocol auto-detected from URL scheme (grpc:// vs http(s)://)
  • Headers are YAML-only (prevents secrets in shell history)
  • Fallback to Noop provider on init failure

- Add `OTelOpts` config struct
- Add `internal/otel` package: Provider, Tracer, Meter, Shutdown, Noop
- Add 5 metric instruments
- Instrument `executeChain` and `executeTask` with spans and metrics
- Wire real provider in `main.go` with graceful shutdown
- `ValidateOTel()` validates endpoint scheme, ratio, and timeouts
- Protocol auto-detected from URL scheme (grpc:// vs http(s)://)
- Headers are YAML-only (prevents secrets in shell history)
- Fallback to `Noop` provider on init failure
@pashagolub pashagolub self-assigned this Jun 10, 2026
@pashagolub pashagolub added enhancement New feature or request documentation Good for newcomers epic Large body of work broken down into a number of smaller issues labels Jun 10, 2026
@coveralls

coveralls commented Jun 10, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 27361355738

Coverage decreased (-0.6%) to 89.778%

Details

  • Coverage decreased (-0.6%) from the base build.
  • Patch coverage: 33 uncovered changes across 5 files (236 of 269 lines covered, 87.73%).
  • 9 coverage regressions across 2 files.

Uncovered Changes

File Changed Covered %
internal/otel/otel.go 139 127 91.37%
internal/otel/metrics.go 59 49 83.05%
main.go 13 8 61.54%
internal/config/config.go 23 19 82.61%
internal/scheduler/chain.go 33 31 93.94%
Total (6 files) 269 236 87.73%

Coverage Regressions

9 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
internal/pgengine/log_hook.go 6 81.08%
internal/scheduler/chain.go 3 86.06%

Coverage Stats

Coverage Status
Relevant Lines: 2250
Covered Lines: 2020
Line Coverage: 89.78%
Coverage Strength: 1.02 hits per line

💛 - Coveralls

@0xgouda 0xgouda left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am testing this and noticed that there are no INFO log messages for metrics/traces collection or upload, which in my opinion is nice to have to be able to confirm that things are working as expected and maybe help in deubgging in some scenarios.

@0xgouda 0xgouda left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking Out Loud: How can one configure 2 different endpoints, one for trace exportation and one for metrics?

@pashagolub

Copy link
Copy Markdown
Collaborator Author

no INFO log messages for metrics/traces collection or upload

What? In what way log messages are connected to metrics and traces? What am I missing here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Good for newcomers enhancement New feature or request epic Large body of work broken down into a number of smaller issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants