AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Implementation for accessing PrometheusService

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.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonServiceClient
    Amazon.PrometheusService.AmazonPrometheusServiceClient

Namespace: Amazon.PrometheusService
Assembly: AWSSDK.PrometheusService.dll
Version: 3.x.y.z

Syntax

C#
public class AmazonPrometheusServiceClient : AmazonServiceClient
         IAmazonPrometheusService, IAmazonService, IDisposable

The AmazonPrometheusServiceClient type exposes the following members

Constructors

NameDescription
Public Method AmazonPrometheusServiceClient()

Constructs AmazonPrometheusServiceClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="AWSProfileName" value="AWS Default"/>
    </appSettings>
</configuration>
             

Public Method AmazonPrometheusServiceClient(RegionEndpoint)

Constructs AmazonPrometheusServiceClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="AWSProfileName" value="AWS Default"/>
    </appSettings>
</configuration>
             

Public Method AmazonPrometheusServiceClient(AmazonPrometheusServiceConfig)

Constructs AmazonPrometheusServiceClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="AWSProfileName" value="AWS Default"/>
    </appSettings>
</configuration>
             

Public Method AmazonPrometheusServiceClient(AWSCredentials)

Constructs AmazonPrometheusServiceClient with AWS Credentials

Public Method AmazonPrometheusServiceClient(AWSCredentials, RegionEndpoint)

Constructs AmazonPrometheusServiceClient with AWS Credentials

Public Method AmazonPrometheusServiceClient(AWSCredentials, AmazonPrometheusServiceConfig)

Constructs AmazonPrometheusServiceClient with AWS Credentials and an AmazonPrometheusServiceClient Configuration object.

Public Method AmazonPrometheusServiceClient(string, string)

Constructs AmazonPrometheusServiceClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonPrometheusServiceClient(string, string, RegionEndpoint)

Constructs AmazonPrometheusServiceClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonPrometheusServiceClient(string, string, AmazonPrometheusServiceConfig)

Constructs AmazonPrometheusServiceClient with AWS Access Key ID, AWS Secret Key and an AmazonPrometheusServiceClient Configuration object.

Public Method AmazonPrometheusServiceClient(string, string, string)

Constructs AmazonPrometheusServiceClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonPrometheusServiceClient(string, string, string, RegionEndpoint)

Constructs AmazonPrometheusServiceClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonPrometheusServiceClient(string, string, string, AmazonPrometheusServiceConfig)

Constructs AmazonPrometheusServiceClient with AWS Access Key ID, AWS Secret Key and an AmazonPrometheusServiceClient Configuration object.

Properties

NameTypeDescription
Public Property Config Amazon.Runtime.IClientConfig Inherited from Amazon.Runtime.AmazonServiceClient.
Public Property Paginators Amazon.PrometheusService.Model.IPrometheusServicePaginatorFactory

Paginators for the service

Methods

Note:

Asynchronous operations (methods ending with Async) in the table below are for .NET 4.5 or higher. For .NET 3.5 the SDK follows the standard naming convention of BeginMethodName and EndMethodName to indicate asynchronous operations - these method pairs are not shown in the table below.

NameDescription
Public Method CreateAlertManagerDefinition(CreateAlertManagerDefinitionRequest)

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.

Public Method CreateAlertManagerDefinitionAsync(CreateAlertManagerDefinitionRequest, CancellationToken)

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.

Public Method CreateLoggingConfiguration(CreateLoggingConfigurationRequest)

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.

Public Method CreateLoggingConfigurationAsync(CreateLoggingConfigurationRequest, CancellationToken)

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.

Public Method CreateRuleGroupsNamespace(CreateRuleGroupsNamespaceRequest)

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.

Public Method CreateRuleGroupsNamespaceAsync(CreateRuleGroupsNamespaceRequest, CancellationToken)

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.

Public Method CreateScraper(CreateScraperRequest)

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.

Public Method CreateScraperAsync(CreateScraperRequest, CancellationToken)

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.

Public Method CreateWorkspace(CreateWorkspaceRequest)

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.

Public Method CreateWorkspaceAsync(CreateWorkspaceRequest, CancellationToken)

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.

Public Method DeleteAlertManagerDefinition(DeleteAlertManagerDefinitionRequest)

Deletes the alert manager definition from a workspace.

Public Method DeleteAlertManagerDefinitionAsync(DeleteAlertManagerDefinitionRequest, CancellationToken)

Deletes the alert manager definition from a workspace.

Public Method DeleteLoggingConfiguration(DeleteLoggingConfigurationRequest)

Deletes the logging configuration for a workspace.

Public Method DeleteLoggingConfigurationAsync(DeleteLoggingConfigurationRequest, CancellationToken)

Deletes the logging configuration for a workspace.

Public Method DeleteRuleGroupsNamespace(DeleteRuleGroupsNamespaceRequest)

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

Public Method DeleteRuleGroupsNamespaceAsync(DeleteRuleGroupsNamespaceRequest, CancellationToken)

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

Public Method DeleteScraper(DeleteScraperRequest)

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

Public Method DeleteScraperAsync(DeleteScraperRequest, CancellationToken)

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

Public Method DeleteWorkspace(DeleteWorkspaceRequest)

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.

Public Method DeleteWorkspaceAsync(DeleteWorkspaceRequest, CancellationToken)

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.

Public Method DescribeAlertManagerDefinition(DescribeAlertManagerDefinitionRequest)

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

Public Method DescribeAlertManagerDefinitionAsync(DescribeAlertManagerDefinitionRequest, CancellationToken)

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

Public Method DescribeLoggingConfiguration(DescribeLoggingConfigurationRequest)

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

Public Method DescribeLoggingConfigurationAsync(DescribeLoggingConfigurationRequest, CancellationToken)

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

Public Method DescribeRuleGroupsNamespace(DescribeRuleGroupsNamespaceRequest)

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

Public Method DescribeRuleGroupsNamespaceAsync(DescribeRuleGroupsNamespaceRequest, CancellationToken)

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

Public Method DescribeScraper(DescribeScraperRequest)

The DescribeScraper operation displays information about an existing scraper.

Public Method DescribeScraperAsync(DescribeScraperRequest, CancellationToken)

The DescribeScraper operation displays information about an existing scraper.

Public Method DescribeWorkspace(DescribeWorkspaceRequest)

Returns information about an existing workspace.

Public Method DescribeWorkspaceAsync(DescribeWorkspaceRequest, CancellationToken)

Returns information about an existing workspace.

Public Method DetermineServiceOperationEndpoint(AmazonWebServiceRequest)

Returns the endpoint that will be used for a particular request.

Public Method Dispose() Inherited from Amazon.Runtime.AmazonServiceClient.
Public Method GetDefaultScraperConfiguration(GetDefaultScraperConfigurationRequest)

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

Public Method GetDefaultScraperConfigurationAsync(GetDefaultScraperConfigurationRequest, CancellationToken)

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

Public Method ListRuleGroupsNamespaces(ListRuleGroupsNamespacesRequest)

Returns a list of rule groups namespaces in a workspace.

Public Method ListRuleGroupsNamespacesAsync(ListRuleGroupsNamespacesRequest, CancellationToken)

Returns a list of rule groups namespaces in a workspace.

Public Method ListScrapers(ListScrapersRequest)

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.

Public Method ListScrapersAsync(ListScrapersRequest, CancellationToken)

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.

Public Method ListTagsForResource(ListTagsForResourceRequest)

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.

Public Method ListTagsForResourceAsync(ListTagsForResourceRequest, CancellationToken)

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.

Public Method ListWorkspaces(ListWorkspacesRequest)

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

Public Method ListWorkspacesAsync(ListWorkspacesRequest, CancellationToken)

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

Public Method PutAlertManagerDefinition(PutAlertManagerDefinitionRequest)

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.

Public Method PutAlertManagerDefinitionAsync(PutAlertManagerDefinitionRequest, CancellationToken)

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.

Public Method PutRuleGroupsNamespace(PutRuleGroupsNamespaceRequest)

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.

Public Method PutRuleGroupsNamespaceAsync(PutRuleGroupsNamespaceRequest, CancellationToken)

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.

Public Method TagResource(TagResourceRequest)

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.

Public Method TagResourceAsync(TagResourceRequest, CancellationToken)

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.

Public Method UntagResource(UntagResourceRequest)

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.

Public Method UntagResourceAsync(UntagResourceRequest, CancellationToken)

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.

Public Method UpdateLoggingConfiguration(UpdateLoggingConfigurationRequest)

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

Public Method UpdateLoggingConfigurationAsync(UpdateLoggingConfigurationRequest, CancellationToken)

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

Public Method UpdateScraper(UpdateScraperRequest)

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.

Public Method UpdateScraperAsync(UpdateScraperRequest, CancellationToken)

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.

Public Method UpdateWorkspaceAlias(UpdateWorkspaceAliasRequest)

Updates the alias of an existing workspace.

Public Method UpdateWorkspaceAliasAsync(UpdateWorkspaceAliasRequest, CancellationToken)

Updates the alias of an existing workspace.

Events

NameDescription
Event AfterResponseEvent Inherited from Amazon.Runtime.AmazonServiceClient.
Event BeforeRequestEvent Inherited from Amazon.Runtime.AmazonServiceClient.
Event ExceptionEvent Inherited from Amazon.Runtime.AmazonServiceClient.

Version Information

.NET:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5 and newer, 3.5