Skip to content

Conversation

@huangdijia
Copy link
Contributor

Summary

This PR enhances the Elasticsearch tracing capabilities by adding detailed server and HTTP request information to the Sentry spans.

Changes

  • Enhanced Tracing Data: Added server.address, server.port, http.request.method, and url.full attributes to Elasticsearch spans
  • Code Refactoring: Implemented tap() function for cleaner result processing and better code organization
  • Removed TODOs: Cleaned up completed TODO comments for HTTP tracing attributes
  • Transport Integration: Added proper extraction of request details from Elasticsearch transport layer

Technical Details

The changes modify src/sentry/src/Tracing/Aspect/ElasticsearchAspect.php to:

  • Extract transport information from the Elasticsearch client
  • Capture last request details including host, port, method, and full URL
  • Set comprehensive tracing data on the Sentry span
  • Use the tap helper for more functional programming approach

This provides much more detailed observability for Elasticsearch operations in Sentry, making debugging and monitoring significantly easier.

Testing

The changes maintain backward compatibility and enhance existing tracing functionality without breaking changes.

- Add server.address, server.port, http.request.method, and url.full tracing data
- Implement tap() function for cleaner result processing
- Remove TODO comments for completed HTTP tracing attributes
- Add proper type hints and transport request extraction
@coderabbitai
Copy link

coderabbitai bot commented Nov 20, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/elasticsearch-tracing-improvements

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@huangdijia huangdijia merged commit 81fa3ae into 3.2 Nov 20, 2025
75 of 77 checks passed
@huangdijia huangdijia deleted the feature/elasticsearch-tracing-improvements branch November 20, 2025 11:06
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.

1 participant