Skip to content

Commit

Permalink
UI: use prometheus POST query API (#7377)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Hoffmann <mhoffm@posteo.de>
  • Loading branch information
MichaHoffmann committed May 22, 2024
1 parent 9db31c2 commit 8834a47
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
7 changes: 4 additions & 3 deletions pkg/ui/react-app/src/pages/graph/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class Panel extends Component<PanelProps & PathPrefixProps, PanelState> {

// Create request headers
const requestHeaders: HeadersInit = new Headers();
requestHeaders.set('Content-Type', 'application/json');
requestHeaders.set('Content-Type', 'application/x-www-form-urlencoded');

if (this.props.options.forceTracing) {
requestHeaders.set('X-Thanos-Force-Tracing', 'true');
Expand All @@ -257,9 +257,10 @@ class Panel extends Component<PanelProps & PathPrefixProps, PanelState> {
requestHeaders.set(tenantHeader, this.props.options.tenant);
}

fetch(`${this.props.pathPrefix}${path}?${params}`, {
method: 'GET',
fetch(`${this.props.pathPrefix}${path}`, {
method: 'POST',
headers: requestHeaders,
body: params,
cache: 'no-store',
credentials: 'same-origin',
signal: abortController.signal,
Expand Down
6 changes: 3 additions & 3 deletions pkg/ui/static/react/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"files": {
"main.css": "./static/css/main.17d667f4.css",
"main.js": "./static/js/main.3e8bac27.js",
"main.js": "./static/js/main.20f9b436.js",
"static/media/codicon.ttf": "./static/media/codicon.b3726f0165bf67ac6849.ttf",
"index.html": "./index.html",
"static/media/index.cjs": "./static/media/index.cd351d7c31d0d3fccf96.cjs",
"main.17d667f4.css.map": "./static/css/main.17d667f4.css.map",
"main.3e8bac27.js.map": "./static/js/main.3e8bac27.js.map"
"main.20f9b436.js.map": "./static/js/main.20f9b436.js.map"
},
"entrypoints": [
"static/css/main.17d667f4.css",
"static/js/main.3e8bac27.js"
"static/js/main.20f9b436.js"
]
}
2 changes: 1 addition & 1 deletion pkg/ui/static/react/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><meta name="theme-color" content="#000000"/><script>const GLOBAL_PATH_PREFIX="{{ pathPrefix }}"</script><script>const THANOS_COMPONENT="{{ .Component }}",THANOS_QUERY_URL="{{ .queryURL }}",THANOS_TENANT_HEADER="{{ .tenantHeader }}",THANOS_DEFAULT_TENANT="{{ .defaultTenant }}",THANOS_DISPLAY_TENANT_BOX="{{ .displayTenantBox }}"</script><link rel="manifest" href="./manifest.json"/><title>Thanos | Highly available Prometheus setup</title><script defer="defer" src="./static/js/main.3e8bac27.js"></script><link href="./static/css/main.17d667f4.css" rel="stylesheet"></head><body class="bootstrap"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><meta name="theme-color" content="#000000"/><script>const GLOBAL_PATH_PREFIX="{{ pathPrefix }}"</script><script>const THANOS_COMPONENT="{{ .Component }}",THANOS_QUERY_URL="{{ .queryURL }}",THANOS_TENANT_HEADER="{{ .tenantHeader }}",THANOS_DEFAULT_TENANT="{{ .defaultTenant }}",THANOS_DISPLAY_TENANT_BOX="{{ .displayTenantBox }}"</script><link rel="manifest" href="./manifest.json"/><title>Thanos | Highly available Prometheus setup</title><script defer="defer" src="./static/js/main.20f9b436.js"></script><link href="./static/css/main.17d667f4.css" rel="stylesheet"></head><body class="bootstrap"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit 8834a47

Please sign in to comment.