From 59a4c214c10f11bff76de91ebd3853cf66f6982a Mon Sep 17 00:00:00 2001 From: mateuszrzeszutek Date: Wed, 19 Aug 2020 09:48:36 +0200 Subject: [PATCH] Implement thread.id and thread.name semantic attributes See https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/span-general.md#general-thread-attributes --- .../opentelemetry/trace/attributes/SemanticAttributes.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/src/main/java/io/opentelemetry/trace/attributes/SemanticAttributes.java b/api/src/main/java/io/opentelemetry/trace/attributes/SemanticAttributes.java index 7f02e0e3709..78b54661e31 100644 --- a/api/src/main/java/io/opentelemetry/trace/attributes/SemanticAttributes.java +++ b/api/src/main/java/io/opentelemetry/trace/attributes/SemanticAttributes.java @@ -285,5 +285,11 @@ public final class SemanticAttributes { public static final StringAttributeSetter EXCEPTION_STACKTRACE = StringAttributeSetter.create("exception.stacktrace"); + /** Id of the thread that has started a span, as produced by {@link Thread#getId()}. */ + public static final LongAttributeSetter THREAD_ID = LongAttributeSetter.create("thread.id"); + /** Name of the thread that has started a span, as produced by {@link Thread#getName()}. */ + public static final StringAttributeSetter THREAD_NAME = + StringAttributeSetter.create("thread.name"); + private SemanticAttributes() {} }