Skip to content

Commit 0d9a5f9

Browse files
committed
improve annotations
1 parent 75fb024 commit 0d9a5f9

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

rust/operator-binary/src/service.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,16 @@ fn prometheus_labels() -> Labels {
126126
///
127127
/// see also <https://github.com/prometheus-community/helm-charts/blob/prometheus-27.32.0/charts/prometheus/values.yaml#L983-L1036>
128128
fn prometheus_annotations(product_version: &str) -> Annotations {
129-
let port = if product_version.starts_with("1.") {
130-
METRICS_PORT
129+
let (path, port, scheme) = if product_version.starts_with("1.") {
130+
("/metrics", METRICS_PORT, "http")
131131
} else {
132-
HTTPS_PORT
132+
("/nifi-api/flow/metrics/prometheus", HTTPS_PORT, "https")
133133
};
134134

135135
Annotations::try_from([
136-
("prometheus.io/path".to_owned(), "/metrics".to_owned()),
136+
("prometheus.io/path".to_owned(), path.to_owned()),
137137
("prometheus.io/port".to_owned(), port.to_string()),
138-
("prometheus.io/scheme".to_owned(), "http".to_owned()),
138+
("prometheus.io/scheme".to_owned(), scheme.to_owned()),
139139
("prometheus.io/scrape".to_owned(), "true".to_owned()),
140140
])
141141
.expect("should be valid annotations")

0 commit comments

Comments
 (0)