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

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.

Usage

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

Arguments

alias

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

clientToken

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

destination

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

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 cluster from which the scraper will collect metrics.

tags

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

Value

A list with the following syntax:

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

Request syntax

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