Considerations
Use Cases
Enrich incomplete database spans- Some instrumentations record only the raw query text. This action derives OpenTelemetry semantic attributes (
db.operation.name,db.collection.name) so backends can filter and group by operation and table.
- Normalized span names such as
SELECT usersmake traces easier to read and improve aggregations when span metrics are enabled.
- Apply the same inference rules cluster-wide, regardless of which language or library produced the span.
Configuration Options
The InferDbAttributes action is configured using theodigos.io/v1alpha1.Action CRD with the inferDbAttributes configuration section.
actionName
actionName
actionName
string : Allows you to attach a meaningful name to the action for convenience.- This field is optional
- Odigos does not use or assume any meaning from this field
notes
notes
notes
string : Allows you to attach notes regarding the action for convenience.- This field is optional
- Odigos does not use or assume any meaning from this field
disabled
disabled
disabled
boolean : Allows you to temporarily disable the action, but keep it saved for future use.- This field is optional, and defaults to
false
signals *
signals *
signals
string[] : An array with the signals that the action will operate on.- This field is required
- Supported values:
TRACES
inferDbAttributes *
inferDbAttributes *
inferDbAttributes
object : Configuration for the InferDbAttributes action.- This field is required for this action type
- No additional options are required; an empty object enables inference for matching sources.
scopes
scopes
scopes
object : Limits which sources this config applies to.- This field is optional
- If unset or empty, the config is applied to all sources.
- If multiple source scopes are set, they must all match simultaneously (AND logic).
sources
sources
sources
object[] : A list of workloads to apply this action to.- Each entry requires
name,namespace, andkind(Deployment,StatefulSet, orDaemonSet).
namespaces
namespaces
namespaces
string[] : Apply this action to all sources in the listed namespaces.languages
languages
languages
string[] : Apply this action only to containers instrumented with the listed programming languages.Basic Example
Given a span with:db.operation.name / db.collection.name, the action adds:
and updates the span name to
SELECT users if it hasn’t been set to that already.
1
Create a YAML file with the following content:
infer-db-attributes.yaml
2
Apply the action to the cluster:
Scoped Example
To limit inference to specific workloads, addscopes. Omit scopes (or leave it empty) to apply the action to all sources.
infer-db-attributes-scoped.yaml