Configure Application Observability at the service level
Grafana Cloud

Configure Application Observability at the service level

When you configure Application Observability from Application > Configuration in Grafana Cloud, the parameters that you select are applied to all the services that you are monitoring. Setting the logs configuration at the global level doesn’t provide the flexibility to mix and match signals across databases and datasources.

To account for these variations, you can apply service-level configuration changes to override the general configuration for only the selected service. You configure these options similar to how you configure the global settings for logs queries and filters. Setting the configuration at this level doesn’t affect how data is ingested, rather it changes how service details query logs and facilitate traces to logs.

Logs query for this service

For the selected service, you can configure the logs query to execute in the logs tab. Available variables include: $job, $serviceName, $serviceNamespace, $environmentAttribute, $environmentValue, $traceIDFilter, $spanIDFilter.

Logs query formatting for this service

For the selected service, you can specify the formatting section of a log query to automatically append to the end of logs queries to improve readability.

For example, the default formatting appended to log queries is:

LogQL
line_format "\u001b[1m{{if .severity}}{{alignRight 5 .severity}}{{end}}\u001b[0m \u001b[90m[{{alignRight 10 .resources_service_instance_id}}{{if .attributes_thread_name}}/{{alignRight 20 .attributes_thread_name}}{{end}}]\u001b[0m \u001b[36m{{if .instrumentation_scope_name }}{{alignRight 40 .instrumentation_scope_name}}{{end}}\u001b[0m{{if .traceid}} \u001b[37m\u001b[3m[traceid={{.traceid}}]{{end}}: {{.body}}"

Warning

The formatting is automatically applied at the end of the actual query. Take care when defining this option as incorrect formatting can lead to invalid queries.

Filter by trace ID

Determine whether to append the trace ID to the logs query. This applies only when navigating to logs from a trace by clicking the Logs for this service button.

Filter by span ID

Determine whether to append the span ID to the logs query. This applies only when navigating to logs from a trace by clicking the Logs for this span button.

Before you begin

Ensure that you have admin privileges.

Access the per-service configuration

  1. Use the left navigation to select Application and then click Services.
  2. Choose the desired service.
  3. Select the Configuration tab.