Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1773,6 +1773,57 @@ public class ConfigOptions {
+ "the CoordinatorServer) it is advisable to use a port range "
+ "like 9250-9260.");

// ------------------------------------------------------------------------
// ConfigOptions for prometheus push gateway reporter
// ------------------------------------------------------------------------
public static final ConfigOption<String> METRICS_REPORTER_PROMETHEUS_PUSHGATEWAY_HOST_URL =
key("metrics.reporter.prometheus-pushgateway.hostUrl")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The configuration key is not aligned with Fluss format, I suggest to change them into

metrics.reporter.prometheus-push.url
metrics.reporter.prometheus-push.job-name
metrics.reporter.prometheus-push.random-job-name-suffix
metrics.reporter.prometheus-push.delete-on-shutdown
metrics.reporter.prometheus-push.filter-label-value-characters
metrics.reporter.prometheus-push.grouping-key

Use prometheus-push in the key as it is the identifier of metric.reporters=prometheus-push

.stringType()
.noDefaultValue()
.withDescription("The URL of the Prometheus PushGateway to push metrics to.");

public static final ConfigOption<String> METRICS_REPORTER_PROMETHEUS_PUSHGATEWAY_JOB_NAME =
key("metrics.reporter.prometheus-pushgateway.jobName")
.stringType()
.noDefaultValue()
.withDescription(
"The job name under which to push metrics to Prometheus PushGateway.");

public static final ConfigOption<Boolean>
METRICS_REPORTER_PROMETHEUS_PUSHGATEWAY_RANDOM_JOB_NAME_SUFFIX =
key("metrics.reporter.prometheus-pushgateway.randomJobNameSuffix")
.booleanType()
.defaultValue(false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not true like Flink?

.withDescription(
"Whether to append a random suffix to the job name. "
+ "This is useful when multiple instances of the reporter "
+ "are running on the same host.");

public static final ConfigOption<Boolean>
METRICS_REPORTER_PROMETHEUS_PUSHGATEWAY_DELETE_ON_SHUTDOWN =
key("metrics.reporter.prometheus-pushgateway.deleteOnShutdown")
.booleanType()
.defaultValue(false)
.withDescription(
"Whether to delete metrics from PushGateway on shutdown.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flink sets the config to true by default, why do we use false?

Besides, maybe we can add a note like Flink for this config? Fluss will try its best to delete the metrics but this is not guaranteed.


public static final ConfigOption<Boolean>
METRICS_REPORTER_PROMETHEUS_PUSHGATEWAY_FILTER_LABEL_VALUE_CHARACTERS =
key("metrics.reporter.prometheus-pushgateway.filterLabelValueCharacters")
.booleanType()
.defaultValue(true)
.withDescription(
"Whether to filter characters in label values to conform to the "
+ "Prometheus character set ([a-zA-Z0-9:_]).");

public static final ConfigOption<String> METRICS_REPORTER_PROMETHEUS_PUSHGATEWAY_GROUPING_KEY =
key("metrics.reporter.prometheus-pushgateway.groupingKey")
.stringType()
.noDefaultValue()
.withDescription(
"The grouping key to use when pushing metrics to Prometheus PushGateway. "
+ "The format should be k1=v1;k2=v2.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


// ------------------------------------------------------------------------
// ConfigOptions for jmx reporter
// ------------------------------------------------------------------------
Expand Down
12 changes: 12 additions & 0 deletions fluss-metrics/fluss-metrics-prometheus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@
<version>${prometheus.version}</version>
</dependency>

<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_pushgateway</artifactId>
<version>${prometheus.version}</version>
</dependency>

<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_hotspot</artifactId>
<version>${prometheus.version}</version>
</dependency>

<!-- test dependencies -->
<dependency>
<groupId>org.apache.fluss</groupId>
Expand Down
Loading
Loading