PrometheusService / Client / create_scraper

create_scraper#

PrometheusService.Client.create_scraper(**kwargs)#

Create a scraper.

See also: AWS API Documentation

Request Syntax

response = client.create_scraper(
    alias='string',
    scrapeConfiguration={
        'configurationBlob': b'bytes'
    },
    source={
        'eksConfiguration': {
            'clusterArn': 'string',
            'securityGroupIds': [
                'string',
            ],
            'subnetIds': [
                'string',
            ]
        }
    },
    destination={
        'ampConfiguration': {
            'workspaceArn': 'string'
        }
    },
    clientToken='string',
    tags={
        'string': 'string'
    }
)
Parameters:
  • alias (string) – An optional user-assigned alias for this scraper. This alias is for user reference and does not need to be unique.

  • scrapeConfiguration (dict) –

    [REQUIRED]

    The configuration used to create the scraper.

    Note

    This is a Tagged Union structure. Only one of the following top level keys can be set: configurationBlob.

    • configurationBlob (bytes) –

      Binary data representing a Prometheus configuration file.

  • source (dict) –

    [REQUIRED]

    The source that the scraper will be discovering and collecting metrics from.

    Note

    This is a Tagged Union structure. Only one of the following top level keys can be set: eksConfiguration.

    • eksConfiguration (dict) –

      A representation of an EKS source.

      • clusterArn (string) – [REQUIRED]

        The ARN of an EKS cluster.

      • securityGroupIds (list) –

        A list of security group IDs specified for VPC configuration.

        • (string) –

          ID of a VPC security group.

      • subnetIds (list) – [REQUIRED]

        A list of subnet IDs specified for VPC configuration.

        • (string) –

          ID of a VPC subnet.

  • destination (dict) –

    [REQUIRED]

    The destination that the scraper will be producing metrics to.

    Note

    This is a Tagged Union structure. Only one of the following top level keys can be set: ampConfiguration.

    • ampConfiguration (dict) –

      A representation of an AMP destination.

      • workspaceArn (string) – [REQUIRED]

        The ARN of an AMP workspace.

  • clientToken (string) –

    Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.

    This field is autopopulated if not provided.

  • tags (dict) –

    Optional, user-provided tags for this scraper.

    • (string) –

      The key of the tag.

      Constraints: Tag keys are case-sensitive and accept a maximum of 128 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @ May not begin with aws:.

      • (string) –

        The value of the tag.

        Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @

Return type:

dict

Returns:

Response Syntax

{
    'scraperId': 'string',
    'arn': 'string',
    'status': {
        'statusCode': 'CREATING'|'ACTIVE'|'DELETING'|'CREATION_FAILED'|'DELETION_FAILED'
    },
    'tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) –

    Represents the output of a CreateScraper operation.

    • scraperId (string) –

      The generated ID of the scraper that was just created.

    • arn (string) –

      The ARN of the scraper that was just created.

    • status (dict) –

      The status of the scraper that was just created (usually CREATING).

      • statusCode (string) –

        Status code of this scraper.

    • tags (dict) –

      The tags of this scraper.

      • (string) –

        The key of the tag.

        Constraints: Tag keys are case-sensitive and accept a maximum of 128 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @ May not begin with aws:.

        • (string) –

          The value of the tag.

          Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @

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