From 3e78ba6126519053918ddae9fb8782b239c33bf7 Mon Sep 17 00:00:00 2001
From: Pavol Loffay
Date: Mon, 16 Jul 2018 16:14:34 +0200
Subject: [PATCH] Add service tag (#287)
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");