-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently the database URLs provided in SQL data are formatted like: {host}:{port}/{database} However, most (maybe all?) of the other X-Ray SDKs[1][2][3] format these URLs with the scheme prefixed in front, so: {scheme}://{host}:{port}/{database} This format is also enforced on the opentelemetry collector[4], and results in the following error when receiving traces with SQL data from this library: failed to parse out the database name in the "sql.url" field When this happens, traces are dropped by the opentelemetry collector and are not sent to AWS X-Ray. This change addresses these issues by prefixing the SQL data URLs with the scheme for both MySQL (`mysql://`) and Postgres (`postgresql://`). [1]: https://github.com/aws/aws-xray-sdk-python/blob/d3a202719e659968fe6dcc04fe14c7f3045b53e8/aws_xray_sdk/ext/sqlalchemy_core/patch.py#L30 [2]: https://github.com/aws/aws-xray-sdk-java/blob/master/aws-xray-recorder-sdk-sql-mysql/src/main/java/com/amazonaws/xray/sql/mysql/TracingInterceptor.java#L119 [3]: https://github.com/aws/aws-xray-sdk-ruby/blob/b2fce0c1f4ada747ebe16b973e1ed7069013a9a2/lib/aws-xray-sdk/facets/rails/active_record.rb#L50 [4]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/awsxrayreceiver/internal/translator/sql.go#L38-L39
- Loading branch information
Showing
4 changed files
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters