mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Docs: kube prometheus jsonnet (#198)
Signed-off-by: Christian Beneke <christian.beneke@traderepublic.com>
This commit is contained in:
1 parent
cee870769c
commit
7450557f17
2 files changed
+75
No files matched your search
@@ -0,0 +1,40 @@
|
||||
{
|
||||
// Add Lens metric relabelings for custom prometheus instances installed with kube-prometheus
|
||||
// https://github.com/lensapp/lens/blob/master/troubleshooting/custom-prometheus.md
|
||||
nodeExporter+:: {
|
||||
serviceMonitor+: {
|
||||
spec+: {
|
||||
endpoints: std.map(function(endpoint)
|
||||
if endpoint.port == "https" then
|
||||
endpoint {
|
||||
relabelings+: [
|
||||
{
|
||||
action: 'replace',
|
||||
regex: '(.*)',
|
||||
replacement: '$1',
|
||||
sourceLabels: ['__meta_kubernetes_pod_node_name'],
|
||||
targetLabel: 'kubernetes_node',
|
||||
}
|
||||
],
|
||||
}
|
||||
else
|
||||
endpoint,
|
||||
super.endpoints
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
prometheus+:: {
|
||||
serviceMonitorKubelet+: {
|
||||
spec+: {
|
||||
metricRelabelings+: [
|
||||
{
|
||||
action: 'replace',
|
||||
sourceLabels: ['node'],
|
||||
targetLabel: 'instance',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in new issue
Block a user