Skip to content

--tp-ignore-env sends zeros rather than removing the parent_id #23

@mterhar

Description

@mterhar

When I tried to use this argument with a traceparent set, overwrite the parent span ID with zeros but it sent them as a string somehow.

Image

Script in question:

    END_TIME=$(date +%s.%N)
 
    otel-cli span \
        --name "cron-deploy" \
        --start "$START_TIME" \
        --end "$END_TIME" \
        --force-trace-id "$OTEL_CLI_FORCE_TRACE_ID" \
        --force-span-id "$ROOT_SPAN_ID" \
        --tp-ignore-env \
        --attrs "script=run-update.sh,status=$FINAL_STATUS,script_used=$SCRIPT_USED"

I fixed it by just removing the traceparent header all the way.

    END_TIME=$(date +%s.%N)
    unset TRACEPARENT
    otel-cli span \
        --name "cron-deploy" \
        --start "$START_TIME" \
        --end "$END_TIME" \
        --force-trace-id "$OTEL_CLI_FORCE_TRACE_ID" \
        --force-span-id "$ROOT_SPAN_ID" \
        --attrs "script=run-update.sh,status=$FINAL_STATUS,script_used=$SCRIPT_USED"

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