Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/grafana-cloud/ai-tools/gcx/guides/log-http-payloads.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana-cloud/ai-tools/gcx/guides/log-http-payloads/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
Log HTTP payloads for debugging
gcx --insecure-log-http-payload <command> enables full HTTP request/response
body logging for the lifetime of the command. This flag is intended for local
debugging of authentication and API issues only.
What gets logged
When this flag is set, gcx writes the full HTTP request and response of every
call to the debug log, including:
- Authorization tokens (
Authorization: Bearer …,X-Grafana-Token: …) - Cookies (session tokens, CSRF tokens)
- OAuth refresh tokens (
oauth-refresh-token,gar_…values) - Request and response bodies (JSON payloads that may embed credentials)
The dump is the innermost transport layer. It therefore shows every header that
reaches the wire, including the bearer token that the OAuth transport adds, the
X-Grafana-Caller-Id header, and the user agent.
DumpRequestOut serializes the request in HTTP/1.1 form. The transport can use
HTTP/2, so the request line and framing are not always the exact wire format.
How to find the dump
The dumps log at Debug level, so they need -vvv. Each dump carries a
label, because a wire dump holds no word that identifies it:
http request dumphttp response dump
Search for the label, not for the word “body”:
gcx --insecure-log-http-payload -vvv <command> 2>&1 | grep -A20 "http request dump"A dump looks like this. The request line, the headers, and the raw body follow the label:
DEBUG http request dump
POST /api/plugins/grafana-irm-app/resources/oncall/…/schedules/ HTTP/1.1
Host: example.grafana.net
Authorization: Bearer <token>
Content-Type: application/json
Content-Length: 42
{"name":"primary-rotation","type":"calendar"}No response dump appears when the round trip fails, because there is no
response to dump. The WARN http error line carries the reason.
The dump also covers the OAuth token refresh exchange, because gcx sends the
refresh request through the same logging.
Those dumps carry the refresh token and, on success, the rotated token pair.
When a refresh fails, gcx never sends your original request, so only the refresh
exchange appears. The WARN http error line still carries the reason. Log in
again, then repeat the command:
WARN http error method=GET url=https://… error="token refresh failed: session expired"Why redaction is intentional
When you debug authentication problems, you need to verify that the correct
token is being sent and that the server is returning the expected response.
Redacting credentials would defeat the flag’s purpose. The flag’s name
(--insecure-log-http-payload) is a deliberate signal that enabling it
produces sensitive output.
Recommended workflow
- Run
gcx --insecure-log-http-payload -vvv <command>locally. - Inspect the log output in your terminal.
- Do not pipe the output to a file and share it, paste it into a Slack channel, or attach it to a GitHub issue without first redacting all token values.
- Rotate any credentials that appeared in logs you shared externally.
Startup warning
When --insecure-log-http-payload is active, gcx prints a one-line warning
to stderr before any HTTP traffic flows:
WARNING: --insecure-log-http-payload is set. Authorization tokens, cookies,
OAuth refresh tokens, and request bodies will be written to debug logs.
Do not share or ship these logs.Migration from --log-http-payload
The flag was renamed to make the risk explicit. Using the old name
--log-http-payload now exits with an error:
unknown flag: --log-http-payload has been renamed; use --insecure-log-http-payload insteadThe rename itself did not change the dump. It changed the flag name and added the startup warning.
Was this page helpful?
Related resources from Grafana Labs


