Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: AWS xray tracing config #44

Merged
merged 9 commits into from
Sep 4, 2023
Merged

feat: AWS xray tracing config #44

merged 9 commits into from
Sep 4, 2023

Conversation

ReubenRobertsHEE
Copy link
Contributor

@ReubenRobertsHEE ReubenRobertsHEE commented Mar 24, 2023

TIS21-4226

@ReubenRobertsHEE ReubenRobertsHEE marked this pull request as draft March 24, 2023 16:17
@Judge40
Copy link
Contributor

Judge40 commented Mar 24, 2023

No idea how to test this at this point :)

If you run the daemon locally you can see data in the AWS console.
There's some docker compose config floating around on slack, but I'm not sure if the fully fixed config is or not.

@Judge40
Copy link
Contributor

Judge40 commented Mar 24, 2023

Xray daemon config is now in the handbook

@ReubenRobertsHEE
Copy link
Contributor Author

Juicy errors now!

2023-03-28T11:12:18.370+01:00  INFO 21764 --- [nio-8210-exec-4] u.n.h.t.t.c.api.VerifyResource           : Received callback for credential verification.
2023-03-28T11:12:18.375+01:00 ERROR 21764 --- [nio-8210-exec-4] c.a.x.s.LogErrorContextMissingStrategy   : Suppressing AWS X-Ray context missing exception (SegmentNotFoundException): Failed to begin subsegment named 'completeCredentialVerification': segment cannot be found.
2023-03-28T11:12:18.394+01:00 ERROR 21764 --- [nio-8210-exec-4] c.a.x.s.LogErrorContextMissingStrategy   : Suppressing AWS X-Ray context missing exception (SegmentNotFoundException): Failed to begin subsegment named 'getTokenClaims': segment cannot be found.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

83.3% 83.3% Coverage
0.0% 0.0% Duplication

@ReubenRobertsHEE
Copy link
Contributor Author

@Judge40 I am at a bit of an impasse here, wondering what you think.

The 'segment cannot be found' errors seem to suggest the servlet filter is not properly configured (as per 1st point on https://docs.aws.amazon.com/xray/latest/devguide/xray-troubleshooting.html).

The latest version of the Xray Recorder SDK still implements a javax.servlet.Filter , whereas Spring 3 works off a jakarta.servlet.Filter afaik. This is the reason for manually including "javax.servlet:javax.servlet-api:4.0.1" in the build file, but I can't get it working correctly with this import. I'm wondering how much manual re-jigging is going to be needed here (or whether we wait to see if another release of the Xray SDK solves all our problems!) Fwiw, it does seem to be a known issue as of a few months ago... https://stackoverflow.com/questions/74616492/cannot-access-javax-servlet-filter-class-file-for-javax-servlet-filter-not-found

@Judge40
Copy link
Contributor

Judge40 commented Mar 28, 2023

@Judge40 I am at a bit of an impasse here, wondering what you think.

The 'segment cannot be found' errors seem to suggest the servlet filter is not properly configured (as per 1st point on https://docs.aws.amazon.com/xray/latest/devguide/xray-troubleshooting.html).

The latest version of the Xray Recorder SDK still implements a javax.servlet.Filter , whereas Spring 3 works off a jakarta.servlet.Filter afaik. This is the reason for manually including "javax.servlet:javax.servlet-api:4.0.1" in the build file, but I can't get it working correctly with this import. I'm wondering how much manual re-jigging is going to be needed here (or whether we wait to see if another release of the Xray SDK solves all our problems!) Fwiw, it does seem to be a known issue as of a few months ago... https://stackoverflow.com/questions/74616492/cannot-access-javax-servlet-filter-class-file-for-javax-servlet-filter-not-found

Related issue: aws/aws-xray-sdk-java#364
Related PR: aws/aws-xray-sdk-java#372

Looks like it's fix/merged but not yet released.
Without having to duplicate a load of AWS code we might just have to wait for that release.

@ReubenRobertsHEE
Copy link
Contributor Author

Ok cool, thanks for confirming @Judge40 .

Given we are not going 'live' by any realistic measure for the next couple of months at least, shall we just park this piece of work and pick it up when Xray catches up with us? :)

Update the AWS Xray SDK to `2.14.0`, which allows it to support Spring
6's Jakarta based Filters.
Move the tracing filter configuration to FilterConfiguration as the
tracing filter must be placed before the SignedDataFilter in the filter
chain. Failure to register them in this order will cause the trace to
fail for any unsigned data, as the SignedDataFilter returns an error
instead of continuing the filter chain calls.

TIS21-4226
@Judge40 Judge40 requested a review from a team August 31, 2023 22:20
@Judge40 Judge40 marked this pull request as ready for review August 31, 2023 22:20
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

91.7% 91.7% Coverage
0.0% 0.0% Duplication

@Judge40 Judge40 merged commit 4005402 into main Sep 4, 2023
@Judge40 Judge40 deleted the feat/xrayTracing branch September 4, 2023 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants