Semconv: Change keys to private constants (#91508)

This commit is contained in:
Todd Treece
2024-08-02 16:13:00 -04:00
committed by GitHub
parent a397bca02e
commit 8c43b9ec2f
2 changed files with 22 additions and 19 deletions

View File

@ -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)
}