Skip to content

Cannot log application errors through tokio tracing #93

@Havunen

Description

@Havunen

Hi,

There is some issue where logging "exceptions" seems impossible through tokio tracing.

Steps to reproduce:

Edit the example in examples/tracing/main.rs

#[instrument(fields(test.in_attr="in attr"))]
async fn run_in_child_process() {
    tracing::info!(test.in_event="in event", "leaf fn");

    sleep(Duration::from_millis(50)).await;

    tracing::event!(
        name: "exception",
        Level::ERROR,
        ai.customEvent.name = "exception"
    );

    sleep(Duration::from_millis(50)).await;
}

When the exception event arrives to create_envelopes_for_span the name of the event is "" and then the correct application insights type is not set and the exception is not correctly shown in application insights.

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