mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Clean up
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
parent
b989218604
commit
b57ce73ac7
@ -2,7 +2,6 @@ import { LensApiRequest } from "../router"
|
|||||||
import { LensApi } from "../lens-api"
|
import { LensApi } from "../lens-api"
|
||||||
import * as requestPromise from "request-promise-native"
|
import * as requestPromise from "request-promise-native"
|
||||||
import { PrometheusProviderRegistry, PrometheusProvider, PrometheusNodeQuery, PrometheusClusterQuery, PrometheusPodQuery, PrometheusPvcQuery, PrometheusIngressQuery, PrometheusQueryOpts} from "../prometheus/provider-registry"
|
import { PrometheusProviderRegistry, PrometheusProvider, PrometheusNodeQuery, PrometheusClusterQuery, PrometheusPodQuery, PrometheusPvcQuery, PrometheusIngressQuery, PrometheusQueryOpts} from "../prometheus/provider-registry"
|
||||||
import logger from "../logger"
|
|
||||||
|
|
||||||
type MetricsQuery = string | string[] | {
|
type MetricsQuery = string | string[] | {
|
||||||
[metricName: string]: string;
|
[metricName: string]: string;
|
||||||
@ -15,7 +14,6 @@ class MetricsRoute extends LensApi {
|
|||||||
const query: MetricsQuery = request.payload;
|
const query: MetricsQuery = request.payload;
|
||||||
const serverUrl = `http://127.0.0.1:${cluster.port}/api-kube`
|
const serverUrl = `http://127.0.0.1:${cluster.port}/api-kube`
|
||||||
const metricsUrl = `${serverUrl}/api/v1/namespaces/${cluster.contextHandler.getPrometheusPath()}/proxy${cluster.getPrometheusApiPrefix()}/api/v1/query_range`
|
const metricsUrl = `${serverUrl}/api/v1/namespaces/${cluster.contextHandler.getPrometheusPath()}/proxy${cluster.getPrometheusApiPrefix()}/api/v1/query_range`
|
||||||
logger.info(metricsUrl)
|
|
||||||
const headers = {
|
const headers = {
|
||||||
"Host": `${cluster.id}.localhost:${cluster.port}`,
|
"Host": `${cluster.id}.localhost:${cluster.port}`,
|
||||||
"Content-type": "application/json",
|
"Content-type": "application/json",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user