Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Note and modify the docs with links [AMP] #552

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion src/docs/getting-started/adot-eks-add-on/config-amp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The Collector configuration below is set up to receive Prometheus metrics and ex
```console
kubectl apply -f collector-config-amp.yaml
```
to deploy your Collector. Make sure to replace `<YOUR_REMOTE_WRITE_ENDPOINT>` in the `prometheusremoterwite` exporter config, and `<YOUR_AWS_REGION>` in the `sigv4auth` extension config, as per your own target environment. Note that a `ClusterRole` and `ClusterRoleBinding` will also be created, which provide necessary permissions for the `prometheus` receiver during service discovery.
To deploy your Collector. Make sure to replace `<YOUR_REMOTE_WRITE_ENDPOINT>` in the `prometheusremoterwite` exporter config, and `<YOUR_AWS_REGION>` in the `sigv4auth` extension config, as per your own target environment. Note that a `ClusterRole` and `ClusterRoleBinding` will also be created, which provide necessary permissions for the `prometheus` receiver during service discovery.

<details>
<summary>
Expand Down Expand Up @@ -391,6 +391,27 @@ subjects:

</details>

**Note: If you have existing Prometheus configurations, you will need to replace the `$` characters with `$$` to avoid having the value replaced with environment variables. **
This is especially important for the `replacement` value of the relabel_configurations. For instance, the following configuration for relabel_configurations below

```
relabel_configs:
- source_labels: [__meta_kubernetes_ingress_scheme,__address__,__meta_kubernetes_ingress_path]
regex: (.+);(.+);(.+)
replacement: ${1}://${2}${3}
target_label: __param_target
```

would become

```
relabel_configs:
- source_labels: [__meta_kubernetes_ingress_scheme,__address__,__meta_kubernetes_ingress_path]
regex: (.+);(.+);(.+)
replacement: $${1}://${2}${3}
target_label: __param_target
```

## Verify if the Metrics Data is being sent to Amazon Managed Prometheus using the awscurl tool

You can use `awscurl` to check if Amazon Managed Prometheus received the metrics data. The `awscurl` tool is a curl like tool with AWS Signature Version 4 request signing. It performs requests to AWS services with requests signing using curl interface, and it supports IAM profile credentials. To learn more about awscurl, please refer to its [Github repository](https://github.com/okigan/awscurl).
Expand Down
23 changes: 22 additions & 1 deletion src/docs/getting-started/adot-eks-add-on/config-cloudwatch.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The Collector configuration below is set up to receive Prometheus metrics and ex
```console
kubectl apply -f collector-config-cloudwatch.yaml
```
to deploy your Collector. Make sure to replace `<YOUR-EKS-CLUSTER-NAME>` in the `spec::env` section and `<YOUR_AWS_REGION>` in the `awsemf` exporter config, as per your own target environment. Note that a `ClusterRole` and `ClusterRoleBinding` will also be created, which provide necessary permissions for the `prometheus` receiver during service discovery.
To deploy your Collector. Make sure to replace `<YOUR-EKS-CLUSTER-NAME>` in the `spec::env` section and `<YOUR_AWS_REGION>` in the `awsemf` exporter config, as per your own target environment. Note that a `ClusterRole` and `ClusterRoleBinding` will also be created, which provide necessary permissions for the `prometheus` receiver during service discovery.

<details>
<summary>
Expand Down Expand Up @@ -428,6 +428,27 @@ subjects:
* Click the “ContainerInsights/Prometheus” box under “custom namespaces”
* Select the “EKS_Cluster, EKS_Namespace, EKS_PodName“ to view your metrics data

**Note: If you have existing Prometheus configurations, you will need to replace the `$` characters with `$$` to avoid having the value replaced with environment variables. **
This is especially important for the `replacement` value of the relabel_configurations. For instance, the following configuration for relabel_configurations below.

```
relabel_configs:
- source_labels: [__meta_kubernetes_ingress_scheme,__address__,__meta_kubernetes_ingress_path]
regex: (.+);(.+);(.+)
replacement: ${1}://${2}${3}
target_label: __param_target
```

would become

```
relabel_configs:
- source_labels: [__meta_kubernetes_ingress_scheme,__address__,__meta_kubernetes_ingress_path]
regex: (.+);(.+);(.+)
replacement: $${1}://${2}${3}
target_label: __param_target
```

## [Previous Topic: Collector Configuration Introduction](/docs/getting-started/adot-eks-add-on/config-intro)

## Related Topics:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import SectionSeparator from "components/MdxSectionSeparator/sectionSeparator.js
import SubSectionSeparator from "components/MdxSubSectionSeparator/subsectionSeparator.jsx"
import prometheusPipelineEKSImg from "assets/img/docs/gettingStarted/prometheus/eks/Prometheus_Pipeline.png"

In order to scrape and export metrics to your AWS Managed Service for Prometheus (AMP) instance, you can use either the AWS Distro for
In order to scrape and export metrics to your AWS Managed Service for Prometheus (AMP), you can use either the AWS Distro for
the OpenTelemetry Collector (ADOT Collector) or a standard vanilla Prometheus server.

In this Getting Started guide, we’ll show you how to configure the ADOT Collector to scrape from a Prometheus-instrumented application,
and send metrics to the AWS Managed Service for Prometheus (AMP).
and send metrics to the Amazon Managed Service for Prometheus (AMP).

<SectionSeparator />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,26 +98,26 @@ Now, we have defined the roles necessary to execute our ECS ADOT Collector confi

## Building our Sample App Image

We will be using a simple sample app that is used for the integration tests of this pipeline. You can find the sample app [here](https://github.com/aws-observability/aws-otel-community).
We will be using a simple sample app that is used for the integration tests of this pipeline. You can find the sample app [here](https://github.com/aws-observability/aws-otel-community/tree/master/sample-apps/prometheus-sample-app).

First, fork the repository. Then clone the repository and run the following commands:

```bash
$ cd ./sample-apps/prometheus
$ cd /sample-apps/prometheus
$ docker build . -t prometheus-sample-app:latest
```

Next, push this image to a remote repository on either ECR or Dockerhub so that it can be used by the ECS deployment
Next, push this image to a remote repository on either [Amazon ECR](https://docs.aws.amazon.com/AmazonECR/latest/public/docker-push-ecr-image.html) or Dockerhub so that it can be used by the ECS deployment

<SectionSeparator />

## Demonstration 1: ECS Powered by Fargate

1. [Download the ECS Fargate AMP task definition template from GitHub.](https://github.com/aws-observability/aws-otel-collector/tree/main/examples/ecs/aws-prometheus/ecs-fargate-task-def.json) This definition specifies a Prometheus sample app and an ADOT Collector instance. If you would like to learn more about the sample app, please visit [here](https://github.com/aws-observability/aws-otel-community/tree/master/sample-apps/prometheus).
1. [Download the ECS Fargate AMP task definition template from GitHub.](https://github.com/aws-observability/aws-otel-collector/tree/main/examples/ecs/aws-prometheus/ecs-fargate-task-def.json) This definition specifies a Prometheus sample app and an ADOT Collector instance. If you would like to learn more about the sample app, please visit [here](https://github.com/aws-observability/aws-otel-community/tree/master/sample-apps/prometheus-sample-app).
2. Fill the following parameters in the task definition templates:
* `region` - the region the data will be sent to
* `ecsTaskRoleArn` - AWSOTTaskRole ARN created in the previous section
* `ecsExecutionRoleArn` - AWSOTTaskExcutionRole ARN created in the previous section
* `ecsExecutionRoleArn` - AWSOTTaskExecutionRole ARN created in the previous section
* `sampleAppImage` - the image to the Prometheus sample app we created above
3. Follow the [ECS task definition setup instructions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-task-definition.html), and use the “Fargate Launch Type” instructions step 1 to create a task definition using the given template.
* Be sure to verify all of the fields match the template
Expand All @@ -136,11 +136,11 @@ Note that you must have a cluster created with an EC2 instance available. We cho

<img src={createClusterECSImg} alt="Diagram" style="margin: 30px 0;" />

1. [Download the ECS EC2 AMP task definition template from GitHub](https://github.com/aws-observability/aws-otel-collector/tree/main/examples/ecs/aws-prometheus/ecs-ec2-task-def.json). This definition specifies a Prometheus sample app and an ADOT Collector instance. If you would like to learn more about the sample app, please visit [here](https://github.com/aws-observability/aws-otel-community/tree/master/sample-apps/prometheus).
1. [Download the ECS EC2 AMP task definition template from GitHub](https://github.com/aws-observability/aws-otel-collector/tree/main/examples/ecs/aws-prometheus/ecs-ec2-task-def.json). This definition specifies a Prometheus sample app and an ADOT Collector instance. If you would like to learn more about the sample app, please visit [here](https://github.com/aws-observability/aws-otel-community/tree/master/sample-apps/prometheus-sample-app).
2. Fill the following parameters in the task definition templates:
* `region` - the region the data will be sent to
* `ecsTaskRoleArn` - AWSOTTaskRole ARN created in the previous section
* `ecsExecutionRoleArn` - AWSOTTaskExcutionRole ARN created in the previous section
* `ecsExecutionRoleArn` - AWSOTTaskExecutionRole ARN created in the previous section
* `sampleAppImage` - the image to the Prometheus sample app we created above
3. Follow the [ECS task definition setup instructions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-task-definition.html), and use the “EC2 Launch Type” instructions step 1 to create a task definition using the given template.
* Be sure to verify all of the fields match the template
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ $ cd ./sample-apps/prometheus
$ docker build . -t prometheus-sample-app:latest
```

In order to use this Docker image for Kubernetes, we need to push this image to a registry. You will need to push your image to your Amazon ECR or DockerHub registry.
In order to use this Docker image for Kubernetes, you will need to push your image to your either [Amazon ECR](https://docs.aws.amazon.com/AmazonECR/latest/public/docker-push-ecr-image.html) or Dockerhub.

To deploy the sample app in EKS, copy this Kubernetes configuration and apply it. Make sure to use the latest image that was pushed.

```bash
$ curl https://raw.githubusercontent.com/aws-observability/aws-otel-collector/main/examples/eks/aws-prometheus/prometheus-sample-app.yaml -o prometheus-sample-app.yaml
```

Add your image reference to `prometheus-sample-app.yaml`
Add your image reference to `[prometheus-sample-app.yaml](https://github.com/aws-observability/aws-otel-collector/blob/main/examples/eks/aws-prometheus/prometheus-sample-app.yaml#L29)`

```bash
$ kubectl apply -f prometheus-sample-app.yaml
Expand Down Expand Up @@ -229,7 +229,7 @@ $ awscurl --service="aps" --region="AMP_REGION" "https://{AMP_ENDPOINT}/api/v1/q

If you receive a metric as the response, that means your pipeline setup is successful! This metric has successfully propagated from the sample app into AMP.

Similar pipelines can be configured using the components mentioned above to scrape your Kubernetes cluster and applications. Please refer below for advanced configurations.
Similar pipelines can be configured using the components mentioned above to scrape your Kubernetes cluster and applications. Please refer to [Advanced Collector Configuration for AMP](https://aws-otel.github.io/docs/getting-started/adot-eks-add-on/config-advanced).

<SectionSeparator />

Expand Down