|
| 1 | +/** |
| 2 | + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 3 | + * SPDX-License-Identifier: Apache-2.0. |
| 4 | + */ |
| 5 | + |
| 6 | +#pragma once |
| 7 | +#include <aws/amp/PrometheusService_EXPORTS.h> |
| 8 | +#include <aws/core/utils/memory/stl/AWSString.h> |
| 9 | + |
| 10 | +#include <utility> |
| 11 | + |
| 12 | +namespace Aws { |
| 13 | +namespace Utils { |
| 14 | +namespace Json { |
| 15 | +class JsonValue; |
| 16 | +class JsonView; |
| 17 | +} // namespace Json |
| 18 | +} // namespace Utils |
| 19 | +namespace PrometheusService { |
| 20 | +namespace Model { |
| 21 | + |
| 22 | +/** |
| 23 | + * <p>The configuration for collecting broker, topic, and consumer-group metrics |
| 24 | + * from an Amazon MSK cluster through a managed Kafka exporter. The cluster must be |
| 25 | + * active, have IAM authentication enabled, and be in the same account and Region |
| 26 | + * as the scraper. Provisioned clusters with Standard brokers are supported. MSK |
| 27 | + * Serverless clusters are not supported.</p> <p>Use a VPC source that can connect |
| 28 | + * to the cluster's IAM bootstrap brokers. The exporter authenticates with the |
| 29 | + * scraper's service-linked role. Metrics can be sent to an Amazon Managed Service |
| 30 | + * for Prometheus workspace or a CloudWatch dataset.</p> <p>You must have an Amazon |
| 31 | + * MSK cluster policy that grants the scraper's service-linked role access to the |
| 32 | + * cluster. Without this policy, the scraper collects no Kafka metrics. For the |
| 33 | + * required actions and example policies, see <a |
| 34 | + * href="https://docs.aws.amazon.com/prometheus/latest/userguide/prom-msk-kafka-exporter.html#prom-msk-kafka-exporter-access">Grant |
| 35 | + * the scraper access to the cluster</a> in the <i>Amazon Managed Service for |
| 36 | + * Prometheus User Guide</i>.</p><p><h3>See Also:</h3> <a |
| 37 | + * href="http://docs.aws.amazon.com/goto/WebAPI/amp-2020-08-01/KafkaExporterConfiguration">AWS |
| 38 | + * API Reference</a></p> |
| 39 | + */ |
| 40 | +class KafkaExporterConfiguration { |
| 41 | + public: |
| 42 | + AWS_PROMETHEUSSERVICE_API KafkaExporterConfiguration() = default; |
| 43 | + AWS_PROMETHEUSSERVICE_API KafkaExporterConfiguration(Aws::Utils::Json::JsonView jsonValue); |
| 44 | + AWS_PROMETHEUSSERVICE_API KafkaExporterConfiguration& operator=(Aws::Utils::Json::JsonView jsonValue); |
| 45 | + AWS_PROMETHEUSSERVICE_API Aws::Utils::Json::JsonValue Jsonize() const; |
| 46 | + |
| 47 | + ///@{ |
| 48 | + /** |
| 49 | + * <p>The Amazon Resource Name (ARN) of the Amazon MSK cluster.</p> |
| 50 | + */ |
| 51 | + inline const Aws::String& GetClusterArn() const { return m_clusterArn; } |
| 52 | + inline bool ClusterArnHasBeenSet() const { return m_clusterArnHasBeenSet; } |
| 53 | + template <typename ClusterArnT = Aws::String> |
| 54 | + void SetClusterArn(ClusterArnT&& value) { |
| 55 | + m_clusterArnHasBeenSet = true; |
| 56 | + m_clusterArn = std::forward<ClusterArnT>(value); |
| 57 | + } |
| 58 | + template <typename ClusterArnT = Aws::String> |
| 59 | + KafkaExporterConfiguration& WithClusterArn(ClusterArnT&& value) { |
| 60 | + SetClusterArn(std::forward<ClusterArnT>(value)); |
| 61 | + return *this; |
| 62 | + } |
| 63 | + ///@} |
| 64 | + |
| 65 | + ///@{ |
| 66 | + /** |
| 67 | + * <p>An anchored RE2 regular expression that selects the Kafka topics to monitor. |
| 68 | + * The expression must start with <code>^</code> and end with <code>$</code>. If |
| 69 | + * omitted, the default is <code>^.*$</code>, which selects all topics.</p> |
| 70 | + */ |
| 71 | + inline const Aws::String& GetTopicFilter() const { return m_topicFilter; } |
| 72 | + inline bool TopicFilterHasBeenSet() const { return m_topicFilterHasBeenSet; } |
| 73 | + template <typename TopicFilterT = Aws::String> |
| 74 | + void SetTopicFilter(TopicFilterT&& value) { |
| 75 | + m_topicFilterHasBeenSet = true; |
| 76 | + m_topicFilter = std::forward<TopicFilterT>(value); |
| 77 | + } |
| 78 | + template <typename TopicFilterT = Aws::String> |
| 79 | + KafkaExporterConfiguration& WithTopicFilter(TopicFilterT&& value) { |
| 80 | + SetTopicFilter(std::forward<TopicFilterT>(value)); |
| 81 | + return *this; |
| 82 | + } |
| 83 | + ///@} |
| 84 | + |
| 85 | + ///@{ |
| 86 | + /** |
| 87 | + * <p>An anchored RE2 regular expression that selects the Kafka consumer groups to |
| 88 | + * monitor. The expression must start with <code>^</code> and end with |
| 89 | + * <code>$</code>. If omitted, the default is <code>^.*$</code>, which selects all |
| 90 | + * consumer groups.</p> |
| 91 | + */ |
| 92 | + inline const Aws::String& GetConsumerGroupFilter() const { return m_consumerGroupFilter; } |
| 93 | + inline bool ConsumerGroupFilterHasBeenSet() const { return m_consumerGroupFilterHasBeenSet; } |
| 94 | + template <typename ConsumerGroupFilterT = Aws::String> |
| 95 | + void SetConsumerGroupFilter(ConsumerGroupFilterT&& value) { |
| 96 | + m_consumerGroupFilterHasBeenSet = true; |
| 97 | + m_consumerGroupFilter = std::forward<ConsumerGroupFilterT>(value); |
| 98 | + } |
| 99 | + template <typename ConsumerGroupFilterT = Aws::String> |
| 100 | + KafkaExporterConfiguration& WithConsumerGroupFilter(ConsumerGroupFilterT&& value) { |
| 101 | + SetConsumerGroupFilter(std::forward<ConsumerGroupFilterT>(value)); |
| 102 | + return *this; |
| 103 | + } |
| 104 | + ///@} |
| 105 | + private: |
| 106 | + Aws::String m_clusterArn; |
| 107 | + |
| 108 | + Aws::String m_topicFilter; |
| 109 | + |
| 110 | + Aws::String m_consumerGroupFilter; |
| 111 | + bool m_clusterArnHasBeenSet = false; |
| 112 | + bool m_topicFilterHasBeenSet = false; |
| 113 | + bool m_consumerGroupFilterHasBeenSet = false; |
| 114 | +}; |
| 115 | + |
| 116 | +} // namespace Model |
| 117 | +} // namespace PrometheusService |
| 118 | +} // namespace Aws |
0 commit comments