Skip to content

Provide db.operation and db.system at span start so it can be used for sampling decisions #1077

@trask

Description

@trask

Description

It looks like the old semantic conventions (which the library follows) didn't specify any database attributes as sampling relevant, but the new semantic conventions do (though these are renamed in the new semantic conventions).

span = tracer.spanBuilder(endpointId).setSpanKind(SpanKind.CLIENT).startSpan();
if (span.isRecording()) {
span.setAttribute(ATTR_DB_SYSTEM, "elasticsearch");
span.setAttribute(ATTR_DB_OPERATION, endpointId);

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions