Menu
Grafana Cloud

Configure Application Observability

Admin users can configure the Application Observability plugin.

Data source

You can configure the default data source for each signal type, when you select an option the changes are automatically saved.

On the Data source tab, you can configure the default data source for each signal type: metrics, logs, and traces.

By default, Application Observability uses the automatically provisioned data sources for the stack. This gives users simple getting started workflow that only needs them to send traces, and Application Observability generated the necessary metrics.

If you are using a custom data source for metrics you don’t need the automatic metrics generation provided Application Observability and can disable it to reduce your Grafana Cloud usage and bill.

Logs query

On the Logs query tab, you can configure the default log queries and formatting Application Observability uses to query and format logs.

Default log query format

Select a log query format that matches your logs ingestion path, and customize your default log query:

  • Use the Loki exporter query if you are exporting logs directly to Loki using loki-exporter
  • Use the OTLP gateway native Loki OTLP query if you are exporting logs via Grafana OTLP gateway or Loki native OTLP endpoint

The log query format needs to match the log storage and query format used by the ingestion method. If your log queries use a previous log format version, Application Observability prompts you to update the query.

Warning

Updating the default log query format overwrites changes you have made to your default log queries. Copy any queries you would like to keep before updating.

You can switch between log query formats on the Logs tab, changes won’t persist beyond the current session. If you would like to permanently change the default log query format, update the setting from the Configuration page.

Logs query, without namespace

You can configure the logs query to execute in the logs tab if service.namespace resource attribute isn’t provided. Available variables: $job, and $serviceName.

Logs query, with namespace

You can configure the logs query to execute in the logs tab when you supply the service.namespace resource attribute. Available variables: $job, $serviceName, and $serviceNamespace.

Logs query formatting

You can specify the formatting section of a log query to automatically appended 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}}"

Important: the formatting is automatically applied at the end of the actual query. Messing this up can lead to invalid queries.

Semantics

You can use the semantics configuration tab to configure which attributes Application Observability uses for grouping and filtering data in Application Observability.

Deployment environment attribute and value

By default Application Observability uses the OpenTelemetry recommended attribute deployment.environment to distinguish environments. You can select a custom attribute from a list of possible attributes from the data.

Note

When you select a custom attribute to represent your environment, ensure that all your traces include the attribute.

Group and filter attributes

To enable data grouping and filtering in Application Observability, first add the necessary attributes to traces that you would like to group and filter by, and then select them from a list of available attributes in the Application Observability configuration.

By default you can group and filter by the deployment environment.

Warning

When you add additional group and filter attributes it contributes to your Grafana Cloud data usage and bill.

Think carefully about the cardinality of your data and select attributes with minimal variation in value, for example geographical region and cloud provider have less cardinality than instance id.

System

Use the system configuration tab to configure system-wide settings.

Span metrics source

Application Observability uses metrics generated from traces for most of the visualizations in the application. This data can come from different places depending on your setup. You can change which source you use from the System tab, under the Span metrics source section:

  • Tempo (Grafana Cloud): the default span metrics source, for metrics generation through the Tempo metrics generator
  • OpenTelemetry Collector: for advanced setups using the OpenTelemetry collector with the span metrics connector and the service graph metrics connectorLegacy: for customers who use the OpenTelemetry Collector with metric names that match those used by the Tempo metrics generator.

Metrics generation

Enable or disable metrics generation for the default provisioned Traces data source for the stack.

Note

You can safely disable metrics generation if you are using a custom data source.