chore: wire OpenTelemetry collector URL into staging deploy#174
Merged
chore: wire OpenTelemetry collector URL into staging deploy#174
Conversation
|
Go Test coverage is 53.3 %\ ✨ ✨ ✨ |
mpetrun5
reviewed
Apr 20, 2026
Collaborator
mpetrun5
left a comment
There was a problem hiding this comment.
I think we should also add relayerID and env variables.
|
Go Test coverage is 53.3 %\ ✨ ✨ ✨ |
mpetrun5
approved these changes
Apr 20, 2026
4 tasks
mpetrun5
pushed a commit
that referenced
this pull request
Apr 28, 2026
## Summary
Adds `metric.WithUnit("s")` to the four `Float64Histogram`s in
`MpcMetrics`:
- `relayer.SessionTime` (PR #143)
- `relayer.InitiateTime` (PR #171)
- `relayer.CommSendTime` (PR #171)
- `relayer.CommDnsResolveTime` (PR #171)
## Why
`sygma-core` registers a sub-second bucket view in
`observability.InitMetricProvider`:
```go
// observability/metrics.go (initSecondView)
sdkmetric.NewView(
sdkmetric.Instrument{Unit: "s"},
sdkmetric.Stream{Aggregation: aggregation.ExplicitBucketHistogram{
Boundaries: []float64{1e-6, 1e-5, 1e-4, 1e-3, 0.005, 0.01, 0.05, 0.1, 0.5, 1, 5, 10, 100, 1000, 10000},
}},
)
```
The view is keyed by `Instrument{Unit: "s"}`. The histograms in
`metrics/mpc.go` declared a description but no unit, so the view never
matched and the SDK fell back to OTel's default histogram boundaries
`[5, 10, 25, 50, ..., 10000]` — which are tuned for milliseconds.
Signing-phase durations (sub-second to a few seconds) collapse into the
`le=5` bucket, making `histogram_quantile` return values pinned to
bucket boundaries rather than real percentiles.
Values are already recorded in seconds via `d.Seconds()`, so no math
changes — only bucketing.
## Grafana query change
The OTLP→Prometheus exporter appends a `_seconds` suffix when the
instrument carries `Unit: "s"`. After this PR, dashboard queries change:
| Before | After |
|---|---|
| `relayer_SessionTime_bucket` | `relayer_SessionTime_seconds_bucket` |
| `relayer_InitiateTime_bucket` | `relayer_InitiateTime_seconds_bucket`
|
| `relayer_CommSendTime_bucket` | `relayer_CommSendTime_seconds_bucket`
|
| `relayer_CommDnsResolveTime_bucket` |
`relayer_CommDnsResolveTime_seconds_bucket` |
In practice no dashboards depend on the old names yet — the OTel
collector URL was only wired into staging in #174, so historical data is
empty.
## Test plan
- [x] `go build ./...` clean
- [x] `go test ./metrics/... ./tss/... ./comm/p2p/...` pass
- [ ] After deploy, confirm `relayer_SessionTime_seconds_count` and the
three new `_seconds_count` series are non-empty in Grafana
- [ ] Confirm `histogram_quantile(0.95, ...)` returns values that vary
with workload rather than snapping to bucket boundaries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SYG_RELAYER_OPENTELEMETRYCOLLECTORURLto all three relayers indocker-compose.staging.yml.env.staging.templateand the staging Portainer deploy workflow (sourced fromsecrets.SYG_RELAYER_OPENTELEMETRYCOLLECTORURL, added to the envsubst allowlist)Test plan
SYG_RELAYER_OPENTELEMETRYCOLLECTORURLsecret in thestagingGitHub environment