From 9a8678227c4ed379fe7640ef9ef64b5cf6a904ee Mon Sep 17 00:00:00 2001 From: Pavol Loffay Date: Fri, 13 Jul 2018 10:48:03 +0200 Subject: [PATCH] Add service tag Signed-off-by: Pavol Loffay --- .../src/main/java/io/opentracing/tag/Tags.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/opentracing-api/src/main/java/io/opentracing/tag/Tags.java b/opentracing-api/src/main/java/io/opentracing/tag/Tags.java index 9496dffc..b74197e8 100644 --- a/opentracing-api/src/main/java/io/opentracing/tag/Tags.java +++ b/opentracing-api/src/main/java/io/opentracing/tag/Tags.java @@ -45,6 +45,17 @@ private Tags() { */ public static final String SPAN_KIND_CONSUMER = "consumer"; + /** + * The service name for a span, which overrides any default "service name" property defined + * in a tracer's config. This tag is meant to only be used when a tracer is reporting spans + * on behalf of another service (for example, a service mesh reporting on behalf of the services + * it is proxying). This tag does not need to be used when reporting spans for the service the + * tracer is running in. + * + * @see #PEER_SERVICE + */ + public static final StringTag SERVICE = new StringTag("service"); + /** * HTTP_URL records the url of the incoming request. */ @@ -71,7 +82,9 @@ private Tags() { public static final StringTag PEER_HOST_IPV6 = new StringTag("peer.ipv6"); /** - * PEER_SERVICE records the service name of the peer. + * PEER_SERVICE records the service name of the peer service. + * + * @see #SERVICE */ public static final StringTag PEER_SERVICE = new StringTag("peer.service");