Grafana Cloud

Label conventions for entity linking

The knowledge graph discovers entities and builds relationships by matching labels across the metrics that Grafana Cloud products send. When labels are inconsistent or missing, entities can’t be linked, and the topology, RCA workflows, and drill-downs that depend on those links don’t work.

Use this documentation to find the labels that matter for the products you use together. Each section covers a specific relationship type.

For the full list of required metrics and labels per product, refer to Troubleshoot data issues.

Host identity

The host_id label provides a stable machine identifier for hosts. It’s used for host-hours billing and for consistent host identification across products. The Linux Server and Windows Server integrations include host_id automatically. The value comes from OpenTelemetry resource detection, which reads the identifier from the operating system.

host_id requires Grafana Alloy.

Note

If you installed the Linux Server or Windows Server integration before host_id was added, update your Alloy configuration snippet to include it.

Note

Activating the knowledge graph using Host Monitoring is currently in public preview. Grafana Labs offers limited support, and breaking changes might occur prior to the feature being made generally available.

Host Monitoring also requires the instance label on node_uname_info (Linux/Unix) or windows_os_info (Windows) for entity discovery. Refer to Configure dataset for Host Monitoring for the full list of required metrics and labels.

Service identity (OpenTelemetry)

Application Observability identifies services using OpenTelemetry resource attributes. These attributes map to Prometheus labels as follows:

OTel resource attributePrometheus labelExample value
service.namespace / service.namejobproduction/checkout-service
service.instance.idinstancePod name, UUID, or hostname
deployment.environment.namedeployment_environment_nameproduction

The job label concatenates ${service.namespace}/${service.name} when service.namespace is defined, or uses just service.name when it isn’t.

The knowledge graph scopes Service entities by environment using asserts_env, which is derived from deployment.environment.name (or deployment.environment). A mismatch in environment labels between products is a common reason entities don’t link as expected.

For details on configuring these attributes, refer to Set up instrumentation.

Service to Kubernetes workload

The knowledge graph links OpenTelemetry services to their underlying Kubernetes workloads. The link uses Kubernetes resource attributes from target_info or traces_target_info (resource attributes), matched against workload ownership derived from kube_pod_owner (kube-state-metrics).

The link requires the following OTel resource attributes:

OTel resource attributePurpose
k8s.namespace.nameMatches the workload namespace
k8s.pod.nameMatches the Pod to its owning workload
k8s.cluster.nameIdentifies the cluster

The result is a link from the OTel service to the Kubernetes workload Service, not to individual Pods or Nodes.

Use the Kubernetes Attributes Processor to enrich your telemetry with these attributes. For setup guidance, refer to Kubernetes monitoring recommendations.

Service to service

The knowledge graph links services to each other using service graph metrics. These metrics represent the calling relationship between two services and require consistent labels on both sides.

For service-to-service links to appear:

  • Both services must have service graph metrics (traces_service_graph_request_total and related metrics).
  • The server label on the caller’s service graph metrics must match the target service’s service.name.
  • The client_deployment_environment_name and server_deployment_environment_name on service graph metrics must match the deployment_environment_name that each service reports in target_info. A mismatch prevents the knowledge graph from resolving the link.

If you see an un-instrumented placeholder instead of a link to a known service, verify that the server value matches the target service’s name exactly and that both services report the same environment.

For services running on Kubernetes, also ensure the k8s.namespace.name, k8s.pod.name, and k8s.cluster.name resource attributes are present. These attributes enable the knowledge graph to link services to their Kubernetes workloads in addition to other services.

Service to Amazon RDS

The knowledge graph links Application Observability services to Amazon RDS instances by matching *.rds.amazonaws.com hostname patterns in span metric and service graph metric labels.

The following labels are checked for RDS hostname patterns:

Metric typeLabels checked
Service graph metricsclient_server_address, server
Span metricsserver_address, net_peer_name

No additional configuration is required if your application connects to RDS using the standard RDS endpoint hostname. The knowledge graph extracts the RDS instance identifier from the hostname and matches it against the aws_rds_info metric.

For the full list of metrics and labels, refer to Amazon RDS relationships.

Database to cloud provider

The knowledge graph can link Database Observability entities to their cloud provider counterparts (AWS RDS, Google Cloud SQL, Azure Flexible Server). It parses the database connection string to identify the cloud provider and resource, then matches it against cloud provider metrics.

Required labels

Database Observability requires the instance label in hostname:port format. For example, mydb.example.com:5432, not mydb or mydb.example.com.

For the full label requirements, refer to Database Observability labels reference.

The dsn label

Database Observability setup guides include an optional relabeling step that copies the exporter’s original instance value to a dsn label before the instance label is overwritten. The dsn label is used for integration with the knowledge graph.

If you want the knowledge graph to link your database entities to cloud provider entities, include the dsn relabeling step from your database setup guide (for example, Set up PostgreSQL on RDS).

Cloud provider labels

For cloud-hosted databases, configure the cloud_provider block in your Database Observability Alloy configuration to identify the cloud resource. This block adds the following labels to your metrics:

LabelPurpose
provider_nameCloud provider identifier (for example, aws, azure)
provider_accountCloud account or subscription identifier
provider_regionCloud region where the database runs

Cloud provider linking

The knowledge graph uses the connection information in the dsn label to match database entities with cloud provider entities:

Cloud providerHostname patternMatched against
AWS RDS*.rds.amazonaws.comaws_rds_info metric
Google Cloud SQLCloud SQL connection nameCloud SQL metrics
Azure Flexible Server*.database.azure.comAzure Flexible Server metrics

Host to AWS EC2

If a host runs on AWS EC2, you can link it to the corresponding EC2 entity in the knowledge graph. This requires an instance_id label on your host metrics.

Use the Alloy discovery.ec2 and prometheus.enrich components to add the instance_id label. For an example configuration, refer to Enrich and link hosts using metadata.

Cloud provider entities

Cloud provider entities discovered through Cloud Provider Observability require provider-specific scoping labels on their metrics. The knowledge graph infers its internal scoping (asserts_env and asserts_site) from these labels.

Cloud providerRequired scoping labels
AWSaccount_id, region
AzuresubscriptionName, region
GCPproject_id, location (or region or zone depending on resource)

Each cloud provider also uses a different label for entity identification:

Cloud providerIdentification labelValue
AWSnameAmazon Resource Name
AzureresourceNameAzure resource name
GCPinstance_name or database_idInstance name or database identifier

For the full list of required metrics and labels per cloud provider, refer to the AWS, Azure, and GCP troubleshooting sections.

Known limitations

The following entity linking capabilities are not yet available:

  • Host to service linking: The knowledge graph can’t yet link a non-Kubernetes host to the services running on it.
  • Bare metal logs correlation: Logs correlation for non-Kubernetes hosts isn’t supported. For Kubernetes and OpenTelemetry services, you can configure logs correlation to map entity properties to Loki labels.

Next steps