Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Transaction.prototype.setParentSpan as public API #2935

Open
Holi0317 opened this issue Sep 19, 2022 · 0 comments
Open

Expose Transaction.prototype.setParentSpan as public API #2935

Holi0317 opened this issue Sep 19, 2022 · 0 comments
Assignees
Labels
agent-nodejs Make available for APM Agents project planning. community triage

Comments

@Holi0317
Copy link

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

The application we are trying to instrument is sending a command through AWS SQS when an HTTP endpoint is hit. The command will then got picked up by a lambda handler.

We are following Message queue guide for sending the traceparent over to the SQS handler. The handler will attach the trace parent to the handler lifecycle and report to APM with the transaction created from the HTTP endpoint.

However, we also got auto instrumentation enabled. So when our lambda handler runs, there is already a transaction created by apm agent with a generated transaction ID.

I want a way to set my trace parent for a given transaction.

Describe the solution you'd like

The GenericSpan type (inherited by Transaction and Span) already got setParentSpanfunction in it. If this API is exposed, I can then solve the problem and correlate transactions correctly.

Describe alternatives you've considered

I tried to create a new transaction and attaching the trace parent I want to use. But that breaks kibana and report no child span inside the transaction. Kibana seems picking up the transaction generated by auto instrumentation.

I could disable auto instrumentation but that would be too much work from our end.

Additional context

I am opening this issue from the comment of #2885 (comment).

@github-actions github-actions bot added agent-nodejs Make available for APM Agents project planning. community triage labels Sep 19, 2022
@david-luna david-luna self-assigned this Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning. community triage
Projects
None yet
Development

No branches or pull requests

2 participants