Skip to content

Commit

Permalink
feat: initializes otel metric collection for ftl dev and introduces a…
Browse files Browse the repository at this point in the history
… couple shared otel metric attributes (#2140)
  • Loading branch information
jonathanj-square authored Jul 24, 2024
1 parent 48ea4a6 commit d736bdc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions internal/observability/metrics/attributes.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package metrics

import (
"github.com/TBD54566975/ftl/backend/schema"
"go.opentelemetry.io/otel/attribute"
)

// ModuleNameAttribute identifies the name of the module that the associated
// metric originates from.
func ModuleNameAttribute(name string) attribute.KeyValue {
return attribute.String("ftl.module.name", name)
}

// VerbRefAttribute identifies the verb that the associated metric originates
// from. The entire module qualified name is used: e.g. {module.verb}
func VerbRefAttribute(ref schema.Ref) attribute.KeyValue {
return attribute.String("ftl.verb.ref", ref.Name)
}

0 comments on commit d736bdc

Please sign in to comment.