Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/grafana-cloud/observe-and-act/monitor-applications/application-observability-kg/setup/instrumentation.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana-cloud/observe-and-act/monitor-applications/application-observability-kg/setup/instrumentation/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
Set up instrumentation
Application Observability requires your applications to be instrumented with OpenTelemetry. The telemetry data flows through Grafana Alloy (or another OpenTelemetry Collector) to Grafana Cloud, where the knowledge graph discovers services and generates insights.
Instrument your application
Instrumentation is the process of adding code to your application to generate telemetry data (metrics, logs, traces, and profiles).
Grafana Labs supports three instrumentation solutions:
- Grafana Beyla: eBPF network-level instrumentation that requires no code changes and supports all languages and frameworks.
- OpenTelemetry Java SDK: the Grafana distribution of the OTel Java SDK for process-level telemetry.
- OpenTelemetry .NET SDK: the Grafana distribution of the OTel .NET SDK for process-level telemetry.
You can also use community OpenTelemetry SDKs for other languages.
For detailed instructions, refer to the instrumentation guides.
Set up Grafana Alloy
After your application is instrumented, set up Grafana Alloy to send telemetry data to Grafana Cloud. Alloy receives data from your application, processes it, and exports it to the Grafana Cloud OTLP endpoint.
For detailed instructions, refer to the OpenTelemetry Collector setup documentation.
For a guided setup, use the Grafana Cloud setup guides.
Resource attributes
Application Observability uses OpenTelemetry resource attributes to identify and organize your services. Configure the following attributes on your applications:
| Attribute | Description |
|---|---|
| service.namespace | An optional namespace for service.name |
| service.name | The application name |
| deployment.environment | Name of the deployment environment (staging or production) |
| service.instance.id | The unique instance, for example, the Pod name |
| service.version | The application version, to see if a new version has introduced a bug |
These attributes map to Prometheus labels as follows:
| Label | Derived from |
|---|---|
| job | ${service.namespace}/${service.name} (if service.namespace is defined) or service.name |
| instance | service.instance.id |
Required metrics and labels
Application Observability uses span metrics and service graph metrics to power the services catalog and service detail views. These metrics are generated either by Grafana Cloud Traces or by Grafana Alloy/OTel Collector.
Common labels
job: identifies services. Concatenation of$service.namespace/$service.nameor justservice.namewhenservice.namespaceisn’t present.deployment_environment: allows filtering by environment (for example,prod,dev). Required for the baselines feature.
You can use any additional labels not listed here for filtering or grouping metrics in the UI.
Target info metric
The target_info metric (named traces_target_info when generated by Grafana Cloud Traces or Beyla) stores resource attributes. Application Observability derives service inventory and service metadata from this metric.
Required labels: job.
Recommended labels:
telemetry_sdk_*: determines service technology and SDK metadata.deployment_environment: allows filtering by environment.k8s_*: determines Kubernetes metadata.cloud_*: determines cloud provider metadata.
Span metrics
Span metrics power the RED metric panels (latency, error ratio, request rate). Metric names vary by source. Both classic histograms and native histograms are supported.
Classic histograms:
| Source | Metric names |
|---|---|
| Grafana Cloud Traces, Beyla | traces_spanmetrics_latency_count, traces_spanmetrics_latency_sum, traces_spanmetrics_latency_bucket |
| Alloy >= v1.5.0, OTel Collector >= v0.109 | traces_span_metrics_duration_seconds_count, traces_span_metrics_duration_seconds_sum, traces_span_metrics_duration_seconds_bucket |
| Alloy v1.0-v1.4.3, OTel Collector v0.94-v0.108 | duration_seconds_count, duration_seconds_sum, duration_seconds_bucket |
Native histograms:
| Source | Metric name |
|---|---|
| Grafana Cloud Traces, Beyla | traces_spanmetrics_latency |
| Alloy >= v1.5.0, OTel Collector >= v0.109 | traces_span_metrics_duration_seconds |
| Alloy v1.0-v1.4.3, OTel Collector v0.94-v0.108 | duration_seconds |
Required labels: job, span_kind, status_code, le (histogram bucket boundary, classic histograms only).
Recommended labels: deployment_environment, span_name (operation name for per-operation breakdowns).
Service graph metrics
Service graph metrics power the service map and inbound/outbound panels. You can disable service graph generation to reduce the number of metric series. Application Observability also uses these metrics to derive uninstrumented services.
Request count metrics:
traces_service_graph_request_totaltraces_service_graph_request_failed_total
Latency histogram metrics (classic):
traces_service_graph_request_client_seconds_bucket,traces_service_graph_request_client_seconds_count,traces_service_graph_request_client_seconds_sumtraces_service_graph_request_server_seconds_bucket,traces_service_graph_request_server_seconds_count,traces_service_graph_request_server_seconds_sum
Latency histogram metrics (native):
traces_service_graph_request_client_secondstraces_service_graph_request_server_seconds
Required labels: client, client_service_namespace, server, server_service_namespace, le (classic histograms only).
Recommended labels: client_deployment_environment, server_deployment_environment, connection_type (determines if a service or database is instrumented).
Note
Service graph metrics don’t have
joblabels. Application Observability parses thejoblabel from other metrics to derive service namespace and name, which are then used to matchclient/client_service_namespaceandserver/server_service_namespacerespectively.
Host identification
Application Observability identifies hosts for host-hours billing from standard OpenTelemetry resource attributes attached to your telemetry: k8s.node.name, host.id, or grafana.host.id. For details on priority tiers and per-environment configuration, refer to Host-hours pricing.
Runtime metrics
Application Observability uses runtime metrics to display resource utilization data for JVM, Go, and .NET applications.
Required labels: job.
Recommended labels: instance (correlates CPU/memory usage to a particular instance).
JVM metrics:
jvm_class_countprocess_runtime_jvm_classes_current_loadedjvm_classes_loadedjvm_memory_used,jvm_memory_used_bytesjvm_memory_limit,jvm_memory_limit_bytesprocess_runtime_jvm_memory_usage,process_runtime_jvm_memory_usage_bytesprocess_runtime_jvm_memory_limit,process_runtime_jvm_memory_limit_bytesjvm_memory_max,jvm_memory_max_bytesjvm_gc_duration_sum,jvm_gc_duration_seconds_sumprocess_runtime_jvm_gc_duration_sum,process_runtime_jvm_gc_duration_seconds_sumjvm_gc_pause_sum,jvm_gc_pause_seconds_sum,jvm_gc_pause_milliseconds_sumjvm_cpu_recent_utilization,jvm_cpu_recent_utilization_ratioprocess_runtime_jvm_system_cpu_utilization,process_runtime_jvm_system_cpu_utilization_ratiosystem_cpu_usagejvm_thread_countprocess_runtime_jvm_threads_countjvm_threads_live
Go metrics:
process_runtime_go_mem_live_objectsprocess_runtime_go_mem_heap_sysprocess_runtime_go_mem_heap_alloc,process_runtime_go_mem_heap_alloc_bytesprocess_runtime_go_mem_heap_idle,process_runtime_go_mem_heap_idle_bytesprocess_runtime_go_mem_heap_inuse,process_runtime_go_mem_heap_inuse_bytesprocess_runtime_go_mem_heap_released,process_runtime_go_mem_heap_released_bytesprocess_runtime_go_mem_lookups,process_runtime_go_mem_lookups_totalprocess_runtime_go_mem_heap_objectsprocess_runtime_go_goroutinesprocess_runtime_go_gc_count,process_runtime_go_gc_count_totalprocess_runtime_go_cgo_calls
.NET metrics:
process_runtime_dotnet_gc_objects_size,process_runtime_dotnet_gc_objects_size_bytesprocess_threads,process_thread_countprocess_cpu_time,process_cpu_time_seconds_totalprocess_memory_usage,process_memory_usage_bytes
Note
You can use any additional labels not mentioned here for filtering metrics in the UI.
Next steps
- Navigate to Observability > Application to view your services catalog.
- Review instrumentation quality to identify gaps in your telemetry data.
Was this page helpful?
Related resources from Grafana Labs


