Class CfnScraper
- All Implemented Interfaces:
IEnvironmentAware,IInspectable,ITaggableV2,IScraperRef,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")
.roleConfiguration(RoleConfigurationProperty.builder()
.sourceRoleArn("sourceRoleArn")
.targetRoleArn("targetRoleArn")
.build())
.scraperLoggingConfiguration(ScraperLoggingConfigurationProperty.builder()
.loggingDestination(ScraperLoggingDestinationProperty.builder()
.cloudWatchLogs(CloudWatchLogDestinationProperty.builder()
.logGroupArn("logGroupArn")
.build())
.build())
.scraperComponents(List.of(ScraperComponentProperty.builder()
.type("type")
// the properties below are optional
.config(ComponentConfigProperty.builder()
.options(Map.of(
"optionsKey", "options"))
.build())
.build()))
.build())
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceTheAmpConfigurationstructure defines the Amazon Managed Service for Prometheus instance a scraper should send metrics to.static final classA fluent builder forCfnScraper.static interfaceRepresents a cloudwatch logs destination for scraper logging.static interfaceConfiguration settings for a scraper component.static interfaceWhere to send the metrics from a scraper.static interfaceTheEksConfigurationstructure describes the connection to the Amazon EKS cluster from which a scraper collects metrics.static interfaceThe role configuration in an Amazon Managed Service for Prometheus scraper.static interfaceA scrape configuration for a scraper, base 64 encoded.static interfaceA component of a Amazon Managed Service for Prometheus scraper that can be configured for logging.static interfaceConfiguration for scraper logging.static interfaceThe destination where scraper logs are sent.static interfaceThe source of collected metrics for a scraper.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.services.aps.IScraperRef
IScraperRef.Jsii$Default, IScraperRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnScraper(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnScraper(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 role configuration in an Amazon Managed Service for Prometheus scraper.The configuration in use by the scraper.The definition of logging configuration in an Amazon Managed Service for Prometheus workspace.A reference to a Scraper resource.The Amazon EKS cluster from which the scraper collects metrics.getTags()(Optional) The list of tag keys and values associated with the scraper.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidAn optional user-assigned scraper alias.voidsetDestination(IResolvable value) The Amazon Managed Service for Prometheus workspace the scraper sends metrics to.voidThe Amazon Managed Service for Prometheus workspace the scraper sends metrics to.voidsetRoleConfiguration(IResolvable value) The role configuration in an Amazon Managed Service for Prometheus scraper.voidThe role configuration in an Amazon Managed Service for Prometheus scraper.voidThe configuration in use by the scraper.voidThe configuration in use by the scraper.voidThe definition of logging configuration in an Amazon Managed Service for Prometheus workspace.voidThe definition of logging configuration in an Amazon Managed Service for Prometheus workspace.voidsetSource(IResolvable value) The Amazon EKS cluster from which the scraper collects metrics.voidThe 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, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.IEnvironmentAware
getEnvMethods 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:
inspectin 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:
renderPropertiesin 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:
getCdkTagManagerin interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getScraperRef
A reference to a Scraper resource.- Specified by:
getScraperRefin interfaceIScraperRef
-
getDestination
The Amazon Managed Service for Prometheus workspace the scraper sends metrics to.Returns union: either
IResolvableorCfnScraper.DestinationProperty -
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.Returns union: either
IResolvableorCfnScraper.ScrapeConfigurationProperty -
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.Returns union: either
IResolvableorCfnScraper.SourceProperty -
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. -
getRoleConfiguration
The role configuration in an Amazon Managed Service for Prometheus scraper.Returns union: either
IResolvableorCfnScraper.RoleConfigurationProperty -
setRoleConfiguration
The role configuration in an Amazon Managed Service for Prometheus scraper. -
setRoleConfiguration
@Stability(Stable) public void setRoleConfiguration(@Nullable CfnScraper.RoleConfigurationProperty value) The role configuration in an Amazon Managed Service for Prometheus scraper. -
getScraperLoggingConfiguration
The definition of logging configuration in an Amazon Managed Service for Prometheus workspace.Returns union: either
IResolvableorCfnScraper.ScraperLoggingConfigurationProperty -
setScraperLoggingConfiguration
The definition of logging configuration in an Amazon Managed Service for Prometheus workspace. -
setScraperLoggingConfiguration
@Stability(Stable) public void setScraperLoggingConfiguration(@Nullable CfnScraper.ScraperLoggingConfigurationProperty value) The definition of logging configuration in an Amazon Managed Service for Prometheus workspace. -
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.
-