Analyze services with span tags

Use span tags to add additional context to the operations that spans represent.

A span tag is metadata attached to a span as a key-value pair. It provides details about the environment, user request, or operation that the span represents, thus adding context to the span.

Instrumentation libraries automatically attach some default tags to spans, such as http.method, http.status_code, or service.name. For example, the instrumentation you use in a browser application might attach default tags such as browser.name, user_agent, or page.url to spans. You can configure your application to add custom tags to spans to capture additional details.

An index of a span tag is an aggregation, that you define, of a span tag's distinct values. When you create this index, Splunk RUM automatically generates a new Troubleshooting MetricSet with that span tag as a dimension of it. Learn more about MetricSets in Splunk RUM.

Scenarios for indexing span tags

When you create an index of a span tag you can:

  • Break down service performance metrics by that span tag in the service map so that you can see which specific services are associated with performance issues.

  • Filter and group metrics by that span tag in Tag Spotlight.

  • View charts of service performance metrics by that span tag in Tag Spotlight to discover relationships between specific span tag values and service behaviors.

  • Associate logically related spans so that you can track multiple traces for a specific activity using Business Workflows.

Get started

Follow these steps to start analyzing your browser and mobile services with span tags:

  1. Add tags to the spans you send to Splunk RUM. You can add tags to spans at the application level or at the OpenTelemetry Collector level. Adapt the instructions in Add context to spans with span tags in Splunk APM for Splunk RUM.

  2. Create an index of a span tag, which automatically generates a Troubleshooting MetricSet.

  3. Create a Monitoring MetricSet with a custom dimension.

  4. Use Tag Spotlight to analyze service performance:

  5. Download traces and filter or process data by span tags manually. See Download traces.