Skip to content

feat: Allow to record spans from nodejs child process #4766

Description

@Yuripetusko

Is your feature request related to a problem? Please describe.

We have a trigger.dev task that clones a repo and spawns a child process to run a script there. Obviously no traces reach the global trigger.dev tracer from separate node process. What would work is if we could register NodeTracerProvider with OTLPTraceExporter set to OTEL_EXPORTER_OTLP_ENDPOINT/OTEL_EXPORTER_OTLP_HEADERS of trigger.dev task (parent process).

OTEL_EXPORTER_OTLP_ENDPOINT is there, but OTEL_EXPORTER_OTLP_HEADERS is not exposed, so now way to direct spans to the right trigger run.

Describe the solution you'd like to see

Export something like runTracerSdk or maybe expose OTEL_EXPORTER_OTLP_HEADERS as variable on run ctx

Describe alternate solutions

No idea, I currently send child spans through IPC, but it sucks

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions