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

fix(config api): emit graphql field of api config #19692

Merged
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
3 changes: 2 additions & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ impl ApplicationConfig {
Ok(api_server) => {
emit!(ApiStarted {
addr: self.api.address.unwrap(),
playground: self.api.playground
playground: self.api.playground,
graphql: self.api.graphql
});

Some(api_server)
Expand Down
6 changes: 5 additions & 1 deletion src/internal_events/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@ use vector_lib::internal_event::InternalEvent;
pub struct ApiStarted {
pub addr: SocketAddr,
pub playground: bool,
pub graphql: bool,
}

impl InternalEvent for ApiStarted {
fn emit(self) {
let playground = &*format!("http://{}:{}/playground", self.addr.ip(), self.addr.port());
let graphql = &*format!("http://{}:{}/graphql", self.addr.ip(), self.addr.port());
info!(
message="API server running.",
address = ?self.addr,
playground = %if self.playground { playground } else { "off" }
playground = %if self.playground { playground } else { "off" },
graphql = %if self.graphql { graphql } else { "off" }

);
counter!("api_started_total", 1);
}
Expand Down
3 changes: 2 additions & 1 deletion src/topology/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ impl TopologyController {
Ok(api_server) => {
emit!(ApiStarted {
addr: new_config.api.address.unwrap(),
playground: new_config.api.playground
playground: new_config.api.playground,
graphql: new_config.api.graphql,
});

Some(api_server)
Expand Down
Loading