diff --git a/pkg/semconv/attributes.go b/pkg/semconv/attributes.go index 07fc5fa6fd6..c759ab2e9c0 100644 --- a/pkg/semconv/attributes.go +++ b/pkg/semconv/attributes.go @@ -81,6 +81,26 @@ func K8sDataplaneserviceName(val string) attribute.KeyValue { return k8sDataplaneserviceNameKey.String(val) } +// Describes Grafana app platform namespace attributes. +const ( + // GrafanaNamespaceNameKey is the attribute Key conforming to the + // "grafana.namespace.name" semantic conventions. It represents the + // namespace name. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'stacks-99999' + grafanaNamespaceNameKey = attribute.Key("grafana.namespace.name") +) + +// GrafanaNamespaceName returns an attribute KeyValue conforming to the +// "grafana.namespace.name" semantic conventions. It represents the namespace +// name. +func GrafanaNamespaceName(val string) attribute.KeyValue { + return grafanaNamespaceNameKey.String(val) +} + // Describes Grafana plugin attributes. const ( // GrafanaPluginIdKey is the attribute Key conforming to the diff --git a/pkg/semconv/model/registry/namespace.yml b/pkg/semconv/model/registry/namespace.yml new file mode 100644 index 00000000000..8fbc257c21c --- /dev/null +++ b/pkg/semconv/model/registry/namespace.yml @@ -0,0 +1,12 @@ +groups: + - id: registry.grafana.namespace + type: attribute_group + display_name: Grafana Namespace Attributes + brief: "Describes Grafana app platform namespace attributes." + attributes: + - id: grafana.namespace.name + type: string + brief: The namespace name. + examples: + - "stacks-99999" + stability: stable diff --git a/pkg/semconv/model/trace/namespace.yaml b/pkg/semconv/model/trace/namespace.yaml new file mode 100644 index 00000000000..dd3f5cb14bd --- /dev/null +++ b/pkg/semconv/model/trace/namespace.yaml @@ -0,0 +1,7 @@ +groups: + - id: trace.grafana.namespace + type: span + brief: 'Semantic Convention for Grafana app platform namespaces' + stability: stable + attributes: + - ref: grafana.namespace.name