kandi background
Explore Kits

prometheus-operator | Prometheus Operator creates/configures/manages Prometheus | Monitoring library

 by   prometheus-operator Go Version: v0.55.1 License: Apache-2.0

 by   prometheus-operator Go Version: v0.55.1 License: Apache-2.0

Download this library from

kandi X-RAY | prometheus-operator Summary

prometheus-operator is a Go library typically used in Performance Management, Monitoring, Prometheus applications. prometheus-operator has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.
The Prometheus Operator provides Kubernetes native deployment and management of Prometheus and related monitoring components. The purpose of this project is to simplify and automate the configuration of a Prometheus based monitoring stack for Kubernetes clusters.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • prometheus-operator has a medium active ecosystem.
  • It has 6830 star(s) with 3037 fork(s). There are 144 watchers for this library.
  • There were 6 major release(s) in the last 12 months.
  • There are 193 open issues and 2019 have been closed. On average issues are closed in 37 days. There are 69 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of prometheus-operator is v0.55.1
prometheus-operator Support
Best in #Monitoring
Average in #Monitoring
prometheus-operator Support
Best in #Monitoring
Average in #Monitoring

quality kandi Quality

  • prometheus-operator has 0 bugs and 0 code smells.
prometheus-operator Quality
Best in #Monitoring
Average in #Monitoring
prometheus-operator Quality
Best in #Monitoring
Average in #Monitoring

securitySecurity

  • prometheus-operator has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • prometheus-operator code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
prometheus-operator Security
Best in #Monitoring
Average in #Monitoring
prometheus-operator Security
Best in #Monitoring
Average in #Monitoring

license License

  • prometheus-operator is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
prometheus-operator License
Best in #Monitoring
Average in #Monitoring
prometheus-operator License
Best in #Monitoring
Average in #Monitoring

buildReuse

  • prometheus-operator releases are available to install and integrate.
  • Installation instructions, examples and code snippets are available.
  • It has 47788 lines of code, 1530 functions and 185 files.
  • It has high code complexity. Code complexity directly impacts maintainability of the code.
prometheus-operator Reuse
Best in #Monitoring
Average in #Monitoring
prometheus-operator Reuse
Best in #Monitoring
Average in #Monitoring
Top functions reviewed by kandi - BETA

kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample Here

Get all kandi verified functions for this library.

Get all kandi verified functions for this library.

prometheus-operator Key Features

Kubernetes Custom Resources: Use Kubernetes custom resources to deploy and manage Prometheus, Alertmanager, and related components.

Simplified Deployment Configuration: Configure the fundamentals of Prometheus like versions, persistence, retention policies, and replicas from a native Kubernetes resource.

Prometheus Target Configuration: Automatically generate monitoring target configurations based on familiar Kubernetes label queries; no need to learn a Prometheus specific configuration language.

Quickstart

copy iconCopydownload iconDownload
kubectl create -f bundle.yaml

Removal

copy iconCopydownload iconDownload
for n in $(kubectl get namespaces -o jsonpath={..metadata.name}); do
  kubectl delete --all --namespace=$n prometheus,servicemonitor,podmonitor,alertmanager
done

Thanos-Query/Query-Frontend does not show any metrics

copy iconCopydownload iconDownload
$ helm pull prometheus-community/kube-prometheus-stack --untar
# Enable thanosService
prometheus:
  thanosService:
    enabled: true # by default it's set to false

# Add spec for thanos sidecar
prometheus:
  prometheusSpec:
    thanos:
      image: "quay.io/thanos/thanos:v0.24.0"
      version: "v0.24.0"
## This section is experimental, it may change significantly without deprecation notice in any release.
## This is experimental and may change significantly without backward compatibility in any release.
## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#thanosspec
$ helm install prometheus . -n prometheus --create-namespace # installed in prometheus namespace
$ kubectl get pods -n prometheus | grep prometheus-0
prometheus-prometheus-kube-prometheus-prometheus-0       3/3     Running   0          67s
$ helm pull bitnami/thanos --untar
query:
  dnsDiscovery:
    enabled: true
    sidecarsService: "prometheus-kube-prometheus-thanos-discovery" # service which was created before
    sidecarsNamespace: "prometheus" # namespace where prometheus is deployed
$ helm install thanos . -n thanos --create-namespace
$ kubectl logs thanos-query-xxxxxxxxx-yyyyy -n thanos
level=info ts=2022-02-24T15:32:41.418475238Z caller=endpointset.go:349 component=endpointset msg="adding new sidecar with [storeAPI rulesAPI exemplarsAPI targetsAPI MetricMetadataAPI]" address=10.44.1.213:10901 extLset="{prometheus=\"prometheus/prometheus-kube-prometheus-prometheus\", prometheus_replica=\"prometheus-prometheus-kube-prometheus-prometheus-0\"}"
$ helm pull prometheus-community/kube-prometheus-stack --untar
# Enable thanosService
prometheus:
  thanosService:
    enabled: true # by default it's set to false

# Add spec for thanos sidecar
prometheus:
  prometheusSpec:
    thanos:
      image: "quay.io/thanos/thanos:v0.24.0"
      version: "v0.24.0"
## This section is experimental, it may change significantly without deprecation notice in any release.
## This is experimental and may change significantly without backward compatibility in any release.
## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#thanosspec
$ helm install prometheus . -n prometheus --create-namespace # installed in prometheus namespace
$ kubectl get pods -n prometheus | grep prometheus-0
prometheus-prometheus-kube-prometheus-prometheus-0       3/3     Running   0          67s
$ helm pull bitnami/thanos --untar
query:
  dnsDiscovery:
    enabled: true
    sidecarsService: "prometheus-kube-prometheus-thanos-discovery" # service which was created before
    sidecarsNamespace: "prometheus" # namespace where prometheus is deployed
$ helm install thanos . -n thanos --create-namespace
$ kubectl logs thanos-query-xxxxxxxxx-yyyyy -n thanos
level=info ts=2022-02-24T15:32:41.418475238Z caller=endpointset.go:349 component=endpointset msg="adding new sidecar with [storeAPI rulesAPI exemplarsAPI targetsAPI MetricMetadataAPI]" address=10.44.1.213:10901 extLset="{prometheus=\"prometheus/prometheus-kube-prometheus-prometheus\", prometheus_replica=\"prometheus-prometheus-kube-prometheus-prometheus-0\"}"
$ helm pull prometheus-community/kube-prometheus-stack --untar
# Enable thanosService
prometheus:
  thanosService:
    enabled: true # by default it's set to false

# Add spec for thanos sidecar
prometheus:
  prometheusSpec:
    thanos:
      image: "quay.io/thanos/thanos:v0.24.0"
      version: "v0.24.0"
## This section is experimental, it may change significantly without deprecation notice in any release.
## This is experimental and may change significantly without backward compatibility in any release.
## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#thanosspec
$ helm install prometheus . -n prometheus --create-namespace # installed in prometheus namespace
$ kubectl get pods -n prometheus | grep prometheus-0
prometheus-prometheus-kube-prometheus-prometheus-0       3/3     Running   0          67s
$ helm pull bitnami/thanos --untar
query:
  dnsDiscovery:
    enabled: true
    sidecarsService: "prometheus-kube-prometheus-thanos-discovery" # service which was created before
    sidecarsNamespace: "prometheus" # namespace where prometheus is deployed
$ helm install thanos . -n thanos --create-namespace
$ kubectl logs thanos-query-xxxxxxxxx-yyyyy -n thanos
level=info ts=2022-02-24T15:32:41.418475238Z caller=endpointset.go:349 component=endpointset msg="adding new sidecar with [storeAPI rulesAPI exemplarsAPI targetsAPI MetricMetadataAPI]" address=10.44.1.213:10901 extLset="{prometheus=\"prometheus/prometheus-kube-prometheus-prometheus\", prometheus_replica=\"prometheus-prometheus-kube-prometheus-prometheus-0\"}"
$ helm pull prometheus-community/kube-prometheus-stack --untar
# Enable thanosService
prometheus:
  thanosService:
    enabled: true # by default it's set to false

# Add spec for thanos sidecar
prometheus:
  prometheusSpec:
    thanos:
      image: "quay.io/thanos/thanos:v0.24.0"
      version: "v0.24.0"
## This section is experimental, it may change significantly without deprecation notice in any release.
## This is experimental and may change significantly without backward compatibility in any release.
## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#thanosspec
$ helm install prometheus . -n prometheus --create-namespace # installed in prometheus namespace
$ kubectl get pods -n prometheus | grep prometheus-0
prometheus-prometheus-kube-prometheus-prometheus-0       3/3     Running   0          67s
$ helm pull bitnami/thanos --untar
query:
  dnsDiscovery:
    enabled: true
    sidecarsService: "prometheus-kube-prometheus-thanos-discovery" # service which was created before
    sidecarsNamespace: "prometheus" # namespace where prometheus is deployed
$ helm install thanos . -n thanos --create-namespace
$ kubectl logs thanos-query-xxxxxxxxx-yyyyy -n thanos
level=info ts=2022-02-24T15:32:41.418475238Z caller=endpointset.go:349 component=endpointset msg="adding new sidecar with [storeAPI rulesAPI exemplarsAPI targetsAPI MetricMetadataAPI]" address=10.44.1.213:10901 extLset="{prometheus=\"prometheus/prometheus-kube-prometheus-prometheus\", prometheus_replica=\"prometheus-prometheus-kube-prometheus-prometheus-0\"}"
$ helm pull prometheus-community/kube-prometheus-stack --untar
# Enable thanosService
prometheus:
  thanosService:
    enabled: true # by default it's set to false

# Add spec for thanos sidecar
prometheus:
  prometheusSpec:
    thanos:
      image: "quay.io/thanos/thanos:v0.24.0"
      version: "v0.24.0"
## This section is experimental, it may change significantly without deprecation notice in any release.
## This is experimental and may change significantly without backward compatibility in any release.
## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#thanosspec
$ helm install prometheus . -n prometheus --create-namespace # installed in prometheus namespace
$ kubectl get pods -n prometheus | grep prometheus-0
prometheus-prometheus-kube-prometheus-prometheus-0       3/3     Running   0          67s
$ helm pull bitnami/thanos --untar
query:
  dnsDiscovery:
    enabled: true
    sidecarsService: "prometheus-kube-prometheus-thanos-discovery" # service which was created before
    sidecarsNamespace: "prometheus" # namespace where prometheus is deployed
$ helm install thanos . -n thanos --create-namespace
$ kubectl logs thanos-query-xxxxxxxxx-yyyyy -n thanos
level=info ts=2022-02-24T15:32:41.418475238Z caller=endpointset.go:349 component=endpointset msg="adding new sidecar with [storeAPI rulesAPI exemplarsAPI targetsAPI MetricMetadataAPI]" address=10.44.1.213:10901 extLset="{prometheus=\"prometheus/prometheus-kube-prometheus-prometheus\", prometheus_replica=\"prometheus-prometheus-kube-prometheus-prometheus-0\"}"
$ helm pull prometheus-community/kube-prometheus-stack --untar
# Enable thanosService
prometheus:
  thanosService:
    enabled: true # by default it's set to false

# Add spec for thanos sidecar
prometheus:
  prometheusSpec:
    thanos:
      image: "quay.io/thanos/thanos:v0.24.0"
      version: "v0.24.0"
## This section is experimental, it may change significantly without deprecation notice in any release.
## This is experimental and may change significantly without backward compatibility in any release.
## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#thanosspec
$ helm install prometheus . -n prometheus --create-namespace # installed in prometheus namespace
$ kubectl get pods -n prometheus | grep prometheus-0
prometheus-prometheus-kube-prometheus-prometheus-0       3/3     Running   0          67s
$ helm pull bitnami/thanos --untar
query:
  dnsDiscovery:
    enabled: true
    sidecarsService: "prometheus-kube-prometheus-thanos-discovery" # service which was created before
    sidecarsNamespace: "prometheus" # namespace where prometheus is deployed
$ helm install thanos . -n thanos --create-namespace
$ kubectl logs thanos-query-xxxxxxxxx-yyyyy -n thanos
level=info ts=2022-02-24T15:32:41.418475238Z caller=endpointset.go:349 component=endpointset msg="adding new sidecar with [storeAPI rulesAPI exemplarsAPI targetsAPI MetricMetadataAPI]" address=10.44.1.213:10901 extLset="{prometheus=\"prometheus/prometheus-kube-prometheus-prometheus\", prometheus_replica=\"prometheus-prometheus-kube-prometheus-prometheus-0\"}"
$ helm pull prometheus-community/kube-prometheus-stack --untar
# Enable thanosService
prometheus:
  thanosService:
    enabled: true # by default it's set to false

# Add spec for thanos sidecar
prometheus:
  prometheusSpec:
    thanos:
      image: "quay.io/thanos/thanos:v0.24.0"
      version: "v0.24.0"
## This section is experimental, it may change significantly without deprecation notice in any release.
## This is experimental and may change significantly without backward compatibility in any release.
## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#thanosspec
$ helm install prometheus . -n prometheus --create-namespace # installed in prometheus namespace
$ kubectl get pods -n prometheus | grep prometheus-0
prometheus-prometheus-kube-prometheus-prometheus-0       3/3     Running   0          67s
$ helm pull bitnami/thanos --untar
query:
  dnsDiscovery:
    enabled: true
    sidecarsService: "prometheus-kube-prometheus-thanos-discovery" # service which was created before
    sidecarsNamespace: "prometheus" # namespace where prometheus is deployed
$ helm install thanos . -n thanos --create-namespace
$ kubectl logs thanos-query-xxxxxxxxx-yyyyy -n thanos
level=info ts=2022-02-24T15:32:41.418475238Z caller=endpointset.go:349 component=endpointset msg="adding new sidecar with [storeAPI rulesAPI exemplarsAPI targetsAPI MetricMetadataAPI]" address=10.44.1.213:10901 extLset="{prometheus=\"prometheus/prometheus-kube-prometheus-prometheus\", prometheus_replica=\"prometheus-prometheus-kube-prometheus-prometheus-0\"}"
$ helm pull prometheus-community/kube-prometheus-stack --untar
# Enable thanosService
prometheus:
  thanosService:
    enabled: true # by default it's set to false

# Add spec for thanos sidecar
prometheus:
  prometheusSpec:
    thanos:
      image: "quay.io/thanos/thanos:v0.24.0"
      version: "v0.24.0"
## This section is experimental, it may change significantly without deprecation notice in any release.
## This is experimental and may change significantly without backward compatibility in any release.
## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#thanosspec
$ helm install prometheus . -n prometheus --create-namespace # installed in prometheus namespace
$ kubectl get pods -n prometheus | grep prometheus-0
prometheus-prometheus-kube-prometheus-prometheus-0       3/3     Running   0          67s
$ helm pull bitnami/thanos --untar
query:
  dnsDiscovery:
    enabled: true
    sidecarsService: "prometheus-kube-prometheus-thanos-discovery" # service which was created before
    sidecarsNamespace: "prometheus" # namespace where prometheus is deployed
$ helm install thanos . -n thanos --create-namespace
$ kubectl logs thanos-query-xxxxxxxxx-yyyyy -n thanos
level=info ts=2022-02-24T15:32:41.418475238Z caller=endpointset.go:349 component=endpointset msg="adding new sidecar with [storeAPI rulesAPI exemplarsAPI targetsAPI MetricMetadataAPI]" address=10.44.1.213:10901 extLset="{prometheus=\"prometheus/prometheus-kube-prometheus-prometheus\", prometheus_replica=\"prometheus-prometheus-kube-prometheus-prometheus-0\"}"
$ helm pull prometheus-community/kube-prometheus-stack --untar
# Enable thanosService
prometheus:
  thanosService:
    enabled: true # by default it's set to false

# Add spec for thanos sidecar
prometheus:
  prometheusSpec:
    thanos:
      image: "quay.io/thanos/thanos:v0.24.0"
      version: "v0.24.0"
## This section is experimental, it may change significantly without deprecation notice in any release.
## This is experimental and may change significantly without backward compatibility in any release.
## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#thanosspec
$ helm install prometheus . -n prometheus --create-namespace # installed in prometheus namespace
$ kubectl get pods -n prometheus | grep prometheus-0
prometheus-prometheus-kube-prometheus-prometheus-0       3/3     Running   0          67s
$ helm pull bitnami/thanos --untar
query:
  dnsDiscovery:
    enabled: true
    sidecarsService: "prometheus-kube-prometheus-thanos-discovery" # service which was created before
    sidecarsNamespace: "prometheus" # namespace where prometheus is deployed
$ helm install thanos . -n thanos --create-namespace
$ kubectl logs thanos-query-xxxxxxxxx-yyyyy -n thanos
level=info ts=2022-02-24T15:32:41.418475238Z caller=endpointset.go:349 component=endpointset msg="adding new sidecar with [storeAPI rulesAPI exemplarsAPI targetsAPI MetricMetadataAPI]" address=10.44.1.213:10901 extLset="{prometheus=\"prometheus/prometheus-kube-prometheus-prometheus\", prometheus_replica=\"prometheus-prometheus-kube-prometheus-prometheus-0\"}"
$ helm pull prometheus-community/kube-prometheus-stack --untar
# Enable thanosService
prometheus:
  thanosService:
    enabled: true # by default it's set to false

# Add spec for thanos sidecar
prometheus:
  prometheusSpec:
    thanos:
      image: "quay.io/thanos/thanos:v0.24.0"
      version: "v0.24.0"
## This section is experimental, it may change significantly without deprecation notice in any release.
## This is experimental and may change significantly without backward compatibility in any release.
## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#thanosspec
$ helm install prometheus . -n prometheus --create-namespace # installed in prometheus namespace
$ kubectl get pods -n prometheus | grep prometheus-0
prometheus-prometheus-kube-prometheus-prometheus-0       3/3     Running   0          67s
$ helm pull bitnami/thanos --untar
query:
  dnsDiscovery:
    enabled: true
    sidecarsService: "prometheus-kube-prometheus-thanos-discovery" # service which was created before
    sidecarsNamespace: "prometheus" # namespace where prometheus is deployed
$ helm install thanos . -n thanos --create-namespace
$ kubectl logs thanos-query-xxxxxxxxx-yyyyy -n thanos
level=info ts=2022-02-24T15:32:41.418475238Z caller=endpointset.go:349 component=endpointset msg="adding new sidecar with [storeAPI rulesAPI exemplarsAPI targetsAPI MetricMetadataAPI]" address=10.44.1.213:10901 extLset="{prometheus=\"prometheus/prometheus-kube-prometheus-prometheus\", prometheus_replica=\"prometheus-prometheus-kube-prometheus-prometheus-0\"}"

Change in Grafana helm chart to install as kind Statefulset instead of Deployment

copy iconCopydownload iconDownload
dependencies:
- name: grafana
  version: "6.21.*"
  repository: https://grafana.github.io/helm-charts
  condition: grafana.enabled
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) (eq .Values.persistence.type "statefulset")}}
grafana:
  enabled: true
  persistence:
    enabled: true
    type: statefulset
grafana:
  enabled: false
dependencies:
- name: grafana
  version: "6.21.*"
  repository: https://grafana.github.io/helm-charts
  condition: grafana.enabled
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) (eq .Values.persistence.type "statefulset")}}
grafana:
  enabled: true
  persistence:
    enabled: true
    type: statefulset
grafana:
  enabled: false
dependencies:
- name: grafana
  version: "6.21.*"
  repository: https://grafana.github.io/helm-charts
  condition: grafana.enabled
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) (eq .Values.persistence.type "statefulset")}}
grafana:
  enabled: true
  persistence:
    enabled: true
    type: statefulset
grafana:
  enabled: false
dependencies:
- name: grafana
  version: "6.21.*"
  repository: https://grafana.github.io/helm-charts
  condition: grafana.enabled
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) (eq .Values.persistence.type "statefulset")}}
grafana:
  enabled: true
  persistence:
    enabled: true
    type: statefulset
grafana:
  enabled: false

Prometheus install using helm - prometheus and alertmanger pods Terminating in a loop

copy iconCopydownload iconDownload
kubectl get pods --all-namespaces --selector=app.kubernetes.io/name=prometheus

Prometheus on GKE to monitor Strimzi Kafka - how to get the Prometheus Pod IP

copy iconCopydownload iconDownload
kubectl create -f prometheus-additional.yaml

instead of :

kubectl create secret generic additional-scrape-configs --from-file=prometheus-additional.yaml

Helm Prometheus operator doesn't add new ServiceMonitor endpoints to targets

copy iconCopydownload iconDownload
kubectl -n monitoring get secret prometheus-k8s -ojson | jq -r '.data["prometheus.yaml.gz"]' | base64 -d | gunzip | grep "my-service-monitor

How to obtain the specified part of the content from the output content in k8s?

copy iconCopydownload iconDownload
kubectl get pod -n monitoring prometheus-prome-prometheus-operator-prometheus-0 -o json | jq .metadata.ownerReferences
kubectl get pod -n monitoring prometheus-prome-prometheus-operator-prometheus-0 -o jsonpath={.metadata.ownerReferences} | jq
kubectl get pod -n monitoring prometheus-prome-prometheus-operator-prometheus-0 -o json | jq .metadata.ownerReferences
kubectl get pod -n monitoring prometheus-prome-prometheus-operator-prometheus-0 -o jsonpath={.metadata.ownerReferences} | jq

Alertmanager only goes though default receiver

copy iconCopydownload iconDownload
# ❌ This is invalid
route:
- match:
   alertname: !WatchDog

# ✅ This is correct
route:
- matchers:
   - alertname!=Watchdog

How can I disable a service been monitor on the prometheus-operator stack

copy iconCopydownload iconDownload
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: k8s-apps-http
  labels:
    k8s-apps: http
spec:
  jobLabel: k8s-app
  selector:
    matchExpressions:
    - {key: foo, operator: NotIn} <---
    - {key: bar, operator: NotIn} <---
  namespaceSelector:
    matchNames:
    - kube-system
    - monitoring
  endpoints:
  - port: http-metrics
    interval: 15s

executing &quot;keydb.fullname&quot; at &lt;.Values.keyDB.fullnameOverride&gt;: can't evaluate field Values in type int

copy iconCopydownload iconDownload
{{- range $podIndex := until $numOfInstances }}
...
      labels:
        {{ include "keydb.labels" . | nindent 8 }}
...
{{- end }}
{{/* no outer range loop */}}
apiVersion: apps/v1
kind: StatefulSet
metadata: { ... }
spec:
  replicas: {{ .Values.CP.replicas }}
  ...
{{- range $podIndex := until $numOfInstances }}
...
      labels:
        {{ include "keydb.labels" . | nindent 8 }}
...
{{- end }}
{{/* no outer range loop */}}
apiVersion: apps/v1
kind: StatefulSet
metadata: { ... }
spec:
  replicas: {{ .Values.CP.replicas }}
  ...

How to add Grafana's provisioned notification channel in kube-prometheus-stack?

copy iconCopydownload iconDownload
notifiers: {}
#  notifiers.yaml:
#    notifiers:
#    - name: email-notifier
#      type: email
#      uid: email1
#      # either:
#      org_id: 1
#      # or
#      org_name: Main Org.
#      is_default: true
#      settings:
#        addresses: an_email_address@example.com
#    delete_notifiers:

Community Discussions

Trending Discussions on prometheus-operator
  • Thanos-Query/Query-Frontend does not show any metrics
  • How to deploy prometheus using prometheus operator?
  • Auto-scrape realm metrics from Keycloak with Prometheus-Operator
  • Change in Grafana helm chart to install as kind Statefulset instead of Deployment
  • Prometheus install using helm - prometheus and alertmanger pods Terminating in a loop
  • Prometheus on GKE to monitor Strimzi Kafka - how to get the Prometheus Pod IP
  • Helm Prometheus operator doesn't add new ServiceMonitor endpoints to targets
  • kubernetes - unable to expose Prometheus using NodePort
  • How to obtain the specified part of the content from the output content in k8s?
  • Alertmanager only goes though default receiver
Trending Discussions on prometheus-operator

QUESTION

Thanos-Query/Query-Frontend does not show any metrics

Asked 2022-Feb-24 at 15:46

Basically, I had installed Prometheues-Grafana from the kube-prometheus-stack using the provided helm chart repo prometheus-community

# helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
# helm install kube-prometheus-stack prometheus-community/kube-prometheus-stack

They are working fine.

But the problem I am facing now is integrating Thanos with this existing kube-prometheus-stack.

I installed thanos from the bitnami helm chart repo

# helm repo add bitnami https://charts.bitnami.com/bitnami
# helm install thanos bitnami/thanos

I can load the Thanos Query Frontend GUI, but no metrics showing there.

thanos metrics thanos store

I am struggling now to get it worked properly. Is it because of Thanos from a completely different helm chart and Prometheus-operator-grafana stack from another helm chart ?.

My Kubernetes cluster on AWS has been created using Kops. And, I use Gitlab pipeline and helm to deploy apps to the cluster.

ANSWER

Answered 2022-Feb-24 at 15:46

It's not enough to simply install them, you need to integrate prometheus with thanos.

Below I'll describe all steps you need to perform to get the result.

First short theory. The most common approach to integrate them is to use thanos sidecar container for prometheus pod. You can read more here.

How this is done:

(considering that installation is clean, it can be easily deleted and reinstalled from the scratch).

  1. Get thanos sidecar added to the prometheus pod.

Pull kube-prometheus-stack chart:

$ helm pull prometheus-community/kube-prometheus-stack --untar

You will have a folder with a chart. You need to modify values.yaml, two parts to be precise:

# Enable thanosService
prometheus:
  thanosService:
    enabled: true # by default it's set to false

# Add spec for thanos sidecar
prometheus:
  prometheusSpec:
    thanos:
      image: "quay.io/thanos/thanos:v0.24.0"
      version: "v0.24.0"

Keep in mind, this feature is still experimental:

## This section is experimental, it may change significantly without deprecation notice in any release.
## This is experimental and may change significantly without backward compatibility in any release.
## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#thanosspec

Once it's done, install the prometheus chart with edited values.yaml:

$ helm install prometheus . -n prometheus --create-namespace # installed in prometheus namespace

And check that sidecar is deployed as well:

$ kubectl get pods -n prometheus | grep prometheus-0
prometheus-prometheus-kube-prometheus-prometheus-0       3/3     Running   0          67s

It should be 3 containers running (by default it's 2). You can inspect it in more details with kubectl describe command.

  1. Setup thanos chart and deploy it.

Pull the thanos chart:

$ helm pull bitnami/thanos --untar

Edit values.yaml:

query:
  dnsDiscovery:
    enabled: true
    sidecarsService: "prometheus-kube-prometheus-thanos-discovery" # service which was created before
    sidecarsNamespace: "prometheus" # namespace where prometheus is deployed

Save and install this chart with edited values.yaml:

$ helm install thanos . -n thanos --create-namespace

Check that it works:

$ kubectl logs thanos-query-xxxxxxxxx-yyyyy -n thanos

We are interested in this line:

level=info ts=2022-02-24T15:32:41.418475238Z caller=endpointset.go:349 component=endpointset msg="adding new sidecar with [storeAPI rulesAPI exemplarsAPI targetsAPI MetricMetadataAPI]" address=10.44.1.213:10901 extLset="{prometheus=\"prometheus/prometheus-kube-prometheus-prometheus\", prometheus_replica=\"prometheus-prometheus-kube-prometheus-prometheus-0\"}"
  1. Now go to the UI and see that metrics are available:

enter image description here

Good article to read:

Source https://stackoverflow.com/questions/71243202

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install prometheus-operator

Note: this quickstart does not provision an entire monitoring stack; if that is what you are looking for, see the kube-prometheus project. If you want the whole stack, but have already applied the bundle.yaml, delete the bundle first (kubectl delete -f bundle.yaml).

Support

Many files (documentation, manifests, ...) in this repository are auto-generated. E.g. bundle.yaml originates from the Jsonnet files in /jsonnet/prometheus-operator. Before proposing a pull request:.

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases
Explore Kits

Save this library and start creating your kit

Share this Page

share link
Consider Popular Monitoring Libraries
Try Top Libraries by prometheus-operator
Compare Monitoring Libraries with Highest Support
Compare Monitoring Libraries with Highest Quality
Compare Monitoring Libraries with Highest Security
Compare Monitoring Libraries with Permissive License
Compare Monitoring Libraries with Highest Reuse
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases
Explore Kits

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.