Skip to content

Commit

Permalink
make logs structured
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel committed Oct 19, 2023
1 parent 28132b4 commit 8ef4f53
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/meta/src/rpc/ddl_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,9 @@ impl DdlController {
create_type: CreateType,
) -> MetaResult<NotificationVersion> {
tracing::debug!(
id = stream_job.id(),
definition = stream_job.definition(),
"starting stream job {}",
stream_job.id(),
"starting stream job",
);
let _permit = self
.creating_streaming_job_permits
Expand All @@ -428,7 +428,7 @@ impl DdlController {

let env = StreamEnvironment::from_protobuf(fragment_graph.get_env().unwrap());

tracing::debug!("preparing stream job {}", stream_job.id());
tracing::debug!(id = stream_job.id(), "preparing stream job");
let fragment_graph = self
.prepare_stream_job(&mut stream_job, fragment_graph)
.await?;
Expand All @@ -438,7 +438,7 @@ impl DdlController {

let mut internal_tables = vec![];
let result = try {
tracing::debug!("building stream job {}", stream_job.id());
tracing::debug!(id = stream_job.id(), "building stream job");
let (ctx, table_fragments) = self
.build_stream_job(env, &stream_job, fragment_graph)
.await?;
Expand Down Expand Up @@ -486,10 +486,10 @@ impl DdlController {
.await;
match result {
Err(e) => {
tracing::error!(stream_job_id, error = ?e, "finish stream job failed")
tracing::error!(id=stream_job_id, error = ?e, "finish stream job failed")
}
Ok(_) => {
tracing::info!(stream_job_id, "finish stream job succeeded")
tracing::info!(id = stream_job_id, "finish stream job succeeded")
}
}
};
Expand All @@ -508,7 +508,7 @@ impl DdlController {
internal_tables: Vec<Table>,
) -> MetaResult<NotificationVersion> {
let job_id = stream_job.id();
tracing::debug!("creating stream job {}", job_id);
tracing::debug!(id = job_id, "creating stream job");
let result = self
.stream_manager
.create_streaming_job(table_fragments, ctx)
Expand All @@ -518,17 +518,17 @@ impl DdlController {
// NOTE: This assumes that we will trigger recovery,
// and recover stream job progress.
CreateType::Background => {
tracing::error!(stream_job_id = stream_job.id(), error = ?e, "finish stream job failed")
tracing::error!(id = stream_job.id(), error = ?e, "finish stream job failed")
}
_ => {
self.cancel_stream_job(&stream_job, internal_tables).await?;
}
}
return Err(e);
};
tracing::debug!("finishing stream job {}", job_id);
tracing::debug!(id = job_id, "finishing stream job");
let version = self.finish_stream_job(stream_job, internal_tables).await?;
tracing::debug!("finished stream job {}", job_id);
tracing::debug!(id = job_id, "finished stream job");
Ok(version)
}

Expand Down

0 comments on commit 8ef4f53

Please sign in to comment.