Skip to content

Conversation

khpeet
Copy link

@khpeet khpeet commented May 7, 2025

This PR adds support for the Camunda Pyzeebe Module

  • Tracing and useful metadata collection for ZybeeClient functions
  • Tracing and useful metadata for ZybeeWorker decorators - @worker.task / @router.task

Need help with writing some tests for this instrumentation though

@khpeet khpeet requested a review from a team as a code owner May 7, 2025 20:31
@mergify mergify bot added the tests-failing Tests failing in CI. label May 7, 2025
@codecov-commenter
Copy link

codecov-commenter commented May 7, 2025

Codecov Report

❌ Patch coverage is 79.72973% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.44%. Comparing base (c2f8fe4) to head (93d1520).

Files with missing lines Patch % Lines
newrelic/hooks/external_pyzeebe.py 79.16% 5 Missing and 10 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1385   +/-   ##
=======================================
  Coverage   81.44%   81.44%           
=======================================
  Files         209      210    +1     
  Lines       23815    23889   +74     
  Branches     3753     3771   +18     
=======================================
+ Hits        19396    19457   +61     
- Misses       3159     3164    +5     
- Partials     1260     1268    +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@khpeet khpeet marked this pull request as draft May 7, 2025 21:06
@mergify mergify bot removed the tests-failing Tests failing in CI. label May 8, 2025
@khpeet khpeet requested a review from umaannamalai May 28, 2025 17:56
@mergify mergify bot added the tests-failing Tests failing in CI. label May 28, 2025
@khpeet khpeet requested a review from umaannamalai June 18, 2025 13:56
@mergify mergify bot added the merge-conflicts Merge conflicts detected. label Jun 18, 2025
@khpeet khpeet requested a review from umaannamalai July 25, 2025 17:12
@hmstepanek hmstepanek self-requested a review August 26, 2025 19:12
@hmstepanek hmstepanek marked this pull request as ready for review August 26, 2025 23:29
Copy link
Contributor

@hmstepanek hmstepanek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posting a partial review-ran out of time for today but I'll review the tests tomorrow.

@khpeet khpeet requested a review from hmstepanek August 27, 2025 14:29
Copy link
Contributor

@hmstepanek hmstepanek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this PR needs to be rebased onto the latest main. It looks like there's also some missing coverage so we need to add some more tests for the following:

  • For what was previously the if-statements at the top of the new hooks file (now they are calling that extract function) we need to add coverage for message_id under publish_message and resources under deploy_resource.
  • The background task creation else clause is missing coverage.

@mergify mergify bot removed the merge-conflicts Merge conflicts detected. label Sep 3, 2025
@khpeet khpeet requested a review from hmstepanek September 3, 2025 19:05
@mergify mergify bot removed the tests-failing Tests failing in CI. label Sep 4, 2025
Copy link
Contributor

@hmstepanek hmstepanek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, this looks really good now! I had one note about he resourceCount getting dropped and the only other thing I see in coverage now is we need a test to cover this line:
https://app.codecov.io/github/newrelic/newrelic-python-agent/commit/93d1520084d254e15c030b895972c73290856e9a#c9c66516ae9ada6bf1c147f9dda06069-R93
Basically create a test without a background_task decorator and expect no data present. There are examples of this in other instrumentation tests you can use as a reference.

resource = extract_agent_attribute_from_methods(args, {}, method_name, ("deploy_resource"), None, 0)
if resource:
try:
trace._add_agent_attribute("zeebe.client.resourceFile", resource)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't we missing a resourceCount here?

Suggested change
trace._add_agent_attribute("zeebe.client.resourceFile", resource)
trace._add_agent_attribute("zeebe.client.resourceFile", resource)
trace._add_agent_attribute("zeebe.client.resourceCount", len(list(args)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants