Skip to content

Create Scraper

prometheusservice_create_scraper R Documentation

The CreateScraper operation creates a scraper to collect metrics

Description

The create_scraper operation creates a scraper to collect metrics. A scraper pulls metrics from Prometheus-compatible sources and sends them to your Amazon Managed Service for Prometheus workspace. You can configure scrapers to collect metrics from Amazon EKS clusters, Amazon MSK clusters, or from VPC-based sources that support DNS-based service discovery. 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 source. You must configure this role with a policy that allows it to scrape metrics from your source. For Amazon EKS sources, 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.

When creating a scraper, the service creates a ⁠Network Interface⁠ in each Availability Zone that are passed into create_scraper through subnets. These network interfaces are used to connect to your source within the VPC for scraping metrics.

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.

Usage

prometheusservice_create_scraper(alias, scrapeConfiguration, source,
  destination, roleConfiguration, clientToken, tags)

Arguments

alias

(optional) An alias to associate with the scraper. This is for your use, and does not need to be unique.

scrapeConfiguration

[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.

source

[required] The Amazon EKS or Amazon Web Services cluster from which the scraper will collect metrics.

destination

[required] The Amazon Managed Service for Prometheus workspace to send metrics to.

roleConfiguration

Use this structure to enable cross-account access, so that you can use a target account to access Prometheus metrics from source accounts.

clientToken

(Optional) A unique, case-sensitive identifier that you can provide to ensure the idempotency of the request.

tags

(Optional) The list of tag keys and values to associate with the scraper.

Value

A list with the following syntax:

list(
  scraperId = "string",
  arn = "string",
  status = list(
    statusCode = "CREATING"|"UPDATING"|"ACTIVE"|"DELETING"|"CREATION_FAILED"|"UPDATE_FAILED"|"DELETION_FAILED"
  ),
  tags = list(
    "string"
  )
)

Request syntax

svc$create_scraper(
  alias = "string",
  scrapeConfiguration = list(
    configurationBlob = raw
  ),
  source = list(
    eksConfiguration = list(
      clusterArn = "string",
      securityGroupIds = list(
        "string"
      ),
      subnetIds = list(
        "string"
      )
    ),
    vpcConfiguration = list(
      securityGroupIds = list(
        "string"
      ),
      subnetIds = list(
        "string"
      )
    )
  ),
  destination = list(
    ampConfiguration = list(
      workspaceArn = "string"
    )
  ),
  roleConfiguration = list(
    sourceRoleArn = "string",
    targetRoleArn = "string"
  ),
  clientToken = "string",
  tags = list(
    "string"
  )
)