-
-
Notifications
You must be signed in to change notification settings - Fork 41
feat(logs): Improve logs with spans #194
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
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
database: | ||
host: "localhost" | ||
port: 5430 | ||
name: "postgres" | ||
username: "postgres" | ||
password: "postgres" | ||
tls: | ||
enabled: false | ||
trusted_root_certs: "" | ||
require_ssl: false | ||
application: | ||
host: "127.0.0.1" | ||
port: 8000 | ||
encryption_key: | ||
id: 0 | ||
key: BlK9AlrzqRnCZy53j42uE1p2qGBiF7HYZjZYFaZObqg= | ||
api_key: XOUbHmWbt9h7nWl15wWwyWQnctmFGNjpawMc3lT5CFs= |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -620,4 +620,4 @@ impl K8sClient for HttpK8sClient { | |
|
||
Ok(logs) | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,7 +122,11 @@ where | |
async fn start(self) -> Result<ApplyWorkerHandle, Self::Error> { | ||
info!("starting apply worker"); | ||
|
||
let apply_worker_span = tracing::info_span!("apply_worker"); | ||
let apply_worker_span = tracing::info_span!( | ||
"apply_worker", | ||
pipeline_id = self.pipeline_id, | ||
publication_name = self.config.publication_name | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My idea was that we want a reliable way to get a view of all logs of a certain pipeline for debugging a single customer. |
||
); | ||
let apply_worker = async move { | ||
let start_lsn = get_start_lsn(self.pipeline_id, &self.replication_client).await?; | ||
|
||
|
@@ -151,7 +155,7 @@ where | |
|
||
Ok(()) | ||
} | ||
.instrument(apply_worker_span); | ||
.instrument(apply_worker_span.or_current()); | ||
|
||
let handle = tokio::spawn(apply_worker); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ use etl::state::store::postgres::PostgresStateStore; | |
use etl::{destination::base::Destination, pipeline::PipelineId}; | ||
use secrecy::ExposeSecret; | ||
use std::fmt; | ||
use tracing::{info, instrument, warn}; | ||
use tracing::{info, warn}; | ||
|
||
pub async fn start_replicator() -> anyhow::Result<()> { | ||
info!("starting replicator service"); | ||
|
@@ -145,7 +145,7 @@ async fn init_state_store( | |
Ok(PostgresStateStore::new(pipeline_id, pg_connection_config)) | ||
} | ||
|
||
#[instrument(skip(pipeline))] | ||
#[tracing::instrument(skip(pipeline), fields(pipeline_id = pipeline.id()))] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, is |
||
async fn start_pipeline<S, D>(mut pipeline: Pipeline<S, D>) -> anyhow::Result<()> | ||
where | ||
S: StateStore + Clone + Send + Sync + 'static, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We emit errors on our own.