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

Store Gin request query and payload #280

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

tombruijn
Copy link
Member

Add a middleware to the Gin app to record query parameters and request payload data.

We can add this to the docs for Go apps using OpenTelemetry.

@tombruijn
Copy link
Member Author

Test with:

curl --data 'tomsvar=POST' "http://localhost:4001/post-test?query_param=test_value"

And a JSON payload:

curl --data '{"param":"value","foo":"bar"}' -H "Content-Type: application/json" "http://localhost:4001/post-test?query_param=test_value"

Add a middleware to the Gin app to record query parameters and request
payload data.

We can add this to the docs for Go apps using OpenTelemetry.
@tombruijn tombruijn force-pushed the go-collector-parameters branch from 0a38d4d to b2ef813 Compare February 26, 2025 08:05
Make testing easier by setting these values for the root endpoint.
These imports crash the CI.
This change makes it so that the app itself can still access the request
payload after we've read it by restoring it on the request object.
No need to do `.Key` and then the value if you can set both in the
same function call.
@tombruijn tombruijn requested a review from unflxw February 27, 2025 07:56
I forgot the `request_` prefix for these filtering options so nothing
was filtered.
@backlog-helper
Copy link


This is a message from the daily scheduled checks.

New issue guide | Backlog management | Rules | Feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants