-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Prometheus integration walkthrough (#337)
- Loading branch information
Fawad Khaliq
authored
Sep 3, 2020
1 parent
fecf6b8
commit 1a9b8ab
Showing
3 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# App Mesh with EKS—Observability: Prometheus | ||
|
||
NOTE: Before you start with this part, make sure you've gone through the [base deployment](base.md) of App Mesh with EKS. In other words, the following assumes that an EKS cluster with App Mesh configured is available and the prerequisites (aws, kubectl, jq, etc. installed) are met. | ||
|
||
Prometheus is a systems and service monitoring system. It collects metrics from configured targets at given intervals, evaluates rule expressions, and displays the results. You can use Prometheus with AWS App Mesh to track metrics of applications within the meshes. You can also track metrics for the App Mesh Kubernetes Controller. | ||
|
||
## Installation | ||
|
||
### Option 1: Quick setup | ||
|
||
App Mesh provides a basic installation to setup Prometheus quickly using Helm. To install the Prometheus pre-configured to work with App Mesh, follow the instructions in [appmesh-prometheus](https://github.com/aws/eks-charts/blob/master/stable/appmesh-prometheus/README.md) Helm charts. | ||
|
||
### Option 2: Existing Prometheus deployment | ||
|
||
If you already have a Prometheus setup and you’re interested in the details of Prometheus scrape config, you can find it [here](https://github.com/aws/eks-charts/blob/master/stable/appmesh-prometheus/templates/config.yaml). Specifically, the scrape config for Envoy sidecars: | ||
|
||
``` | ||
- job_name: 'appmesh-envoy' | ||
metrics_path: /stats/prometheus | ||
kubernetes_sd_configs: | ||
- role: pod | ||
relabel_configs: | ||
- source_labels: [__meta_kubernetes_pod_container_name] | ||
action: keep | ||
regex: '^envoy$' | ||
- source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port] | ||
action: replace | ||
regex: ([^:]+)(?::\d+)?;(\d+) | ||
replacement: ${1}:9901 | ||
target_label: __address__ | ||
- action: labelmap | ||
regex: __meta_kubernetes_pod_label_(.+) | ||
- source_labels: [__meta_kubernetes_namespace] | ||
action: replace | ||
target_label: kubernetes_namespace | ||
- source_labels: [__meta_kubernetes_pod_name] | ||
action: replace | ||
target_label: kubernetes_pod_name | ||
``` | ||
|
||
## Usage | ||
|
||
For the testing/demo (Option 1 installation), you may use port-forwarding to Prometheus endpoint: | ||
|
||
``` | ||
kubectl -n appmesh-system port-forward svc/appmesh-prometheus 9090:9090 | ||
``` | ||
|
||
Access the Prometheus UI using the URL: http://localhost:9090/ | ||
|
||
To see the AWS API calls the App Mesh Kubernetes controller makes, search for `aws_api_calls_total` | ||
|
||
![Prometheus metrics for App Mesh controller](prometheus-metrics-0.png) | ||
|
||
Similarly, you can see all the scraped metrics (including application health metrics) in the metrics dropdown | ||
|
||
## Cleanup | ||
|
||
``` | ||
helm delete appmesh-prometheus -n appmesh-system | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.