Skip to content

inject {{traceparent}} into commands passed to otel-cli exec #81

Closed

Description

@tobert

A common use case for otel-cli exec is to wrap curl. When a traceparent is already in the environment, it's pretty straightforward: otel-cli exec curl -H "traceparent: ${TRACEPARENT}" $url. Even when that's present sometimes we want a separate span around the exec, and currently doing that is clunky / hard.

If we add templating for command arguments passing through otel-cli exec it could be come straightforward to do:

otel-cli exec curl -H "traceparent: {{traceparent}}"

Where, otel-cli exec would start the span then inject that traceparent into the curl command's header, and then things should all line up nicely.

This code should be careful to only pass a traceparent it generated to avoid any security issues around command injection. It's not a terribly likely path of attack but worth keeping in mind when dealing with command manipulation.

Activity

  1. tobert commented on Feb 23, 2024

    @tobert
    ContributorAuthor

    Looks like someone needs this so I'll work on it soon. CC #306

  2. added a commit that references this issue on Mar 11, 2024
  3. tobert commented on Mar 11, 2024

    @tobert
    ContributorAuthor

    Shipped in 0.4.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestminorminor semver

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions