mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 01:32:25 -05:00
[chore] Add Go runtime and host metrics (#4137)
Daenney is a dummy and forgot to add these when he revamped the OTEL stuff. Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4137 Co-authored-by: Daenney <daenney@noreply.codeberg.org> Co-committed-by: Daenney <daenney@noreply.codeberg.org>
This commit is contained in:
parent
4a6b357501
commit
90a5425fe9
14 changed files with 1124 additions and 0 deletions
|
|
@ -29,6 +29,7 @@ import (
|
|||
"github.com/gin-gonic/gin"
|
||||
"github.com/technologize/otel-go-contrib/otelginmetrics"
|
||||
"go.opentelemetry.io/contrib/exporters/autoexport"
|
||||
"go.opentelemetry.io/contrib/instrumentation/runtime"
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/metric"
|
||||
sdk "go.opentelemetry.io/otel/sdk/metric"
|
||||
|
|
@ -59,6 +60,12 @@ func InitializeMetrics(ctx context.Context, db db.DB) error {
|
|||
|
||||
otel.SetMeterProvider(meterProvider)
|
||||
|
||||
if err := runtime.Start(
|
||||
runtime.WithMeterProvider(meterProvider),
|
||||
); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
meter := meterProvider.Meter(serviceName)
|
||||
|
||||
thisInstance := config.GetHost()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue