Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion examples/sample-app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async fn main() {
STATIC_METRICS.updown_counter.add(val * -1.0, &[]);
}
STATIC_METRICS.observable_gauge.observe(iteration, &[]);
info!("iteration: {iteration}");
info!("iteration: {}", iteration);
sleep(Duration::from_micros(100)).await;
}
info!("Done. Please hit [Ctrl+C] to exit");
Expand Down
18 changes: 17 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,28 @@ pub struct LogsExportTarget {
pub timeout: u64,
/// export severity - severity >= which to export
pub export_severity: Option<Severity>,
/// target name filters - only export logs that match these exact target names. If None, exports all logs.
pub target_filters: Option<Vec<String>>,
/// path to root ca cert
pub ca_cert_path: Option<String>,
/// a fn that provides the bearer token, which will be called to get the token for each export request
pub bearer_token_provider_fn: Option<fn() -> String>,
}

impl Default for LogsExportTarget {
fn default() -> Self {
Self {
url: String::new(),
interval_secs: 30,
timeout: 5,
export_severity: None,
target_filters: None,
ca_cert_path: None,
bearer_token_provider_fn: None,
}
}
}

#[derive(Clone, Debug)]
pub struct Attribute {
pub key: String,
Expand Down Expand Up @@ -147,8 +163,8 @@ mod tests {
interval_secs: 1,
timeout: 5,
export_severity: Some(Severity::Error),
ca_cert_path: None,
bearer_token_provider_fn: Some(get_dummy_auth_token),
..Default::default()
}];

let config = Config {
Expand Down
Loading