From 6c2f6b6fb4a026b6067bd271f7844a10ce3a2dbe Mon Sep 17 00:00:00 2001 From: qudongfang Date: Wed, 7 Aug 2019 11:02:23 +0800 Subject: [PATCH] Add PEER_ADDRESS tag according to OpenTracing Specification Semantic Conventions v1.1. Signed-off-by: qudongfang --- CONTRIBUTING.md | 5 ++--- .../src/main/java/io/opentracing/tag/Tags.java | 9 ++++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 95b25f34..a045bcba 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,16 +2,15 @@ If you would like to contribute code you can do so through GitHub by forking the repository and sending a pull request (on a branch other than `master` or `gh-pages`). - ## License -By contributing your code, you agree to license your contribution under the terms of the APLv2: https://github.com/opentracing/opentracing-java/blob/master/LICENSE +By contributing your code, you agree to license your contribution under the terms of the APLv2: All files are released with the Apache 2.0 license. If you are adding a new file it should have a header like below. This can be automatically added by running `./mvnw com.mycila:license-maven-plugin:format`. -``` +```java /** * Copyright 2016-2019 The OpenTracing Authors * 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 91bf6f9f..1fcc1003 100644 --- a/opentracing-api/src/main/java/io/opentracing/tag/Tags.java +++ b/opentracing-api/src/main/java/io/opentracing/tag/Tags.java @@ -18,7 +18,7 @@ * semantic information about the spans. Tracers may expose additional features based on these * standardized data points. Tag names follow a general structure of namespacing. * - * @see https://github.com/opentracing/specification/blob/master/semantic_conventions.md + * @see OpenTracing Specification Semantic Conventions v1.1 */ public final class Tags { @@ -60,6 +60,13 @@ private Tags() { */ public static final StringTag HTTP_METHOD = new StringTag("http.method"); + /** + * PEER_ADDRESS records remote "address", suitable for use in a networking client library. + * This may be a `"ip:port"`, a bare `"hostname"`, a FQDN, + * or even a JDBC substring like `"mysql://prod-db:3306"`. + */ + public static final StringTag PEER_ADDRESS = new StringTag("peer.address"); + /** * PEER_HOST_IPV4 records IPv4 host address of the peer. */