Skip to content

Commit 0faaeb3

Browse files
authored
Final monitoring doc revision (#433)
* Correct helm chart option * Revise monitoring docs * update howto readme * update concepts * fix cr * wip * Fix dashboard for minikube * Fix steps for prometheus howto * Update ordering * fix ct * wip * Update README.md
1 parent 57bb1df commit 0faaeb3

18 files changed

+2461
-2477
lines changed

concepts/observability/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Observability
22

3-
Observability is a term from control theory. Observability means you can answer questions about whats happening on the inside of a system by observing the outside of the system, without having to ship new code to answer new questions. Observability is critical in production environments and services to debug, operate and monitor Dapr system services, components and user applications.
3+
Observability is a term from control theory. Observability means you can answer questions about what's happening on the inside of a system by observing the outside of the system, without having to ship new code to answer new questions. Observability is critical in production environments and services to debug, operate and monitor Dapr system services, components and user applications.
44

55
The observability capabilities enable users to monitor the Dapr system services, their interaction with user applications and understand how these monitored services behave. The observability capabilities are divided into three main areas;
66

@@ -17,8 +17,9 @@ The table below shows the current status of each of the observabilty capabilites
1717
|Tracing | Yes | N/A | N/A | *Planned* | N/A |
1818
|Logs | Yes | Yes | Yes | Yes | Yes |
1919

20-
## Supported monitoring tools
21-
The observability tools listed below are ones that have been tested to work with Dapr
20+
## Monitoring tools
21+
22+
The observability tools listed below are ones that have been tested to work with Dapr.
2223

2324
### Metrics
2425

concepts/observability/logs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ The following steps describe how to configure JSON formatted logs for Kubernetes
4444

4545
### Install Dapr to your cluster using the Helm chart
4646

47-
You can enable JSON formatted logs for Dapr system services by adding `--set global.LogASJSON=true` option to Helm command.
47+
You can enable JSON formatted logs for Dapr system services by adding `--set global.logAsJson=true` option to Helm command.
4848

4949
```bash
50-
helm install dapr dapr/dapr --namespace dapr-system --set global.LogAsJSON=true
50+
helm install dapr dapr/dapr --namespace dapr-system --set global.logAsJson=true
5151
```
5252

5353
### Enable JSON formatted log for Dapr sidecars

concepts/observability/metrics.md

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,21 @@
11
# Metrics
2-
Dapr exposes a [Prometheus](https://prometheus.io/) metrics endpoint that you can scrape to gain
3-
a greater understanding of how Dapr is behaving and to setup alerts for specific conditions.
2+
3+
Dapr exposes a [Prometheus](https://prometheus.io/) metrics endpoint that you can scrape to gain a greater understanding of how Dapr is behaving and to setup alerts for specific conditions.
44

55
## Configuration
6-
The metrics endpoint is enabled by default, you can disable it by passing the command line argument
7-
`--enable-metrics=false` to daprd.
86

9-
The default metrics port is `9090`. This can be overridden by passing the command line argument
10-
`--metrics-port` to darpd.
7+
The metrics endpoint is enabled by default, you can disable it by passing the command line argument `--enable-metrics=false` to dapr system processes.
8+
9+
The default metrics port is `9090`. This can be overridden by passing the command line argument `--metrics-port` to darpd.
1110

1211
## Metrics
13-
Dapr will expose metrics for Darp's HTTP pipeline, gPRC pipeline, Go runtime, metrics server and process.
14-
> Note: The gRPC metrics are all initialized with zero values and are therefore immediately visible on the
15-
metrics endpoint. HTTP metrics are not zero initialized so will only become visible once a HTTP request has
16-
passed through the HTTP pipeline.
1712

18-
## Prometheus
19-
To consume these metrics you'll need to install Prometheus or something compatible with scraping Prometheus
20-
metrics.
13+
Each Dapr system process emits Go runtime/process metrics by default and have their own metrics:
2114

22-
For more detailed instructions on installing and configuring Prometheus to work with Dapr, please refer to the [Observe Metrics with Prometheus](../../howto/observe-metrics-with-prometheus/README.md) article.
15+
- [Dapr runtime metric list](https://github.com/dapr/dapr/blob/master/pkg/diagnostics/README.md)
2316

2417
## References
2518

26-
* [Prometheus Installation](https://github.com/helm/charts/tree/master/stable/prometheus-operator)
27-
28-
* [Prometheus on Kubernetes](https://github.com/coreos/kube-prometheus)
29-
30-
* [Prometheus Kubernetes Operator](https://github.com/helm/charts/tree/master/stable/prometheus-operator)
19+
* [Howto: Run Prometheus locally](../../howto/setup-monitoring-tools/observe-metrics-with-prometheus-locally.md)
20+
* [Howto: Set up Prometheus and Grafana for metrics](../../howto/setup-monitoring-tools/setup-prometheus-grafana.md)
21+
* [Howto: Set up Azure monitor to search logs and collect metrics for Dapr](../../howto/setup-monitoring-tools/setup-azure-monitor.md)

howto/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,18 @@ For Actors How Tos see the SDK documentation
5151
* [Java Actors](https://github.com/dapr/java-sdk)
5252

5353
## Observerability
54+
55+
### Metric and logs
56+
57+
* [Set up Azure monitor to search logs and collect metrics for Dapr](./setup-monitoring-tools/setup-azure-monitor.md)
58+
* [Set up Fleuntd, Elastic search, and Kibana in Kubernetes](./setup-monitoring-tools/setup-fluentd-es-kibana.md)
59+
* [Set up Prometheus and Grafana for metrics](./setup-monitoring-tools/setup-prometheus-grafana.md)
60+
5461
### Distributed Tracing
5562

5663
* [Diagnose your services with distributed tracing](./diagnose-with-tracing)
5764

65+
5866
## Security
5967
### Mutual Transport Layer Security (TLS)
6068

@@ -87,4 +95,4 @@ For Actors How Tos see the SDK documentation
8795

8896
## Infrastructure integration
8997

90-
* [Autoscale on Kubernetes using KEDA and Dapr bindings](./autoscale-with-keda)
98+
* [Autoscale on Kubernetes using KEDA and Dapr bindings](./autoscale-with-keda)
361 KB
Loading
Binary file not shown.

howto/observe-metrics-with-prometheus/README.md renamed to howto/setup-monitoring-tools/observe-metrics-with-prometheus-locally.md

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Observe Metrics with Prometheus
1+
# Observe Metrics with Prometheus locally
2+
23
Dapr exposes a Prometheus metrics endpoint you can use to collect time-series
34
data relating to the execution of the Dapr runtime itself.
45

@@ -55,36 +56,3 @@ docker run \
5556
`--net=host` ensures that the Prometheus instance will be able to connect to any Dapr instances running on the host machine. If you plan to run your Dapr apps in containers as well, you'll need to run them on a shared Docker network and update the configuration with the correct target address.
5657

5758
Once Prometheus is running, you'll be able to visit its dashboard by visiting `http://localhost:8080`.
58-
59-
## Setup Prometheus on Kubernetes
60-
61-
Prometheus can be installed onto a Kubernetes cluster in a number of different ways. These are documented comprehensively [here](https://github.com/coreos/kube-prometheus).
62-
63-
Once you have installed Prometheus on your Kubernetes cluster, you can add your Dapr sidecars' service address to your Prometheus configuration.
64-
65-
The Dapr sidecar addresses can be fetched by using
66-
```
67-
$ kubectl get svc
68-
69-
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)
70-
nodeapp-dapr ClusterIP 10.0.163.251 <none> 80/TCP,50001/TCP,9090/TCP
71-
...
72-
```
73-
74-
You can then add the services DNS to your Prometheus configuration.
75-
```yaml
76-
...
77-
scrape_configs:
78-
...
79-
- job_name: 'nodeapp-dapr'
80-
metrics_path: /
81-
static_configs:
82-
- targets: ['nodeapp-dapr.<namespace>.svc.cluster.local:9090'] # Replace with Dapr metrics port if not default
83-
...
84-
```
85-
86-
To see you Prometheus dashboard in Kubernetes, you'll need to port forward to your Prometheus pod and then hit the local endpoint `http://localhost:9090`.
87-
88-
```
89-
kubectl port-forward <prometheus-pod-name> 9090:9090
90-
```

howto/setup-monitoring-tools/setup-azure-monitor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ kubectl apply -f ./azm-config.map.yaml
5959
1. Install Dapr with enabling JSON-formatted logs
6060

6161
```bash
62-
helm install dapr dapr/dapr --namespace dapr-system --set global.LogAsJSON=true
62+
helm install dapr dapr/dapr --namespace dapr-system --set global.logAsJson=true
6363
```
6464

6565
2. Enable JSON formatted log in Dapr sidecar and add Prometheus annotations.

howto/setup-monitoring-tools/setup-fluentd-es-kibana.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ fluentd-sdrld 1/1 Running 0 14s
8686
1. Install Dapr with enabling JSON-formatted logs
8787

8888
```bash
89-
helm install dapr dapr/dapr --namespace dapr-system --set global.LogAsJSON=true
89+
helm install dapr dapr/dapr --namespace dapr-system --set global.logAsJson=true
9090
```
9191

9292
2. Enable JSON formatted log in Dapr sidecar

howto/setup-monitoring-tools/setup-prometheus-grafana.md

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ helm install dapr-prom stable/prometheus -n dapr-monitoring
3030
If you are minikube user or want to disable persistent volume for development purpose, you can disable it by using the following command.
3131

3232
```bash
33-
helm install prometheus stable/prometheus -n dapr-monitoring
34-
--set alertmanager.persistentVolume.enable=false
35-
--set pushgateway.persistentVolume.enabled=false
36-
--set server.persistentVolume.enabled=false
33+
helm install dapr-prom stable/prometheus -n dapr-monitoring --set alertmanager.persistentVolume.enable=false --set pushgateway.persistentVolume.enabled=false --set server.persistentVolume.enabled=false
3734
```
3835

3936
3. Install Grafana
@@ -44,11 +41,20 @@ helm install grafana stable/grafana -n dapr-monitoring
4441

4542
If you are minikube user or want to disable persistent volume for development purpose, you can disable it by using the following command.
4643

47-
```bash
44+
```bash
4845
helm install grafana stable/grafana -n dapr-monitoring --set persistence.enabled=false
4946
```
5047

51-
4. Validation
48+
4. Retrieve admin password for Grafana Login
49+
50+
> Note: remove `%` character from the password that this command returns. The admin password is `cj3m0OfBNx8SLzUlTx91dEECgzRlYJb60D2evof1`.
51+
52+
```
53+
kubernetes get secret --namespace dapr-monitoring grafana -o jsonpath="{.data.admin-password}" | base64 --decode
54+
cj3m0OfBNx8SLzUlTx91dEECgzRlYJb60D2evof1%
55+
```
56+
57+
5. Validation
5258

5359
Ensure Prometheus and Grafana are running in your cluster.
5460

@@ -80,15 +86,17 @@ Handling connection for 8080
8086

8187
2. Browse `http://localhost:8080`
8288

83-
3. Click Configuration Settings -> Data Sources
89+
3. Login with admin and password
90+
91+
4. Click Configuration Settings -> Data Sources
8492

8593
![data source](./img/grafana-datasources.png)
8694

87-
4. Add Prometheus as a data soruce.
95+
5. Add Prometheus as a data soruce.
8896

8997
![add data source](./img/grafana-datasources.png)
9098

91-
5. Enter Promethesus server address in your cluster.
99+
6. Enter Promethesus server address in your cluster.
92100

93101
You can get the prometheus server address by running following command.
94102

@@ -107,30 +115,35 @@ kibana-kibana ClusterIP 10.0.188.224 <none> 56
107115

108116
```
109117

110-
In this set up tutorial, the server is `dapr-prom-prometheus-server`.
118+
In this howto, the server is `dapr-prom-prometheus-server`.
111119

112-
So you need to provide `http://dapr-prom-prometheus-server.dapr-monitoring` in the URL field.
120+
So you need to set up Prometheus data source with the below settings:
113121

114-
![prometheus server](./img/grafana-prometheus-server-url.png)
122+
- Name: `Dapr`
123+
- HTTP URL: `http://dapr-prom-prometheus-server.dapr-monitoring`
124+
- Default: On
115125

116-
6. Click Save & Test button to verify that connected succeeded.
126+
![prometheus server](./img/grafana-prometheus-dapr-server-url.png)
117127

118-
7. Import Dapr dashboards.
128+
7. Click `Save & Test` button to verify that connected succeeded.
119129

120-
You can now import built-in [Grafana dashboard templates](https://github.com/dapr/docs/tree/master/monitoring/grafana/dashboards).
130+
8. Import Dapr dashboards.
121131

122-
Refer [here](https://github.com/dapr/docs/tree/master/monitoring/grafana) for details.
132+
You can now import built-in [Grafana dashboard templates](../../reference/dashboard/README.md).
133+
134+
Refer [here](../../reference/dashboard/README.md) for details.
123135

124136
![upload json](./img/grafana-uploadjson.png)
125137

126-
You can find screenshots of Dapr dashboards [here](https://github.com/dapr/docs/tree/master/monitoring/grafana/img).
138+
9. Find the dashboard that you imported and enjoy!
139+
140+
![upload json](../../reference/dashboard/img/system-service-dashboard.png)
141+
142+
You can find more screenshots of Dapr dashboards [here](../../reference/dashboard/img/).
127143

128144
# References
129145

130146
* [Prometheus Installation](https://github.com/helm/charts/tree/master/stable/prometheus-operator)
131-
132147
* [Prometheus on Kubernetes](https://github.com/coreos/kube-prometheus)
133-
134148
* [Prometheus Kubernetes Operator](https://github.com/helm/charts/tree/master/stable/prometheus-operator)
135-
136-
* [Prometheus Query Language](https://prometheus.io/docs/prometheus/latest/querying/basics/)
149+
* [Prometheus Query Language](https://prometheus.io/docs/prometheus/latest/querying/basics/)

0 commit comments

Comments
 (0)