From 3e8d49c0c06ea880a78fc1dda8e02ed20bd59a1d Mon Sep 17 00:00:00 2001 From: William Perron Date: Wed, 7 Feb 2024 21:57:31 -0500 Subject: [PATCH] add service name attribute and fix context for flush --- cmd/themis-server/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/themis-server/main.go b/cmd/themis-server/main.go index 0e04d9f..e7769f4 100644 --- a/cmd/themis-server/main.go +++ b/cmd/themis-server/main.go @@ -26,6 +26,7 @@ import ( "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/sdk/resource" sdktrace "go.opentelemetry.io/otel/sdk/trace" + semconv "go.opentelemetry.io/otel/semconv/v1.24.0" "go.opentelemetry.io/otel/trace" "go.wperron.io/sqliteexporter" @@ -802,7 +803,7 @@ func registerHandlers(sess *discordgo.Session, handlers map[string]Handler) { log.Debug().Ctx(ctx).Str("value", sub).Msg("flush modal submitted") if sub == "y" || sub == "ye" || sub == "yes" { - err := store.Flush(context.Background(), i.Member.User.ID) + err := store.Flush(ctx, i.Member.User.ID) msg := "Flushed all claims!" if err != nil { log.Error().Ctx(ctx).Err(err).Msg("failed to flush claims") @@ -1022,6 +1023,7 @@ func initTracing(db *sql.DB) { resource.WithOS(), resource.WithProcess(), resource.WithTelemetrySDK(), + resource.WithAttributes(semconv.ServiceName("themis")), ) ex, err := sqliteexporter.NewSqliteSDKTraceExporterWithDB(db)