Class CfnScraper
- All Implemented Interfaces:
IInspectable
,ITaggableV2
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
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. You can configure the scraper 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 YAML configuration for the scraper.
For more information about collectors, including what metrics are collected, and how to configure the scraper, see Using an AWS managed collector in the Amazon Managed Service for Prometheus User Guide .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.aps.*; CfnScraper cfnScraper = CfnScraper.Builder.create(this, "MyCfnScraper") .destination(DestinationProperty.builder() .ampConfiguration(AmpConfigurationProperty.builder() .workspaceArn("workspaceArn") .build()) .build()) .scrapeConfiguration(ScrapeConfigurationProperty.builder() .configurationBlob("configurationBlob") .build()) .source(SourceProperty.builder() .eksConfiguration(EksConfigurationProperty.builder() .clusterArn("clusterArn") .subnetIds(List.of("subnetIds")) // the properties below are optional .securityGroupIds(List.of("securityGroupIds")) .build()) .build()) // the properties below are optional .alias("alias") .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .build();
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
TheAmpConfiguration
structure defines the Amazon Managed Service for Prometheus instance a scraper should send metrics to.static final class
A fluent builder forCfnScraper
.static interface
Where to send the metrics from a scraper.static interface
TheEksConfiguration
structure describes the connection to the Amazon EKS cluster from which a scraper collects metrics.static interface
A scrape configuration for a scraper, base 64 encoded.static interface
The source of collected metrics for a scraper.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionprotected
CfnScraper
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnScraper
(software.amazon.jsii.JsiiObjectRef objRef) CfnScraper
(software.constructs.Construct scope, String id, CfnScraperProps props) -
Method Summary
Modifier and TypeMethodDescriptiongetAlias()
An optional user-assigned scraper alias.The Amazon Resource Name (ARN) of the scraper.The Amazon Resource Name (ARN) of the IAM role that provides permissions for the scraper to discover and collect metrics on your behalf.The ID of the scraper.Tag Manager which manages the tags for this resource.The Amazon Managed Service for Prometheus workspace the scraper sends metrics to.The configuration in use by the scraper.The Amazon EKS cluster from which the scraper collects metrics.getTags()
(Optional) The list of tag keys and values associated with the scraper.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
An optional user-assigned scraper alias.void
setDestination
(IResolvable value) The Amazon Managed Service for Prometheus workspace the scraper sends metrics to.void
The Amazon Managed Service for Prometheus workspace the scraper sends metrics to.void
The configuration in use by the scraper.void
The configuration in use by the scraper.void
setSource
(IResolvable value) The Amazon EKS cluster from which the scraper collects metrics.void
The Amazon EKS cluster from which the scraper collects metrics.void
(Optional) The list of tag keys and values associated with the scraper.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnScraper
protected CfnScraper(software.amazon.jsii.JsiiObjectRef objRef) -
CfnScraper
protected CfnScraper(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnScraper
@Stability(Stable) public CfnScraper(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnScraperProps props) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.props
- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrArn
The Amazon Resource Name (ARN) of the scraper.For example,
arn:aws:aps:<region>:123456798012:scraper/s-example1-1234-abcd-5678-ef9012abcd34
. -
getAttrRoleArn
The Amazon Resource Name (ARN) of the IAM role that provides permissions for the scraper to discover and collect metrics on your behalf.For example,
arn:aws:iam::123456789012:role/service-role/AmazonGrafanaServiceRole-12example
. -
getAttrScraperId
The ID of the scraper.For example,
s-example1-1234-abcd-5678-ef9012abcd34
. -
getCdkTagManager
Tag Manager which manages the tags for this resource.- Specified by:
getCdkTagManager
in interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getDestination
The Amazon Managed Service for Prometheus workspace the scraper sends metrics to. -
setDestination
The Amazon Managed Service for Prometheus workspace the scraper sends metrics to. -
setDestination
The Amazon Managed Service for Prometheus workspace the scraper sends metrics to. -
getScrapeConfiguration
The configuration in use by the scraper. -
setScrapeConfiguration
The configuration in use by the scraper. -
setScrapeConfiguration
@Stability(Stable) public void setScrapeConfiguration(@NotNull CfnScraper.ScrapeConfigurationProperty value) The configuration in use by the scraper. -
getSource
The Amazon EKS cluster from which the scraper collects metrics. -
setSource
The Amazon EKS cluster from which the scraper collects metrics. -
setSource
The Amazon EKS cluster from which the scraper collects metrics. -
getAlias
An optional user-assigned scraper alias. -
setAlias
An optional user-assigned scraper alias. -
getTags
(Optional) The list of tag keys and values associated with the scraper. -
setTags
(Optional) The list of tag keys and values associated with the scraper.
-