-
Notifications
You must be signed in to change notification settings - Fork 591
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(diag) expose unparseable config errors #5773
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5773 +/- ##
=======================================
+ Coverage 71.4% 74.0% +2.6%
=======================================
Files 176 176
Lines 18185 18207 +22
=======================================
+ Hits 12986 13480 +494
+ Misses 4248 3733 -515
- Partials 951 994 +43 ☔ View full report in Codecov by Sentry. |
1b91b2c and the changelog were supposed to be there originally but I forgot to push the commit |
Add a diagnostic endpoint for raw config errors to simplify problem identification when Kong does not return flattened errors.
Co-authored-by: Patryk Małek <patryk.malek@konghq.com>
bc384a7
to
b312ebb
Compare
Accidentally included some local temp change I'd made to make a test run forever so I could check some things 🤦 |
What this PR does / why we need it:
Add a diagnostic endpoint for raw config errors to simplify problem identification when Kong does not return flattened errors.
Attempt to log the
message
field if we cannot unmarshal a config error into the proper type.Which issue this PR fixes:
Fix #5762
Special notes for your reviewer:
Logs from practical testing:
Diag output looks like endpoints.txt using resources in test.yaml.txt
I wanted to log the basic
message
field as well, to provide a more accessible (no need to enable config dumps) record of mystery errors. The body observed in the original report does have amessage
field:We unmarshal into a struct that has a
message
field and omits the rest if missing, but it's still failing for some reason. The laziermap[string]interface{}{}
unmarshal hopefully handles this if we've at least gotten a Kong JSON config error and not a generic 500 or whatever.PR Readiness Checklist:
Complete these before marking the PR as
ready to review
:CHANGELOG.md
release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR