1use rill_protocol::config::ConfigPatch;
2use rill_protocol::io::provider::PathPattern;
3use serde::Deserialize;
4use std::collections::HashSet;
5
6pub static NODE: ConfigPatch<String> = ConfigPatch::new("VAR-NOT-SPECIFIED");
8
9#[derive(Deserialize, Debug)]
12pub struct ExportConfig {
13 pub prometheus: Option<PrometheusConfig>,
15 pub graphite: Option<GraphiteConfig>,
17}
18
19impl Default for ExportConfig {
20 fn default() -> Self {
21 Self {
22 prometheus: None,
23 graphite: None,
24 }
25 }
26}
27
28impl ExportConfig {
29 pub fn node_url(&self) -> String {
32 let host = NODE.get(|| None, || "localhost:9090".into());
33 format!("ws://{}/live/client", host)
34 }
35}
36
37#[derive(Deserialize, Debug)]
39pub struct PrometheusConfig {
40 pub paths: HashSet<PathPattern>,
43}
44
45#[derive(Deserialize, Debug)]
47pub struct GraphiteConfig {
48 pub paths: HashSet<PathPattern>,
51 pub interval: Option<u64>,
53}