PrometheusService / Client / create_scraper
create_scraper#
- PrometheusService.Client.create_scraper(**kwargs)#
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. You can configure the scraper to control what metrics are collected, and what transformations are applied prior to sending them to your workspace.If needed, an IAM role will be created for you that gives Amazon Managed Service for Prometheus access to the metrics in your cluster. For more information, see Using roles for scraping metrics from EKS in the Amazon Managed Service for Prometheus User Guide.
You cannot update a scraper. If you want to change the configuration of the scraper, create a new scraper and delete the old one.
The
scrapeConfiguration
parameter contains the base64-encoded version of the YAML configuration file.Note
For more information about collectors, including what metrics are collected, and how to configure the scraper, see Amazon Web Services managed collectors in the Amazon Managed Service for Prometheus User Guide.
See also: AWS API Documentation
Request Syntax
response = client.create_scraper( alias='string', clientToken='string', destination={ 'ampConfiguration': { 'workspaceArn': 'string' } }, scrapeConfiguration={ 'configurationBlob': b'bytes' }, source={ 'eksConfiguration': { 'clusterArn': 'string', 'securityGroupIds': [ 'string', ], 'subnetIds': [ 'string', ] } }, tags={ 'string': 'string' } )
- Parameters:
alias (string) – (optional) a name to associate with the scraper. This is for your use, and does not need to be unique.
clientToken (string) –
(Optional) A unique, case-sensitive identifier that you can provide to ensure the idempotency of the request.
This field is autopopulated if not provided.
destination (dict) –
[REQUIRED]
The Amazon Managed Service for Prometheus workspace to send metrics to.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
ampConfiguration
.ampConfiguration (dict) –
The Amazon Managed Service for Prometheusworkspace to send metrics to.
workspaceArn (string) – [REQUIRED]
ARN of the Amazon Managed Service for Prometheus workspace.
scrapeConfiguration (dict) –
[REQUIRED]
The configuration file to use in the new scraper. For more information, see Scraper configuration in the Amazon Managed Service for Prometheus User Guide.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
configurationBlob
.configurationBlob (bytes) –
The base 64 encoded scrape configuration file.
source (dict) –
[REQUIRED]
The Amazon EKS cluster from which the scraper will collect metrics.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
eksConfiguration
.eksConfiguration (dict) –
The Amazon EKS cluster from which a scraper collects metrics.
clusterArn (string) – [REQUIRED]
ARN of the Amazon EKS cluster.
securityGroupIds (list) –
A list of the security group IDs for the Amazon EKS cluster VPC configuration.
(string) –
ID of a VPC security group.
subnetIds (list) – [REQUIRED]
A list of subnet IDs for the Amazon EKS cluster VPC configuration.
(string) –
ID of a VPC subnet.
tags (dict) –
(Optional) The list of tag keys and values to associate with the scraper.
(string) –
The key of the tag. May not begin with
aws:
.(string) –
The value of the tag.
- Return type:
dict
- Returns:
Response Syntax
{ 'arn': 'string', 'scraperId': 'string', 'status': { 'statusCode': 'CREATING'|'ACTIVE'|'DELETING'|'CREATION_FAILED'|'DELETION_FAILED' }, 'tags': { 'string': 'string' } }
Response Structure
(dict) –
Represents the output of a
CreateScraper
operation.arn (string) –
The Amazon Resource Name (ARN) of the new scraper.
scraperId (string) –
The ID of the new scraper.
status (dict) –
A structure that displays the current status of the scraper.
statusCode (string) –
The current status of the scraper.
tags (dict) –
The list of tag keys and values that are associated with the scraper.
(string) –
The key of the tag. May not begin with
aws:
.(string) –
The value of the tag.
Exceptions
PrometheusService.Client.exceptions.ThrottlingException
PrometheusService.Client.exceptions.ConflictException
PrometheusService.Client.exceptions.ValidationException
PrometheusService.Client.exceptions.ResourceNotFoundException
PrometheusService.Client.exceptions.AccessDeniedException
PrometheusService.Client.exceptions.InternalServerException
PrometheusService.Client.exceptions.ServiceQuotaExceededException