mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 03:13:49 +08:00
Semconv: Change keys to private constants (#91508)
This commit is contained in:
@ -14,7 +14,7 @@ const (
|
||||
// RequirementLevel: Optional
|
||||
// Stability: stable
|
||||
// Examples: 'prometheus', 'loki', 'grafana-github-datasource'
|
||||
GrafanaDatasourceTypeKey = attribute.Key("grafana.datasource.type")
|
||||
grafanaDatasourceTypeKey = attribute.Key("grafana.datasource.type")
|
||||
|
||||
// GrafanaDatasourceUidKey is the attribute Key conforming to the
|
||||
// "grafana.datasource.uid" semantic conventions. It represents the
|
||||
@ -24,21 +24,21 @@ const (
|
||||
// RequirementLevel: Optional
|
||||
// Stability: stable
|
||||
// Examples: 'abcdefg-123456'
|
||||
GrafanaDatasourceUidKey = attribute.Key("grafana.datasource.uid")
|
||||
grafanaDatasourceUidKey = attribute.Key("grafana.datasource.uid")
|
||||
)
|
||||
|
||||
// GrafanaDatasourceType returns an attribute KeyValue conforming to the
|
||||
// "grafana.datasource.type" semantic conventions. It represents the datasource
|
||||
// type.
|
||||
func GrafanaDatasourceType(val string) attribute.KeyValue {
|
||||
return GrafanaDatasourceTypeKey.String(val)
|
||||
return grafanaDatasourceTypeKey.String(val)
|
||||
}
|
||||
|
||||
// GrafanaDatasourceUid returns an attribute KeyValue conforming to the
|
||||
// "grafana.datasource.uid" semantic conventions. It represents the datasource
|
||||
// unique identifier.
|
||||
func GrafanaDatasourceUid(val string) attribute.KeyValue {
|
||||
return GrafanaDatasourceUidKey.String(val)
|
||||
return grafanaDatasourceUidKey.String(val)
|
||||
}
|
||||
|
||||
// Describes Grafana data source request attributes.
|
||||
@ -51,14 +51,14 @@ const (
|
||||
// RequirementLevel: Optional
|
||||
// Stability: stable
|
||||
// Examples: 3
|
||||
GrafanaDatasourceRequestQueryCountKey = attribute.Key("grafana.datasource.request.query_count")
|
||||
grafanaDatasourceRequestQueryCountKey = attribute.Key("grafana.datasource.request.query_count")
|
||||
)
|
||||
|
||||
// GrafanaDatasourceRequestQueryCount returns an attribute KeyValue
|
||||
// conforming to the "grafana.datasource.request.query_count" semantic
|
||||
// conventions. It represents the number of queries in the request.
|
||||
func GrafanaDatasourceRequestQueryCount(val int) attribute.KeyValue {
|
||||
return GrafanaDatasourceRequestQueryCountKey.Int(val)
|
||||
return grafanaDatasourceRequestQueryCountKey.Int(val)
|
||||
}
|
||||
|
||||
// Describes Grafana plugin attributes.
|
||||
@ -70,7 +70,7 @@ const (
|
||||
// RequirementLevel: Optional
|
||||
// Stability: stable
|
||||
// Examples: 'prometheus', 'loki', 'grafana-github-datasource'
|
||||
GrafanaPluginIdKey = attribute.Key("grafana.plugin.id")
|
||||
grafanaPluginIdKey = attribute.Key("grafana.plugin.id")
|
||||
|
||||
// GrafanaPluginTypeKey is the attribute Key conforming to the
|
||||
// "grafana.plugin.type" semantic conventions. It represents the plugin
|
||||
@ -80,24 +80,24 @@ const (
|
||||
// RequirementLevel: Optional
|
||||
// Stability: stable
|
||||
// Examples: 'datasource'
|
||||
GrafanaPluginTypeKey = attribute.Key("grafana.plugin.type")
|
||||
grafanaPluginTypeKey = attribute.Key("grafana.plugin.type")
|
||||
)
|
||||
|
||||
var (
|
||||
// Data Source Plugin
|
||||
GrafanaPluginTypeDatasource = GrafanaPluginTypeKey.String("datasource")
|
||||
GrafanaPluginTypeDatasource = grafanaPluginTypeKey.String("datasource")
|
||||
// Panel Plugin
|
||||
GrafanaPluginTypePanel = GrafanaPluginTypeKey.String("panel")
|
||||
GrafanaPluginTypePanel = grafanaPluginTypeKey.String("panel")
|
||||
// App Plugin
|
||||
GrafanaPluginTypeApp = GrafanaPluginTypeKey.String("app")
|
||||
GrafanaPluginTypeApp = grafanaPluginTypeKey.String("app")
|
||||
// Renderer Plugin
|
||||
GrafanaPluginTypeRenderer = GrafanaPluginTypeKey.String("renderer")
|
||||
GrafanaPluginTypeRenderer = grafanaPluginTypeKey.String("renderer")
|
||||
// Secret Manager Plugin
|
||||
GrafanaPluginTypeSecretmanager = GrafanaPluginTypeKey.String("secretmanager")
|
||||
GrafanaPluginTypeSecretmanager = grafanaPluginTypeKey.String("secretmanager")
|
||||
)
|
||||
|
||||
// GrafanaPluginId returns an attribute KeyValue conforming to the
|
||||
// "grafana.plugin.id" semantic conventions. It represents the plugin ID.
|
||||
func GrafanaPluginId(val string) attribute.KeyValue {
|
||||
return GrafanaPluginIdKey.String(val)
|
||||
return grafanaPluginIdKey.String(val)
|
||||
}
|
||||
|
Reference in New Issue
Block a user