-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:breadrock1/doc-searcher
- Loading branch information
Showing
9 changed files
with
90 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
global: | ||
scrape_interval: 15s | ||
evaluation_interval: 15s | ||
|
||
external_labels: | ||
monitor: 'doc-searcher' | ||
|
||
scrape_configs: | ||
- job_name: 'prometheus' | ||
scrape_interval: 15s | ||
static_configs: | ||
- targets: ['localhost:9090'] | ||
|
||
- job_name: 'doc-searcher' | ||
metrics_path: '/metrics' | ||
scrape_interval: 15s | ||
static_configs: | ||
- targets: ['doc-searcher:2892'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
pub mod endpoints; | ||
|
||
#[cfg(feature = "enable-prometheus")] | ||
pub mod prometheus; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use actix_web_prom::{PrometheusMetrics, PrometheusMetricsBuilder}; | ||
use std::collections::HashMap; | ||
|
||
pub fn init_prometheus() -> Result<PrometheusMetrics, anyhow::Error> { | ||
let mut labels = HashMap::new(); | ||
labels.insert("label1".to_string(), "value1".to_string()); | ||
let prometheus = PrometheusMetricsBuilder::new("metrics") | ||
.endpoint("/metrics") | ||
.const_labels(labels) | ||
.build() | ||
.map_err(|err| anyhow::Error::msg(err.to_string()))?; | ||
|
||
Ok(prometheus) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters