Skip to main content
Sumo Logic

Custom tags configuration

Custom tags configuration via startup parameter

You can use OTEL_RESOURCE_ATTRIBUTES= startup parameter to pass a custom static tag to all spans generated in the service. For example:



Custom tags configuration through your code

If the default tags are not providing enough relevant data you can add custom tags or attributes into spans. Follow these steps:

Step 1 - Satisfy project dependencies - add opentelemetry-sdk library
  • Maven projects

<!-- -->

  • Gradle projects

dependencies {
 compile 'io.opentelemetry:opentelemetry-sdk:1.16.0'

Step 2 - Import dependencies in the application Java class file

import io.opentelemetry.api.trace.Span;

Step 3 - Add custom tag into Span

Span currentSpan = Span.current();