From 13b988edca6e0cbd5ad93c7b01d04214286a4b7d Mon Sep 17 00:00:00 2001 From: Kevin Lewin <97046295+lewinkedrs@users.noreply.github.com> Date: Sun, 14 May 2023 10:06:41 -0400 Subject: [PATCH] docs: Add docs for Amazon Managed Prometheus (#2777) adding AMP doc Signed-off-by: Kevin Lewin --- docs/analysis/prometheus.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/analysis/prometheus.md b/docs/analysis/prometheus.md index a698626d10..9bc8890645 100644 --- a/docs/analysis/prometheus.md +++ b/docs/analysis/prometheus.md @@ -34,7 +34,26 @@ you validate your [PromQL expression](https://prometheus.io/docs/prometheus/late See the [Analysis Overview page](../../features/analysis) for more details on the available options. +## Utilizing Amazon Managed Prometheus + +Amazon Managed Prometheus can be used as the prometheus data source for analysis. In order to do this the namespace where you analysis is running will have to have the appropriate [IRSA attached](https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-onboard-ingest-metrics-new-Prometheus.html#AMP-onboard-new-Prometheus-IRSA) to allow for prometheus queries. Once you ensure the proper permissions are in place to access AMP, you can use an AMP workspace url in your ```provider``` block: + +```yaml +provider: + prometheus: + address: https://aps-workspaces.$REGION.amazonaws.com/workspaces/$WORKSPACEID + query: | + sum(irate( + istio_requests_total{reporter="source",destination_service=~"{{args.service-name}}",response_code!~"5.*"}[5m] + )) / + sum(irate( + istio_requests_total{reporter="source",destination_service=~"{{args.service-name}}"}[5m] + )) +``` + # Additional Metadata Any additional metadata from the Prometheus controller, like the resolved queries after substituting the template's arguments, etc. will appear under the `Metadata` map in the `MetricsResult` object of `AnalysisRun`. + +