From c312fe0ee791da4141bb55e2f84e9cc78315872e Mon Sep 17 00:00:00 2001 From: zepatrik Date: Wed, 25 Sep 2024 10:45:24 +0200 Subject: [PATCH] fix(otelx): distinguish workspace and project API keys --- otelx/semconv/events.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/otelx/semconv/events.go b/otelx/semconv/events.go index 80f04641..fcbfc1fe 100644 --- a/otelx/semconv/events.go +++ b/otelx/semconv/events.go @@ -33,7 +33,8 @@ const ( AttributeKeyWorkspace AttributeKey = "WorkspaceID" AttributeKeySubscriptionID AttributeKey = "SubscriptionID" AttributeKeyProjectEnvironment AttributeKey = "ProjectEnvironment" - AttributeKeyAPIKeyID AttributeKey = "APIKeyID" + AttributeKeyWorkspaceAPIKeyID AttributeKey = "WorkspaceAPIKeyID" + AttributeKeyProjectAPIKeyID AttributeKey = "ProjectAPIKeyID" ) func AttrIdentityID[V string | uuid.UUID](val V) otelattr.KeyValue { @@ -76,8 +77,12 @@ func AttrGeoLocation(val httpx.GeoLocation) []otelattr.KeyValue { return geoLocationAttributes } -func AttrAPIKeyID[V string | uuid.UUID](val V) otelattr.KeyValue { - return otelattr.String(AttributeKeyAPIKeyID.String(), uuidOrString(val)) +func AttrWorkspaceAPIKeyID[V string | uuid.UUID](val V) otelattr.KeyValue { + return otelattr.String(AttributeKeyWorkspaceAPIKeyID.String(), uuidOrString(val)) +} + +func AttrProjectAPIKeyID[V string | uuid.UUID](val V) otelattr.KeyValue { + return otelattr.String(AttributeKeyProjectAPIKeyID.String(), uuidOrString(val)) } func uuidOrString[V string | uuid.UUID](val V) string {