-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into widget/chain-update
- Loading branch information
Showing
31 changed files
with
1,123 additions
and
79 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package metrics | ||
|
||
import ( | ||
"context" | ||
"go.opentelemetry.io/otel/metric" | ||
"time" | ||
) | ||
|
||
// standardMetrics records metrics across any service using the metrics handler. | ||
type standardMetrics struct { | ||
metrics Handler | ||
meter metric.Meter | ||
uptimeGauge metric.Float64ObservableGauge | ||
startTime time.Time | ||
} | ||
|
||
const processUptimeSecondsMetric = "process_uptime_seconds" | ||
|
||
func newStandardMetrics(ctx context.Context, handler Handler) { | ||
str := standardMetrics{ | ||
metrics: handler, | ||
meter: handler.Meter("standard_metrics"), | ||
startTime: time.Now(), | ||
} | ||
|
||
var err error | ||
if str.uptimeGauge, err = str.meter.Float64ObservableGauge(processUptimeSecondsMetric, metric.WithDescription("The uptime of the process in seconds"), metric.WithUnit("seconds")); err != nil { | ||
handler.ExperimentalLogger().Errorf(ctx, "failed to create %s gauge: %v", processUptimeSecondsMetric, err) | ||
} | ||
|
||
// Register callback | ||
if _, err = str.meter.RegisterCallback(str.uptimeCallback, str.uptimeGauge); err != nil { | ||
handler.ExperimentalLogger().Warnf(ctx, "failed to register callback: %v", err) | ||
} | ||
} | ||
|
||
func (str *standardMetrics) uptimeCallback(_ context.Context, observer metric.Observer) error { | ||
uptimeDuration := time.Since(str.startTime).Seconds() | ||
observer.ObserveFloat64(str.uptimeGauge, uptimeDuration) | ||
return nil | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,14 @@ | |
All notable changes to this project will be documented in this file. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
|
||
## [0.4.5](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2024-10-21) | ||
|
||
**Note:** Version bump only for package @synapsecns/bridge-docs | ||
|
||
|
||
|
||
|
||
|
||
## [0.4.4](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2024-10-15) | ||
|
||
**Note:** Version bump only for package @synapsecns/bridge-docs | ||
|
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,22 @@ | |
All notable changes to this project will be documented in this file. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
|
||
## [0.9.3](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2024-10-24) | ||
|
||
**Note:** Version bump only for package @synapsecns/contracts-rfq | ||
|
||
|
||
|
||
|
||
|
||
## [0.9.2](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2024-10-22) | ||
|
||
**Note:** Version bump only for package @synapsecns/contracts-rfq | ||
|
||
|
||
|
||
|
||
|
||
## [0.9.1](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2024-10-18) | ||
|
||
**Note:** Version bump only for package @synapsecns/contracts-rfq | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
480 |
Oops, something went wrong.