Uploading a rules configuration file to Amazon Managed Service for Prometheus - Amazon Managed Service for Prometheus

Uploading a rules configuration file to Amazon Managed Service for Prometheus

Now you must upload this rules configuration file to Amazon Managed Service for Prometheus. You can use either the console or the AWS CLI to upload it.

To use the Amazon Managed Service for Prometheus console to upload your rules configuration and create the namespace

  1. Open the Amazon Managed Service for Prometheus console at https://console.aws.amazon.com/prometheus/.

  2. In the upper left corner of the page, choose the menu icon, and then choose All workspaces.

  3. Choose the workspace ID of the workspace, and then choose the Rules management tab.

  4. Choose Add namespace.

  5. Choose Choose file, and select the rules definition file.

  6. (Optional) To add tags to the namespace, choose Add new tag.

    Then, for Key, enter a name for the tag. You can add an optional value for the tag in Value.

    To add another tag, choose Add new tag.

  7. Choose Continue. Amazon Managed Service for Prometheus creates a new namespace with the same name as the rules file that you selected.

To use the AWS CLI to upload an alert manager configuration to a workspace in a new namespace

  1. Base64 encode the contents of your alert manager file. On Linux, you can use the following command:

    base64 input-file output-file

    On macOS, you can use the following command:

    openssl base64 input-file output-file
  2. Enter one of the following commands to create the namespace and upload the file.

    On AWS CLI version 2, enter:

    aws amp create-rule-groups-namespace --data file://path_to_base_64_output_file --name namespace-name --workspace-id my-workspace-id --region region

    On AWS CLI version 1, enter:

    aws amp create-rule-groups-namespace --data fileb://path_to_base_64_output_file --name namespace-name --workspace-id my-workspace-id --region region
  3. It takes a few seconds for your alert manager configuration to become active. To check the status, enter the following command:

    aws amp describe-rule-groups-namespace --workspace-id workspace_id --name namespace-name --region region

    If the status is ACTIVE, your rules file has taken effect.