span-naming
Enforce span names that identify a class of Spans, rather than individual Span instances.
Rule Detailsβ
The span name concisely identifies the work represented by the Span, for example, an RPC method name, a function name, or the name of a subtask or stage within a larger computation. The span name SHOULD be the most general string that identifies a class of Spans, rather than individual Span instances while still being human-readable.
The following OTel semantic conventions for span names are defined:
HTTP spans:β
If span kind is "server"
, the name should follow this format:
{http.method} {http.route}
If span kind is "client"
, the name should follow this format:
{http.method}
Database spans:β
{db.operation} {db.name}.{db.sql.table}
If db.sql.table
is not available, the name should follow this format:
{db.operation} {db.name}
RPC spans:β
{package}.{service}/{method}
Messaging spans:β
{destination name} {operation name}
Optionsβ
This rule has the following options:
"error"
requires span names to follow the OTel semantic convention"disabled"
disables the span name verification"warning"
verifies span names to follow the OTel semantic convention but does not impact the analyzer score
When Not To Use Itβ
If you donβt want to enforce OTel span names, donβt enable this rule.