Skip to content

Conversation

basepi
Copy link
Contributor

@basepi basepi commented Aug 18, 2022

What does this pull request do?

Checks if the span object is non-None before trying to access its context.

No test attached. I've been unable to get one to fail even without the fix....it may be that we're missing something in the user's edge case. In any case, I think this is a change that should fix the user's issue, and is extremely low-risk. So I think we can forgo the test.

Related issues

Closes #1615

@ghost
Copy link

ghost commented Aug 18, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-08-22T18:07:21.003+0000

  • Duration: 31 min 16 sec

Test stats 🧪

Test Results
Failed 0
Passed 4974
Skipped 3420
Total 8394

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /test linters : Run the Python linters only.

  • /test full : Run the full matrix of tests.

  • /test benchmark : Run the APM Agent Python benchmarks tests.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@ghost
Copy link

ghost commented Aug 18, 2022

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (68/68) 💚
Files 100.0% (227/227) 💚
Classes 100.0% (227/227) 💚
Lines 89.755% (17452/19444) 👎 -0.163
Conditionals 77.18% (3186/4128) 👎 -0.101

@basepi
Copy link
Contributor Author

basepi commented Aug 18, 2022

/test full

@basepi basepi marked this pull request as ready for review August 18, 2022 22:46
@basepi basepi requested a review from trentm August 18, 2022 22:46
Copy link
Member

@trentm trentm left a comment

Choose a reason for hiding this comment

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

Seems reasonable (not knowing the agent internals at all well :). It looks like redis.py and aioredis.py have a similar guard.

There is a call to execution_context.get_span() in "asyncio/elasticsearch.py" as well that doesn't have a guard. Perhaps that should eventually get it as well.

@basepi basepi enabled auto-merge (squash) August 22, 2022 18:28
@basepi basepi merged commit 00ba66c into elastic:main Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

enabling sniff_on_start in elasticsearch() breaks elasticserach instrumentation
2 participants