newrelic / newrelic/elixir_agent

Don't complete a Transaction until all tracked processes finish

Open
#552 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
Elixir
Stars
268
Forks
107
Avg merge
9h 5m
Merged PRs (30d)
2

Description

Right now, async work that happens in a process that lives longer than the main Transaction process won't get included because the Transaction completes when the main process exits.

We could modify this so that we wait for that async work to finish, so that the Transaction includes it.

Not certain this will be a good idea or not, given that we have no control over how long process live for. This could cause a Transaction to stay open indefinitely, which would essentially be a memory leak.

Possible solutions:

  • By default, wait until all tracked processes finish before completing a Transaction
    • Potentially have a timeout so that there's a max time we'd wait
  • Have a function that can be called in a Transaction to flag it so that we'll wait

Issues to figure out:

  • What should the Transaction end time be? End of the initial process? End of the last async process?
  • What about Transactions manually started and stopped. We currently rely on the stop_transaction behavior in order to allow another Transaction to start right after another in the same process. The pid is the key into the Transaction here
    • This might be a blocker

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name any files or tests. Start by tracing Transaction lifecycle handling and the stop_transaction behavior, including how the pid keys transactions. Done requires resolving when a transaction ends and how tracked asynchronous processes, timeouts, and manually started or stopped transactions should be handled.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.