Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace stringLeading method with Java 8 friendlty alternative (#902)
*Issue #, if available:* The stringLeading method is only available in Java 11+. This doesn't meet our requirement of ADOT Java being available for Java 8+. We need to find an alternative method. *Description of changes:* Refactor code to be Java 8 friendlty *Test run:* https://github.com/aws-observability/aws-otel-java-instrumentation/actions/runs/11158858146 *Note* Previously, the test was failing Java 8 for EKS use case. With this new change, it is passing now. This proves that: 1. The function `getDBStatementRemoteOperation`, specfically `stripLeading()` is being tested by E2E test 2. The new change does not affect Java 11+ and also fixes Java 8 Unit tests also show that combinations of different attributes all pass ([Link](https://github.com/aws-observability/aws-otel-java-instrumentation/blob/main/awsagentprovider/src/test/java/software/amazon/opentelemetry/javaagent/providers/AwsMetricAttributeGeneratorTest.java#L573)) By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
- Loading branch information