-
Notifications
You must be signed in to change notification settings - Fork 613
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(runtime): log formats per deployment environment #10633
Conversation
Signed-off-by: Bugen Zhao <[email protected]>
let fmt_layer = match deployment { | ||
Deployment::Ci => fmt_layer | ||
.compact() | ||
.with_filter(FilterFn::new(|metadata| metadata.is_event())) // filter-out all span-related info | ||
.boxed(), | ||
Deployment::Cloud => fmt_layer.json().boxed(), | ||
Deployment::Other => fmt_layer.pretty().boxed(), |
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.
For local, I'm not sure if pretty
is too verbose. But I'm OK with it. 🤪
For cloud, is it the best practice to log JSON to stdout? 👀 I imagined it's sth like writing to some log collector service directly.
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.
It seems scraping lines from log files and then parsing them with JSON is somehow a common practice in Loki.
Codecov Report
@@ Coverage Diff @@
## main #10633 +/- ##
==========================================
- Coverage 70.14% 70.14% -0.01%
==========================================
Files 1276 1277 +1
Lines 219818 219837 +19
==========================================
+ Hits 154200 154204 +4
- Misses 65618 65633 +15
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 7 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
tracing::info_span!( | ||
parent: None, | ||
"actor", | ||
"otel.name" = span_name, |
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.
What's otel?
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.
It's a special field for opentelemetry. Will be displayed as the span name.
https://docs.rs/tracing-opentelemetry/latest/tracing_opentelemetry/#special-fields
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.
LGTM
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Detect deployment environment according to environment variables (
RISINGWAVE_CI
,RISINGWAVE_CLOUD
) to use different log formats.#10000 #10426
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Click here for Documentation
Types of user-facing changes
Please keep the types that apply to your changes, and remove the others.
Release note