Skip to content

Commit

Permalink
Update monitoring
Browse files Browse the repository at this point in the history
Signed-off-by: Tapajit Chandra Paul <[email protected]>
  • Loading branch information
tapojit047 committed Nov 1, 2024
1 parent 749579e commit cb5b032
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/guides/druid/monitoring/using-builtin-prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ Forwarding from [::1]:9090 -> 9090
Now, we can access the dashboard at `localhost:9090`. Open [http://localhost:9090](http://localhost:9090) in your browser. You should see the endpoint of `druid-with-monitoring-stats` service as one of the targets.

<p align="center">
  <img alt="Prometheus Target" height="100%" src="/docs/images/druid/monitoring/druid-with-monitoring-target.png" style="padding:10px">
  <img alt="Prometheus Target" height="100%" src="/docs/guides/druid/monitoring/images/druid-prometheus.png" style="padding:10px">
</p>

Check the labels marked with red rectangle. These labels confirm that the metrics are coming from `Druid` cluster `druid-with-monitoring` through stats service `druid-with-monitoring-stats`.
Expand Down
35 changes: 17 additions & 18 deletions docs/guides/druid/monitoring/using-prometheus-operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ Here,
Let's create the druid object that we have shown above,

```bash
$ kubectl create -f https://github.com/kubedb/docs/raw/{{< param "info.version" >}}/docs/examples/druid/monitoring/druid-with-monirtoring.yaml
$ kubectl create -f https://github.com/kubedb/docs/raw/{{< param "info.version" >}}/docs/examples/druid/monitoring/yamls/druid-with-monirtoring.yaml
druids.kubedb.com/druid-with-monitoring created
```

Expand Down Expand Up @@ -220,20 +220,20 @@ $ kubectl describe svc -n demo druid-with-monitoring-stats
Name: druid-with-monitoring-stats
Namespace: demo
Labels: app.kubernetes.io/component=database
app.kubernetes.io/instance=druid-with-monitoring
app.kubernetes.io/managed-by=kubedb.com
app.kubernetes.io/name=druids.kubedb.com
kubedb.com/role=stats
app.kubernetes.io/instance=druid-with-monitoring
app.kubernetes.io/managed-by=kubedb.com
app.kubernetes.io/name=druids.kubedb.com
kubedb.com/role=stats
Annotations: monitoring.appscode.com/agent: prometheus.io/operator
Selector: app.kubernetes.io/instance=druid-with-monitoring,app.kubernetes.io/managed-by=kubedb.com,app.kubernetes.io/name=druids.kubedb.com
Type: ClusterIP
IP Family Policy: SingleStack
IP Families: IPv4
IP: 10.96.235.251
IPs: 10.96.235.251
Port: metrics 9091/TCP
IP: 10.96.29.174
IPs: 10.96.29.174
Port: metrics 9104/TCP
TargetPort: metrics/TCP
Endpoints: 10.244.0.117:56790,10.244.0.119:56790,10.244.0.121:56790
Endpoints: 10.244.0.68:9104,10.244.0.71:9104,10.244.0.72:9104 + 2 more...
Session Affinity: None
Events: <none>
```
Expand All @@ -250,11 +250,12 @@ druid-with-monitoring-stats 4m49s

Let's verify that the `ServiceMonitor` has the label that we had specified in `spec.monitor` section of Druid crd.

```bash$ kubectl get servicemonitor -n demo druid-with-monitoring-stats -o yaml
```bash
$ kubectl get servicemonitor -n demo druid-with-monitoring-stats -o yaml
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
creationTimestamp: "2023-03-30T07:59:49Z"
creationTimestamp: "2024-11-01T10:25:14Z"
generation: 1
labels:
app.kubernetes.io/component: database
Expand All @@ -270,14 +271,12 @@ metadata:
controller: true
kind: Service
name: druid-with-monitoring-stats
uid: 4a95fc65-fe2c-4d9c-afdd-aa748642d6bc
resourceVersion: "668351"
uid: de76712d-4f51-4bab-a625-73966f4bd9f7
uid: b3ae48f3-476e-4cec-95f6-f8e28538b605
resourceVersion: "597152"
uid: ff385538-eba5-48a3-91c1-1a4b15f3018a
spec:
endpoints:
- bearerTokenSecret:
key: ""
honorLabels: true
- honorLabels: true
interval: 10s
path: /metrics
port: metrics
Expand Down Expand Up @@ -320,7 +319,7 @@ Forwarding from [::1]:9090 -> 9090
Now, we can access the dashboard at `localhost:9090`. Open [http://localhost:9090](http://localhost:9090) in your browser. You should see `metrics` endpoint of `druid-with-monitoring-stats` service as one of the targets.

<p align="center">
  <img alt="Prometheus Target" src="/docs/images/druid/druid-promethues.png" style="padding:10px">
  <img alt="Prometheus Target" src="/docs/guides/druid/monitoring/images/druid-promethues.png" style="padding:10px">
</p>

Check the `endpoint` and `service` labels. It verifies that the target is our expected database. Now, you can view the collected metrics and create a graph from homepage of this Prometheus dashboard. You can also use this Prometheus server as data source for [Grafana](https://grafana.com/) and create a beautiful dashboard with collected metrics.
Expand Down

0 comments on commit cb5b032

Please sign in to comment.