MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / RetrieveMetricsFromInstance

Function RetrieveMetricsFromInstance

tests/utils/proxy/proxy.go:57–65  ·  view source on GitHub ↗

RetrieveMetricsFromInstance aims to retrieve the metrics from a PostgreSQL instance pod using a GET request on the pod interface proxy

(
	ctx context.Context,
	kubeInterface kubernetes.Interface,
	pod corev1.Pod,
	tlsEnabled bool,
)

Source from the content-addressed store, hash-verified

55// RetrieveMetricsFromInstance aims to retrieve the metrics from a PostgreSQL instance pod
56// using a GET request on the pod interface proxy
57func RetrieveMetricsFromInstance(
58 ctx context.Context,
59 kubeInterface kubernetes.Interface,
60 pod corev1.Pod,
61 tlsEnabled bool,
62) (string, error) {
63 body, err := runProxyRequest(ctx, kubeInterface, &pod, tlsEnabled, url.PathMetrics, int(url.PostgresMetricsPort))
64 return string(body), err
65}
66
67// RetrieveMetricsFromPgBouncer aims to retrieve the metrics from a PgBouncer pod
68// using a GET request on the pod interface proxy

Calls 1

runProxyRequestFunction · 0.85

Tested by

no test coverage detected