Skip to content

Commit

Permalink
chore: unify API keys
Browse files Browse the repository at this point in the history
  • Loading branch information
zepatrik committed Sep 16, 2024
1 parent 0156c13 commit 5591fe2
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions otelx/semconv/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ const (
AttributeKeyWorkspace AttributeKey = "WorkspaceID"
AttributeKeySubscriptionID AttributeKey = "SubscriptionID"
AttributeKeyProjectEnvironment AttributeKey = "ProjectEnvironment"
AttributeProjectKeyAPIKeyID AttributeKey = "ProjectAPIKeyID"
AttributeWorkspaceKeyAPIKeyID AttributeKey = "WorkspaceAPIKeyID"
AttributeKeyAPIKeyID AttributeKey = "APIKeyID"
)

func AttrIdentityID[V string | uuid.UUID](val V) otelattr.KeyValue {
Expand Down Expand Up @@ -77,12 +76,8 @@ func AttrGeoLocation(val httpx.GeoLocation) []otelattr.KeyValue {
return geoLocationAttributes
}

func AttrProjectAPIKey[V string | uuid.UUID](val V) otelattr.KeyValue {
return otelattr.String(AttributeProjectKeyAPIKeyID.String(), uuidOrString(val))
}

func AttrWorkspaceAPIKey[V string | uuid.UUID](val V) otelattr.KeyValue {
return otelattr.String(AttributeWorkspaceKeyAPIKeyID.String(), uuidOrString(val))
func AttrAPIKey[V string | uuid.UUID](val V) otelattr.KeyValue {
return otelattr.String(AttributeKeyAPIKeyID.String(), uuidOrString(val))
}

func uuidOrString[V string | uuid.UUID](val V) string {
Expand Down

0 comments on commit 5591fe2

Please sign in to comment.