Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: DEVOPS-1867 otlp-collector endpoint generation in the node configs #2304

Merged
merged 4 commits into from
Feb 6, 2025
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
9 changes: 8 additions & 1 deletion z2/src/chain/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -939,8 +939,15 @@ impl ChainNode {
let rendered_template = self.get_config_toml().await?;
let config_file = rendered_template.as_str();

// Adding the OpenTelemetry collector endpoint to all nodes configurations
let otlp_collector_endpoint = "http://localhost:4317";
let config_file_with_otlp = format!(
"otlp_collector_endpoint = \"{otlp_collector_endpoint}\"\n{}",
config_file
);

let mut fh = File::create(filename).await?;
fh.write_all(config_file.as_bytes()).await?;
fh.write_all(config_file_with_otlp.as_bytes()).await?;
println!("Configuration file created: {filename}");

Ok(filename.to_owned())
Expand Down
2 changes: 1 addition & 1 deletion z2/src/validators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ pub async fn gen_validator_startup_script(

if let Some(v) = otlp_collector_endpoint {
let _ = config.spec.as_table_mut().unwrap().insert(
String::from("otlp_collector_endpoints"),
String::from("otlp_collector_endpoint"),
toml::Value::String(v.to_string()),
);
}
Expand Down