From ae5bd6d3525afa53333e623f211f3bddef79a5ca Mon Sep 17 00:00:00 2001 From: Anuraag Agrawal Date: Fri, 26 Jun 2020 17:59:59 +0900 Subject: [PATCH 1/2] Add semantic attributes for HTTP content length. --- .../trace/attributes/SemanticAttributes.java | 24 +++++++++++++++++++ 1 file changed, 24 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 42244550d3d..e84ba678d12 100644 --- a/api/src/main/java/io/opentelemetry/trace/attributes/SemanticAttributes.java +++ b/api/src/main/java/io/opentelemetry/trace/attributes/SemanticAttributes.java @@ -98,6 +98,30 @@ public final class SemanticAttributes { /** The IP address of the original client behind all proxies, if known. */ public static final StringAttributeSetter HTTP_CLIENT_IP = StringAttributeSetter.create("http.client_ip"); + /** + * The size of the request payload body, in bytes. For payloads using transport encoding, this is + * the compressed size. + */ + public static final StringAttributeSetter HTTP_REQUEST_CONTENT_LENGTH = + StringAttributeSetter.create("http.request_content_length"); + /** + * The size of the uncompressed request payload body, in bytes. Only set for requests that use + * transport encoding. + */ + public static final StringAttributeSetter HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = + StringAttributeSetter.create("http.request_content_length_uncompressed"); + /** + * The size of the response payload body, in bytes. For payloads using transport encoding, this is + * the compressed size. + */ + public static final StringAttributeSetter HTTP_RESPONSE_CONTENT_LENGTH = + StringAttributeSetter.create("http.response_content_length"); + /** + * The size of the uncompressed response payload body, in bytes. Only set for response that use + * transport encoding. + */ + public static final StringAttributeSetter HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = + StringAttributeSetter.create("http.response_content_length_uncompressed"); /** The service name, must be equal to the $service part in the span name. */ public static final StringAttributeSetter RPC_SERVICE = StringAttributeSetter.create("rpc.service"); From 8bb11ecf71a7a6c985905441b00b0cf02985c121 Mon Sep 17 00:00:00 2001 From: Anuraag Agrawal Date: Fri, 26 Jun 2020 18:44:05 +0900 Subject: [PATCH 2/2] Update api/src/main/java/io/opentelemetry/trace/attributes/SemanticAttributes.java Co-authored-by: Armin Ruech --- .../io/opentelemetry/trace/attributes/SemanticAttributes.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 e84ba678d12..0597fed0e0e 100644 --- a/api/src/main/java/io/opentelemetry/trace/attributes/SemanticAttributes.java +++ b/api/src/main/java/io/opentelemetry/trace/attributes/SemanticAttributes.java @@ -117,7 +117,7 @@ public final class SemanticAttributes { public static final StringAttributeSetter HTTP_RESPONSE_CONTENT_LENGTH = StringAttributeSetter.create("http.response_content_length"); /** - * The size of the uncompressed response payload body, in bytes. Only set for response that use + * The size of the uncompressed response payload body, in bytes. Only set for responses that use * transport encoding. */ public static final StringAttributeSetter HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED =