Semconv: Add service name attribute (#95743)

This commit is contained in:
Todd Treece 2024-11-01 18:29:14 -04:00 committed by GitHub
parent d0ba4f18d3
commit c5178807be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 38 additions and 0 deletions

View File

@ -4,6 +4,25 @@ package semconv
import "go.opentelemetry.io/otel/attribute" import "go.opentelemetry.io/otel/attribute"
// Describes Grafana service attributes.
const (
// GrafanaServiceNameKey is the attribute Key conforming to the
// "grafana.service.name" semantic conventions. It represents the service
// name.
//
// Type: string
// RequirementLevel: Optional
// Stability: stable
// Examples: 'grafana-apiserver'
grafanaServiceNameKey = attribute.Key("grafana.service.name")
)
// GrafanaServiceName returns an attribute KeyValue conforming to the
// "grafana.service.name" semantic conventions. It represents the service name.
func GrafanaServiceName(val string) attribute.KeyValue {
return grafanaServiceNameKey.String(val)
}
// Describes Grafana datasource attributes. // Describes Grafana datasource attributes.
const ( const (
// GrafanaDatasourceTypeKey is the attribute Key conforming to the // GrafanaDatasourceTypeKey is the attribute Key conforming to the

View File

@ -0,0 +1,12 @@
groups:
- id: registry.grafana.service
type: attribute_group
display_name: Grafana Service Attributes
brief: "Describes Grafana service attributes."
attributes:
- id: grafana.service.name
type: string
brief: The service name.
examples:
- "grafana-apiserver"
stability: stable

View File

@ -0,0 +1,7 @@
groups:
- id: trace.grafana.service
type: span
brief: 'Semantic Convention for Grafana services'
stability: stable
attributes:
- ref: grafana.service.name