Amazon Managed Service for Prometheus is a serverless, Prometheus-compatible monitoring service for container metrics that makes it easier to securely monitor container environments at scale. With Amazon Managed Service for Prometheus, you can use the same open-source Prometheus data model and query language that you use today to monitor the performance of your containerized workloads, and also enjoy improved scalability, availability, and security without having to manage the underlying infrastructure.

For more information about Amazon Managed Service for Prometheus, see the Amazon Managed Service for Prometheus  User Guide.

Amazon Managed Service for Prometheus includes two APIs.

  • Use the Amazon Web Services API described in this guide to manage Amazon Managed Service for Prometheus resources, such as workspaces, rule groups, and alert managers.

  • Use the Prometheus-compatible API  to work within your Prometheus workspace.

Installation

NPM
npm install @aws-sdk/client-amp
Yarn
yarn add @aws-sdk/client-amp
pnpm
pnpm add @aws-sdk/client-amp

AmpClient Operations

Command
Summary
CreateAlertManagerDefinitionCommand

The CreateAlertManagerDefinition operation creates the alert manager definition in a workspace. If a workspace already has an alert manager definition, don't use this operation to update it. Instead, use PutAlertManagerDefinition.

CreateLoggingConfigurationCommand

The CreateLoggingConfiguration operation creates a logging configuration for the workspace. Use this operation to set the CloudWatch log group to which the logs will be published to.

CreateRuleGroupsNamespaceCommand

The CreateRuleGroupsNamespace operation creates a rule groups namespace within a workspace. A rule groups namespace is associated with exactly one rules file. A workspace can have multiple rule groups namespaces.

Use this operation only to create new rule groups namespaces. To update an existing rule groups namespace, use PutRuleGroupsNamespace.

CreateScraperCommand

The CreateScraper operation creates a scraper to collect metrics. A scraper pulls metrics from Prometheus-compatible sources within an Amazon EKS cluster, and sends them to your Amazon Managed Service for Prometheus workspace. Scrapers are flexible, and can be configured to control what metrics are collected, the frequency of collection, what transformations are applied to the metrics, and more.

An IAM role will be created for you that Amazon Managed Service for Prometheus uses to access the metrics in your cluster. You must configure this role with a policy that allows it to scrape metrics from your cluster. For more information, see Configuring your Amazon EKS cluster  in the Amazon Managed Service for Prometheus User Guide.

The scrapeConfiguration parameter contains the base-64 encoded YAML configuration for the scraper.

For more information about collectors, including what metrics are collected, and how to configure the scraper, see Using an Amazon Web Services managed collector  in the Amazon Managed Service for Prometheus User Guide.

CreateWorkspaceCommand

Creates a Prometheus workspace. A workspace is a logical space dedicated to the storage and querying of Prometheus metrics. You can have one or more workspaces in each Region in your account.

DeleteAlertManagerDefinitionCommand

Deletes the alert manager definition from a workspace.

DeleteLoggingConfigurationCommand

Deletes the logging configuration for a workspace.

DeleteRuleGroupsNamespaceCommand

Deletes one rule groups namespace and its associated rule groups definition.

DeleteScraperCommand

The DeleteScraper operation deletes one scraper, and stops any metrics collection that the scraper performs.

DeleteWorkspaceCommand

Deletes an existing workspace.

When you delete a workspace, the data that has been ingested into it is not immediately deleted. It will be permanently deleted within one month.

DescribeAlertManagerDefinitionCommand

Retrieves the full information about the alert manager definition for a workspace.

DescribeLoggingConfigurationCommand

Returns complete information about the current logging configuration of the workspace.

DescribeRuleGroupsNamespaceCommand

Returns complete information about one rule groups namespace. To retrieve a list of rule groups namespaces, use ListRuleGroupsNamespaces.

DescribeScraperCommand

The DescribeScraper operation displays information about an existing scraper.

DescribeWorkspaceCommand

Returns information about an existing workspace.

GetDefaultScraperConfigurationCommand

The GetDefaultScraperConfiguration operation returns the default scraper configuration used when Amazon EKS creates a scraper for you.

ListRuleGroupsNamespacesCommand

Returns a list of rule groups namespaces in a workspace.

ListScrapersCommand

The ListScrapers operation lists all of the scrapers in your account. This includes scrapers being created or deleted. You can optionally filter the returned list.

ListTagsForResourceCommand

The ListTagsForResource operation returns the tags that are associated with an Amazon Managed Service for Prometheus resource. Currently, the only resources that can be tagged are scrapers, workspaces, and rule groups namespaces.

ListWorkspacesCommand

Lists all of the Amazon Managed Service for Prometheus workspaces in your account. This includes workspaces being created or deleted.

PutAlertManagerDefinitionCommand

Updates an existing alert manager definition in a workspace. If the workspace does not already have an alert manager definition, don't use this operation to create it. Instead, use CreateAlertManagerDefinition.

PutRuleGroupsNamespaceCommand

Updates an existing rule groups namespace within a workspace. A rule groups namespace is associated with exactly one rules file. A workspace can have multiple rule groups namespaces.

Use this operation only to update existing rule groups namespaces. To create a new rule groups namespace, use CreateRuleGroupsNamespace.

You can't use this operation to add tags to an existing rule groups namespace. Instead, use TagResource.

TagResourceCommand

The TagResource operation associates tags with an Amazon Managed Service for Prometheus resource. The only resources that can be tagged are rule groups namespaces, scrapers, and workspaces.

If you specify a new tag key for the resource, this tag is appended to the list of tags associated with the resource. If you specify a tag key that is already associated with the resource, the new tag value that you specify replaces the previous value for that tag. To remove a tag, use UntagResource.

UntagResourceCommand

Removes the specified tags from an Amazon Managed Service for Prometheus resource. The only resources that can be tagged are rule groups namespaces, scrapers, and workspaces.

UpdateLoggingConfigurationCommand

Updates the log group ARN or the workspace ID of the current logging configuration.

UpdateScraperCommand

Updates an existing scraper.

You can't use this function to update the source from which the scraper is collecting metrics. To change the source, delete the scraper and create a new one.

UpdateWorkspaceAliasCommand

Updates the alias of an existing workspace.

AmpClient Configuration

Parameter
Type
Description
defaultsMode
Optional
DefaultsMode | Provider<DefaultsMode>
The @smithy/smithy-client#DefaultsMode that will be used to determine how certain default configuration options are resolved in the SDK.
disableHostPrefix
Optional
boolean
Disable dynamically changing the endpoint of the client based on the hostPrefix trait of an operation.
extensions
Optional
RuntimeExtension[]
Optional extensions
logger
Optional
Logger
Optional logger for logging debug/info/warn/error.
maxAttempts
Optional
number | Provider<number>
Value for how many times a request will be made at most in case of retry.
profile
Optional
string
Setting a client profile is similar to setting a value for the AWS_PROFILE environment variable. Setting a profile on a client in code only affects the single client instance, unlike AWS_PROFILE.When set, and only for environments where an AWS configuration file exists, fields configurable by this file will be retrieved from the specified profile within that file. Conflicting code configuration and environment variables will still have higher priority.For client credential resolution that involves checking the AWS configuration file, the client's profile (this value) will be used unless a different profile is set in the credential provider options.
region
Optional
string | Provider<string>
The AWS region to which this client will send requests
requestHandler
Optional
__HttpHandlerUserInput
The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs.
retryMode
Optional
string | Provider<string>
Specifies which retry algorithm to use.
useDualstackEndpoint
Optional
boolean | Provider<boolean>
Enables IPv6/IPv4 dualstack endpoint.
useFipsEndpoint
Optional
boolean | Provider<boolean>
Enables FIPS compatible endpoints.
Additional config fields are described in the full configuration type: AmpClientConfig