Skip to content

Commit

Permalink
OPA-953
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiantia committed Jan 23, 2024
1 parent 25b1b8c commit b19fdb1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
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

0 comments on commit b19fdb1

Please sign in to comment.