Add db.response.status_code
attribute, deprecate db.cosmos.status_code
#1424
+325
−145
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introducing status code for database call based on the discussion in DB Semconv.
Most databases support a notion of a status code (usually representing an error, but also used for warnings and sometimes to differentiate success results).
E.g. SQL standard defines
SQLSTATE
- a string code. It, for example, appears on thejava.sql.SqlException#getSQLStateType
.Databases that run on top of HTTP/gRPC/etc may also support status codes from that protocol. For example, Cosmos DB can run on top of HTTP or RNTBD (proprietary protocol), but needs one status code for both.
HBase supports HTTP, Thrift and gRPC and may report different codes depending on the protocol.
We need a place to capture DB response code that's not protocol-specific and could be reported on common metrics for all databases.
error.type
does not work at least in some cases"42000"
, orInvalidPreparedStatementDefinition
instead of"42P14"
, but there are no guarantees that exception type maps 1:1 to error code. So we want to capture both.ALREADY_EXISTS
forcreateIfNotExist
call and it's not an error, but also useful to know if resource already existed).Merge requirement checklist
[chore]