Skip to content

Error Logging

Every failure your code logs is one OpenTelemetry log record of a fixed shape, so failures are counted, grouped and followed to their trace without reading their text.

FieldHolds
SeverityERROR, or FATAL for a failure that ends the process
BodyA short sentence naming what failed, such as settling the order failed
error.kindThe failure’s stable kebab-case code
vantacloud.operationThe operation the failure ended or interrupted, named as Telemetry Conventions names operations
Trace contextThe trace id and span id of the span the failure happened under, which the OpenTelemetry SDK sets when the record is emitted inside that span
exception.messageThe failure’s message, rendered with its causes
exception.stacktraceThe stack, where the language offers one
exception.typeThe language’s type of the failure, where it has one

The message and the stack are attributes of their own and never the body, so the body stays the same for every occurrence of one failure and groups them. The record follows the content rule of the conventions: a message names a value a person sent by its id, never the value itself.

error.kind names the failure apart from its message, so two failures with different causes have different kinds and one failure has one kind wherever it occurs. Take it from the code your error type already carries. A Rust service whose errors carry a code takes that code, such as not-found, conflict, unavailable or permission-denied, or the kebab-case name of the error’s variant. In another language, give each failure your code distinguishes a kebab-case name and keep it stable across releases.

Use one of these common kinds wherever it fits, and a kind of your own for every other failure: invalid-argument, not-found, conflict, refused, unavailable, limit-exceeded, io-error, permission-denied and other, for a failure your code cannot classify.

Your errors are counted per service and kind, so the default dashboard draws the errors of each kind of each service over time, and an error rate alert counts operations whose outcome class is server-error. A record’s trace context leads from the error to every span of the request it ended.