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

Add an option to log multihttp responses #550

Merged
merged 7 commits into from
Feb 7, 2024
Merged

Conversation

rdubrock
Copy link
Contributor

One of the main points of feedback we've gotten is that it would be nice to have more visibility into what's happening during the request. Logging response bodies is tricky because the can be 1.) gigantic or 2.) contain sensitive information. However, it would be super useful for debugging

I feel that by making logging response bodies an opt in option on a per request basis, and limiting to 1000 characters would give reasonable protection from both of these problems.

Screenshot 2023-10-30 at 13 11 15

@rdubrock rdubrock requested a review from a team as a code owner October 30, 2023 21:16
MultiHttpEntryRequest request = 1 [(gogoproto.jsontag) = "request,omitempty"]; // The request parameters.
repeated MultiHttpEntryAssertion assertions = 2 [(gogoproto.jsontag) = "checks,omitempty"]; // Zero or more assertions to be made on the response.
repeated MultiHttpEntryVariable variables = 3 [(gogoproto.jsontag) = "variables,omitempty"]; // Zero or more variables to be used in the request.
bool logResponse = 4 [(gogoproto.jsontag) = "logResponse,omitempty"]; // Whether to log the response body in the output.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there might be multiple requests, wouldn't it be better to call the field LogResponseBodies or LogResponses. I'm slightly in favor of the former, because it specifies what exactly will get added.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking this would be an option on a per request basis instead of all or nothing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be kind of a pain to specify for every request, though

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about that.

Why would anyone want to have the body to be logged? Mostly for debugging. In that case, I imagine they want all the responses.

Why would anyone not want a specific response logged? Because there's something sensitive in there that they don't want uploaded to Loki. In that case, why would they want the other responses logged?

If this is for debugging (the test button), the frontend can rework the request so that it includes the option in each response.

Also, the frontend could have a "log all responses" button that causes all the individual options to be set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok yeah I'm convinced. I'll rework it to be a global option

@rdubrock rdubrock merged commit 2584f5d into main Feb 7, 2024
4 checks passed
@rdubrock rdubrock deleted the log-response-option branch February 7, 2024 22:45
ka3de added a commit that referenced this pull request Feb 12, 2024
* Add an option to log multihttp responses (#550)
* Update to grafana-build-tools v0.6.0
* Chore(deps): Bump golang.org/x/net from 0.20.0 to 0.21.0
* Chore(deps): Bump github.com/rs/zerolog from 1.31.0 to 1.32.0
* Chore(deps): Bump github.com/miekg/dns from 1.1.57 to 1.1.58
* Fix: add test for HTTP check with a long URL
* Add tenant label limits (#581)

Signed-off-by: ka3de <[email protected]>
@ka3de ka3de mentioned this pull request Feb 12, 2024
ka3de added a commit that referenced this pull request Feb 12, 2024
* Add an option to log multihttp responses (#550)
* Update to grafana-build-tools v0.6.0
* Chore(deps): Bump golang.org/x/net from 0.20.0 to 0.21.0
* Chore(deps): Bump github.com/rs/zerolog from 1.31.0 to 1.32.0
* Chore(deps): Bump github.com/miekg/dns from 1.1.57 to 1.1.58
* Fix: add test for HTTP check with a long URL
* Add tenant label limits (#581)

Signed-off-by: ka3de <[email protected]>
mem added a commit that referenced this pull request Feb 12, 2024
* Add an option to log multihttp responses (#550)
* Update to grafana-build-tools v0.6.0
* Chore(deps): Bump golang.org/x/net from 0.20.0 to 0.21.0
* Chore(deps): Bump github.com/rs/zerolog from 1.31.0 to 1.32.0
* Chore(deps): Bump github.com/miekg/dns from 1.1.57 to 1.1.58
* Fix: add test for HTTP check with a long URL
* Add tenant label limits (#581)
* Release v0.20.0 (#613)
* Fix global tenant id usage for label limits query

Signed-off-by: Marcelo E. Magallon <[email protected]>
@mem mem mentioned this pull request Feb 12, 2024
mem added a commit that referenced this pull request Feb 12, 2024
* Add an option to log multihttp responses (#550)
* Update to grafana-build-tools v0.6.0
* Chore(deps): Bump golang.org/x/net from 0.20.0 to 0.21.0
* Chore(deps): Bump github.com/rs/zerolog from 1.31.0 to 1.32.0
* Chore(deps): Bump github.com/miekg/dns from 1.1.57 to 1.1.58
* Fix: add test for HTTP check with a long URL
* Add tenant label limits (#581)
* Release v0.20.0 (#613)
* Fix global tenant id usage for label limits query

Signed-off-by: Marcelo E. Magallon <[email protected]>
mem added a commit that referenced this pull request Feb 14, 2024
* Add an option to log multihttp responses (#550)
* Update to grafana-build-tools v0.6.0
* Chore(deps): Bump golang.org/x/net from 0.20.0 to 0.21.0
* Chore(deps): Bump github.com/rs/zerolog from 1.31.0 to 1.32.0
* Chore(deps): Bump github.com/miekg/dns from 1.1.57 to 1.1.58
* Fix: add test for HTTP check with a long URL
* Add tenant label limits (#581)
* Release v0.20.0 (#613)
* Fix global tenant id usage for label limits query
* Release v0.20.1
* Feature: promote adhoc to permanent feature (#615)
* Update release script (#617)
* Chore(deps): Bump github.com/mccutchen/go-httpbin/v2 (#618)
* Fix: missing http check regex validations (#612)

Signed-off-by: Marcelo E. Magallon <[email protected]>
@mem mem mentioned this pull request Feb 14, 2024
mem added a commit that referenced this pull request Feb 15, 2024
* Add an option to log multihttp responses (#550)
* Update to grafana-build-tools v0.6.0
* Chore(deps): Bump golang.org/x/net from 0.20.0 to 0.21.0
* Chore(deps): Bump github.com/rs/zerolog from 1.31.0 to 1.32.0
* Chore(deps): Bump github.com/miekg/dns from 1.1.57 to 1.1.58
* Fix: add test for HTTP check with a long URL
* Add tenant label limits (#581)
* Release v0.20.0 (#613)
* Fix global tenant id usage for label limits query
* Release v0.20.1
* Feature: promote adhoc to permanent feature (#615)
* Update release script (#617)
* Chore(deps): Bump github.com/mccutchen/go-httpbin/v2 (#618)
* Fix: missing http check regex validations (#612)

Signed-off-by: Marcelo E. Magallon <[email protected]>
ka3de added a commit that referenced this pull request Feb 26, 2024
* Add an option to log multihttp responses (#550)
* Update to grafana-build-tools v0.6.0
* Chore(deps): Bump golang.org/x/net from 0.20.0 to 0.21.0
* Chore(deps): Bump github.com/rs/zerolog from 1.31.0 to 1.32.0
* Chore(deps): Bump github.com/miekg/dns from 1.1.57 to 1.1.58
* Fix: add test for HTTP check with a long URL
* Add tenant label limits (#581)
* Release v0.20.0 (#613)
* Fix global tenant id usage for label limits query
* Release v0.20.1
* Feature: promote adhoc to permanent feature (#615)
* Update release script (#617)
* Chore(deps): Bump github.com/mccutchen/go-httpbin/v2 (#618)
* Fix: missing http check regex validations (#612)
* Release v0.20.2 (#620)
* Chore(deps): Bump github.com/mccutchen/go-httpbin/v2 (#626)
* change the name of the k6 check type to scripted (#622)
* Chore(deps): Bump github.com/prometheus/client_model from 0.5.0 to 0.6.0
* Chore(deps): Bump google.golang.org/grpc from 1.61.0 to 1.61.1
* Chore(deps): Bump github.com/prometheus/common from 0.46.0 to 0.47.0
* Chore(deps): Bump github.com/prometheus/prometheus from 0.49.1 to 0.50.0
* Add header to ease tracking HTTP requests (#624)
* Add telemetry protobuf definitions (#627)

Signed-off-by: ka3de <[email protected]>
@ka3de ka3de mentioned this pull request Feb 26, 2024
ka3de added a commit that referenced this pull request Feb 26, 2024
* Add an option to log multihttp responses (#550)
* Update to grafana-build-tools v0.6.0
* Chore(deps): Bump golang.org/x/net from 0.20.0 to 0.21.0
* Chore(deps): Bump github.com/rs/zerolog from 1.31.0 to 1.32.0
* Chore(deps): Bump github.com/miekg/dns from 1.1.57 to 1.1.58
* Fix: add test for HTTP check with a long URL
* Add tenant label limits (#581)
* Release v0.20.0 (#613)
* Fix global tenant id usage for label limits query
* Release v0.20.1
* Feature: promote adhoc to permanent feature (#615)
* Update release script (#617)
* Chore(deps): Bump github.com/mccutchen/go-httpbin/v2 (#618)
* Fix: missing http check regex validations (#612)
* Release v0.20.2 (#620)
* Chore(deps): Bump github.com/mccutchen/go-httpbin/v2 (#626)
* change the name of the k6 check type to scripted (#622)
* Chore(deps): Bump github.com/prometheus/client_model from 0.5.0 to 0.6.0
* Chore(deps): Bump google.golang.org/grpc from 1.61.0 to 1.61.1
* Chore(deps): Bump github.com/prometheus/common from 0.46.0 to 0.47.0
* Chore(deps): Bump github.com/prometheus/prometheus from 0.49.1 to 0.50.0
* Add header to ease tracking HTTP requests (#624)
* Add telemetry protobuf definitions (#627)

Signed-off-by: ka3de <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants