newrelic / newrelic-dotnet-agent

The New Relic .NET language agent.
Apache License 2.0
98 stars 62 forks source link

Improve Kafka instrumentation interaction with custom instrumentation #2829

Open nrcventura opened 1 month ago

nrcventura commented 1 month ago

The .net agent did not always support automatic instrumentation of Kafka. Many people previously relied on custom instrumentation of services to provide visibility into their kafka consumers. After adding support for kafka instrumentation, there have been scenarios where the kafka instrumentation can end the transaction before the custom instrumentation expected the transaction to end.

This happens because the Kafka instrumentation expected to create the transaction, and when it's call is done, it will end the transaction.

There are two possible ways to handle this problem.

  1. The agent instrumentation can check to see if a transaction already exists and only end the transaction if one didn't previously exist.
  2. Try to leverage the unit of work parameter in the CreateTransaction method (this might need to be tied to a transaction existence check though).

Acceptance Criteria

Dependencies

None

Estimates

Initial t-shirt size: M

workato-integration[bot] commented 1 month ago

https://new-relic.atlassian.net/browse/NR-324673