Skip to content

Commit 05f336f

Browse files
author
Anuraag Agrawal
authored
Update to latest RPC semantic attributes. (open-telemetry#1520)
1 parent 6c31db4 commit 05f336f

1 file changed

Lines changed: 19 additions & 9 deletions

File tree

api/src/main/java/io/opentelemetry/trace/attributes/SemanticAttributes.java

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,20 +127,30 @@ public final class SemanticAttributes {
127127
*/
128128
public static final LongAttributeSetter HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED =
129129
LongAttributeSetter.create("http.response_content_length_uncompressed");
130-
/** The service name, must be equal to the $service part in the span name. */
130+
131+
/** A string identifying the remoting system, e.g., "grpc", "java_rmi" or "wcf". */
132+
public static final StringAttributeSetter RPC_SYSTEM = StringAttributeSetter.create("rpc.system");
133+
/** The full name of the service being called, including its package name, if applicable. */
131134
public static final StringAttributeSetter RPC_SERVICE =
132135
StringAttributeSetter.create("rpc.service");
133-
/** RPC span event attribute with value "SENT" or "RECEIVED". */
134-
public static final StringAttributeSetter MESSAGE_TYPE =
136+
/* The name of the method being called, must be equal to the $method part in the span name */
137+
public static final StringAttributeSetter RPC_METHOD = StringAttributeSetter.create("rpc.method");
138+
139+
/** The name of a gRPC span event to populate for each message sent / received. */
140+
public static final String GRPC_MESSAGE_EVENT_NAME = "message";
141+
/** gRPC span event attribute with value "SENT" or "RECEIVED". */
142+
public static final StringAttributeSetter GRPC_MESSAGE_TYPE =
135143
StringAttributeSetter.create("message.type");
136-
/** RPC span event attribute starting from 1 for each of sent messages and received messages. */
137-
public static final LongAttributeSetter MESSAGE_ID = LongAttributeSetter.create("message.id");
138-
/** RPC span event attribute for compressed size. */
139-
public static final LongAttributeSetter MESSAGE_COMPRESSED_SIZE =
144+
/** gRPC span event attribute starting from 1 for each of sent messages and received messages. */
145+
public static final LongAttributeSetter GRPC_MESSAGE_ID =
146+
LongAttributeSetter.create("message.id");
147+
/** gRPC span event attribute for compressed size of a message. */
148+
public static final LongAttributeSetter GRPC_MESSAGE_COMPRESSED_SIZE =
140149
LongAttributeSetter.create("message.compressed_size");
141-
/** RPC span event attribute for uncompressed size. */
142-
public static final LongAttributeSetter MESSAGE_UNCOMPRESSED_SIZE =
150+
/** gRPC span event attribute for uncompressed size of a message. */
151+
public static final LongAttributeSetter GRPC_MESSAGE_UNCOMPRESSED_SIZE =
143152
LongAttributeSetter.create("message.uncompressed_size");
153+
144154
/**
145155
* An identifier for the database management system (DBMS) product being used.
146156
*

0 commit comments

Comments
 (0)