Skip to content

Override sampled state from traceparent header #2554

@spalger

Description

@spalger

Is your feature request related to a problem? Please describe.
I'm running a service using Google Cloud Run. Distributed tracing is a feature of cloud run if you use their tooling, and they automatically set a traceparent header for each request that comes into the service with a 0.1 trace sampling rate applied. APM sees this traceparent header and ignores the transactionSampleRate config I have provided and only samples transactions that Google Cloud Run deems "sampled". I'd really like to be able to control this behavior so that I can store APM transactions regardless of what Google Cloud Run deems noteworthy.

Describe the solution you'd like
I'd like a way to override the "sample" state that come from the traceparent header.

Describe alternatives you've considered
Wrapping the server.emit() method to delete the traceparent header before APM gets a chance to read it, requesting that Google Cloud Run allow customizing of the sample rate (which their docs explicitly state is not configurable)

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-nodejsMake available for APM Agents project planning.community

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions