Skip to content

Do not warn when parent span is missing #310

@jakub-mikians-airspace-intelligence

Description

Hi!

I use your library to instrument my gRPC service, so great thanks for delivering and maintaining the lib!

I wonder if this condition should log warning:

let span = if self.filter.is_none_or(|f| f(req.uri().path())) {
let span = otel_http::grpc_server::make_span_from_request(&req);
if let Err(error) = span.set_parent(otel_http::extract_context(req.headers())) {
tracing::warn!(?error, "can not set parent trace_id to span");

If there is an external call from gRPC client that is not properly instrumented and does not pass the "parent span", then the the code here would log a warning, where in fact the warning is not really actionable. This seems "fine" to just carry on without setting the parent span, if the span is not delivered in the request context.

I would change tracing::warn! to tracing::debug!, since this log might be useful for debugging, but not for day-to-day operation.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions