You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/otel/sdk-metrics.md
+8-29Lines changed: 8 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1269,9 +1269,9 @@ operations, `error.type` MUST NOT be set. For unsuccessful export operations, `e
1269
1269
|[`http.response.status_code`](/docs/registry/attributes/http.md)| int | The HTTP status code of the last HTTP request performed in scope of this export call. |`200`|`Recommended` when applicable ||
1270
1270
|[`otel.component.name`](/docs/registry/attributes/otel.md)| string | A name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance. [2]|`otlp_grpc_span_exporter/0`; `custom-name`|`Recommended`||
1271
1271
|[`otel.component.type`](/docs/registry/attributes/otel.md)| string | A name identifying the type of the OpenTelemetry component. [3]|`otlp_grpc_span_exporter`; `com.example.MySpanExporter`|`Recommended`||
1272
-
|[`rpc.grpc.status_code`](/docs/registry/attributes/rpc.md)|int| The gRPC status code of the last gRPC requests performed in scope of this export call. |`0`; `1`; `2`|`Recommended` when applicable ||
1273
-
|[`server.address`](/docs/registry/attributes/server.md)| string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [4]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended` when applicable ||
1274
-
|[`server.port`](/docs/registry/attributes/server.md)| int | Server port number. [5]|`80`; `8080`; `443`|`Recommended` when applicable ||
1272
+
|[`rpc.status_code`](/docs/registry/attributes/rpc.md)|string| The gRPC status code of the last gRPC request performed in scope of this export call. [4]|`OK`; `DEADLINE_EXCEEDED`; `-32602`; `404`|`Recommended` when applicable ||
1273
+
|[`server.address`](/docs/registry/attributes/server.md)| string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [5]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended` when applicable ||
1274
+
|[`server.port`](/docs/registry/attributes/server.md)| int | Server port number. [6]|`80`; `8080`; `443`|`Recommended` when applicable ||
1275
1275
1276
1276
**[1]`error.type`:** The `error.type` SHOULD be predictable, and SHOULD have low cardinality.
1277
1277
@@ -1310,9 +1310,12 @@ These values will therefore be reused in the case of an application restart.
1310
1310
**[3]`otel.component.type`:** If none of the standardized values apply, implementations SHOULD use the language-defined name of the type.
1311
1311
E.g. for Java the fully qualified classname SHOULD be used in this case.
1312
1312
1313
-
**[4]`server.address`:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
1313
+
**[4]`rpc.status_code`:** The status code returned by the RPC server or generated by the client. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes.
1314
+
Semantic conventions for individual RPC frameworks SHOULD document what `rpc.status_code` means in the context of that system.
1314
1315
1315
-
**[5]`server.port`:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available.
1316
+
**[5]`server.address`:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
1317
+
1318
+
**[6]`server.port`:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available.
1316
1319
1317
1320
---
1318
1321
@@ -1345,30 +1348,6 @@ E.g. for Java the fully qualified classname SHOULD be used in this case.
1345
1348
|`simple_span_processor`| The builtin SDK simple span processor ||
1346
1349
|`zipkin_http_span_exporter`| Zipkin span exporter over HTTP ||
1347
1350
1348
-
---
1349
-
1350
-
`rpc.grpc.status_code` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
1351
-
1352
-
| Value | Description | Stability |
1353
-
|---|---|---|
1354
-
|`0`| OK ||
| <aid="rpc-connect-rpc-error-code"href="#rpc-connect-rpc-error-code">`rpc.connect_rpc.error_code`</a> | string | The [error codes](https://connectrpc.com//docs/protocol/#error-codes) of the Connect request. Error codes are always string values. |`cancelled`; `unknown`; `invalid_argument`||
16
15
| <aid="rpc-connect-rpc-request-metadata"href="#rpc-connect-rpc-request-metadata">`rpc.connect_rpc.request.metadata.<key>`</a> | string[]| Connect request metadata, `<key>` being the normalized Connect Metadata key (lowercase), the value being the metadata values. [1]|`["1.2.3.4", "1.2.3.5"]`||
17
16
| <aid="rpc-connect-rpc-response-metadata"href="#rpc-connect-rpc-response-metadata">`rpc.connect_rpc.response.metadata.<key>`</a> | string[]| Connect response metadata, `<key>` being the normalized Connect Metadata key (lowercase), the value being the metadata values. [2]|`["attribute_value"]`||
18
17
| <aid="rpc-grpc-request-metadata"href="#rpc-grpc-request-metadata">`rpc.grpc.request.metadata.<key>`</a> | string[]| gRPC request metadata, `<key>` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. [3]|`["1.2.3.4", "1.2.3.5"]`||
19
18
| <aid="rpc-grpc-response-metadata"href="#rpc-grpc-response-metadata">`rpc.grpc.response.metadata.<key>`</a> | string[]| gRPC response metadata, `<key>` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. [4]|`["attribute_value"]`||
20
-
| <aid="rpc-grpc-status-code"href="#rpc-grpc-status-code">`rpc.grpc.status_code`</a> | int | The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. |`0`; `1`; `2`||
21
-
| <aid="rpc-jsonrpc-error-code"href="#rpc-jsonrpc-error-code">`rpc.jsonrpc.error_code`</a> | int |`error.code` property of response if it is an error response. |`-32700`; `100`||
22
-
| <aid="rpc-jsonrpc-error-message"href="#rpc-jsonrpc-error-message">`rpc.jsonrpc.error_message`</a> | string |`error.message` property of response if it is an error response. |`Parse error`; `User already exists`||
23
19
| <aid="rpc-jsonrpc-request-id"href="#rpc-jsonrpc-request-id">`rpc.jsonrpc.request_id`</a> | string |`id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. |`10`; `request-7`; `` ||
24
20
| <aid="rpc-jsonrpc-version"href="#rpc-jsonrpc-version">`rpc.jsonrpc.version`</a> | string | Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 doesn't specify this, the value can be omitted. |`2.0`; `1.0`||
25
21
| <aid="rpc-message-compressed-size"href="#rpc-message-compressed-size">`rpc.message.compressed_size`</a> | int | Compressed size of the message in bytes. |||
@@ -28,6 +24,7 @@ This document defines attributes for remote procedure calls.
28
24
| <aid="rpc-message-uncompressed-size"href="#rpc-message-uncompressed-size">`rpc.message.uncompressed_size`</a> | int | Uncompressed size of the message in bytes. |||
29
25
| <aid="rpc-method"href="#rpc-method">`rpc.method`</a> | string | This is the logical name of the method from the RPC interface perspective. |`exampleMethod`||
30
26
| <aid="rpc-service"href="#rpc-service">`rpc.service`</a> | string | The full (logical) name of the service being called, including its package name, if applicable. |`myservice.EchoService`||
27
+
| <aid="rpc-status-code"href="#rpc-status-code">`rpc.status_code`</a> | string | Status code of the RPC call. [6]|`OK`; `DEADLINE_EXCEEDED`; `-32602`; `404`||
31
28
| <aid="rpc-system"href="#rpc-system">`rpc.system`</a> | string | A string identifying the remoting system. See below for a list of well-known identifiers. |`grpc`; `java_rmi`; `dotnet_wcf`||
32
29
33
30
**[1]`rpc.connect_rpc.request.metadata.<key>`:** Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured.
@@ -56,6 +53,56 @@ the `rpc.grpc.response.metadata.my-custom-key` attribute with value `["attribute
56
53
57
54
**[5]`rpc.message.id`:** This way we guarantee that the values will be consistent between different implementations.
58
55
56
+
**[6]`rpc.status_code`:** The status code returned by the RPC server or generated by the client. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes.
57
+
Semantic conventions for individual RPC frameworks SHOULD document what `rpc.status_code` means in the context of that system.
58
+
59
+
---
60
+
61
+
`rpc.message.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
62
+
63
+
| Value | Description | Stability |
64
+
|---|---|---|
65
+
|`RECEIVED`| received ||
66
+
|`SENT`| sent ||
67
+
68
+
---
69
+
70
+
`rpc.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| <aid="message-compressed-size"href="#message-compressed-size">`message.compressed_size`</a> | int | Deprecated, use `rpc.message.compressed_size` instead. ||<br>Replaced by `rpc.message.compressed_size`. |
89
+
| <aid="message-id"href="#message-id">`message.id`</a> | int | Deprecated, use `rpc.message.id` instead. ||<br>Replaced by `rpc.message.id`. |
90
+
| <aid="message-type"href="#message-type">`message.type`</a> | string | Deprecated, use `rpc.message.type` instead. |`SENT`; `RECEIVED`|<br>Replaced by `rpc.message.type`. |
91
+
| <aid="message-uncompressed-size"href="#message-uncompressed-size">`message.uncompressed_size`</a> | int | Deprecated, use `rpc.message.uncompressed_size` instead. ||<br>Replaced by `rpc.message.uncompressed_size`. |
92
+
| <aid="rpc-connect-rpc-error-code"href="#rpc-connect-rpc-error-code">`rpc.connect_rpc.error_code`</a> | string | Deprecated, use `rpc.status_code` attribute instead. |`cancelled`; `unknown`; `invalid_argument`|<br>Replaced by `rpc.status_code`. |
93
+
| <aid="rpc-grpc-status-code"href="#rpc-grpc-status-code">`rpc.grpc.status_code`</a> | int | Deprecated, use string representation on the `rpc.status_code` attribute instead. |`0`; `1`; `2`|<br>Use string representation of the gRPC status code on the `rpc.status_code` attribute. |
94
+
| <aid="rpc-jsonrpc-error-code"href="#rpc-jsonrpc-error-code">`rpc.jsonrpc.error_code`</a> | int | Deprecated, use string representation on the `rpc.status_code` attribute instead. |`-32700`; `100`|<br>Use string representation of the error code on the `rpc.status_code` attribute. |
95
+
| <aid="rpc-jsonrpc-error-message"href="#rpc-jsonrpc-error-message">`rpc.jsonrpc.error_message`</a> | string | Deprecated, use span status description or `error.message` attribute on other signals. |`Parse error`; `User already exists`|<br>Use the span status description to record error message or `error.message` attribute on other signals. |
96
+
97
+
---
98
+
99
+
`message.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
100
+
101
+
| Value | Description | Stability |
102
+
|---|---|---|
103
+
|`RECEIVED`| received ||
104
+
|`SENT`| sent ||
105
+
59
106
---
60
107
61
108
`rpc.connect_rpc.error_code` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
@@ -102,46 +149,3 @@ the `rpc.grpc.response.metadata.my-custom-key` attribute with value `["attribute
`rpc.message.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
109
-
110
-
| Value | Description | Stability |
111
-
|---|---|---|
112
-
|`RECEIVED`| received ||
113
-
|`SENT`| sent ||
114
-
115
-
---
116
-
117
-
`rpc.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| <aid="message-compressed-size"href="#message-compressed-size">`message.compressed_size`</a> | int | Deprecated, use `rpc.message.compressed_size` instead. ||<br>Replaced by `rpc.message.compressed_size`. |
136
-
| <aid="message-id"href="#message-id">`message.id`</a> | int | Deprecated, use `rpc.message.id` instead. ||<br>Replaced by `rpc.message.id`. |
137
-
| <aid="message-type"href="#message-type">`message.type`</a> | string | Deprecated, use `rpc.message.type` instead. |`SENT`; `RECEIVED`|<br>Replaced by `rpc.message.type`. |
138
-
| <aid="message-uncompressed-size"href="#message-uncompressed-size">`message.uncompressed_size`</a> | int | Deprecated, use `rpc.message.uncompressed_size` instead. ||<br>Replaced by `rpc.message.uncompressed_size`. |
139
-
140
-
---
141
-
142
-
`message.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
143
-
144
-
| Value | Description | Stability |
145
-
|---|---|---|
146
-
|`RECEIVED`| received ||
147
-
|`SENT`| sent ||
0 commit comments