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

feat: show thread name in logs for playground and standalone #14114

Merged
merged 6 commits into from
Dec 26, 2023

Conversation

BugenZhao
Copy link
Member

@BugenZhao BugenZhao commented Dec 21, 2023

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

See backgrounds from #13988.

Not sure if the current thread names help much but I guess it's a good to have.

  • Show thread names in logs for playground and standalone.
  • Shorten the thread names to comply with Linux's 16-character limit.
  • Also include the Java thread's name as a field in tracing_slf4j. This is not restricted to the playground or standalone profile.

Preview:

2023-12-21T14:00:06.823695+08:00  INFO rw-streaming actor{otel.name="Actor 12" actor_id=12}:executor{otel.name="Source C00002716 (actor 12)" actor_id=12}: risingwave_stream::executor::source::source_executor: source exector: actor 12 boot with splits: []

2023-12-21T14:33:31.611598+08:00 DEBUG     rw-batch batch_execute{task_id=2 stage_id=1 query_id="ecc10067-f10f-47ae-8d64-6a1451250a50"}: risingwave_batch::task::task_execution: Batch task TaskId { task_id: 2, stage_id: 1, query_id: "ecc10067-f10f-47ae-8d64-6a1451250a50" } finished successfully.

2023-12-21T14:00:07.581617+08:00  INFO ThreadId(35) risingwave_connector_node: Taking initial snapshot for new datasource thread="debezium-postgresconnector-RW_CDC_1002-change-event-source-coordinator" class="io.debezium.connector.postgresql.snapshot.InitialSnapshotter"

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

Signed-off-by: Bugen Zhao <[email protected]>
@BugenZhao BugenZhao changed the title show thread name in logs feat: show thread name in logs Dec 21, 2023
Signed-off-by: Bugen Zhao <[email protected]>
@BugenZhao BugenZhao changed the title feat: show thread name in logs feat: show thread name in logs for playground and standalone Dec 21, 2023
Signed-off-by: Bugen Zhao <[email protected]>
@BugenZhao BugenZhao marked this pull request as ready for review December 21, 2023 06:36
@@ -359,7 +369,7 @@ pub fn init_risingwave_logger(settings: LoggerSettings) {
let otel_tracer = {
let runtime = tokio::runtime::Builder::new_multi_thread()
.enable_all()
.thread_name("risingwave-otel")
.thread_name("rw-otel")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does otel mean?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the abbreviation of opentelemetry.

@BugenZhao BugenZhao enabled auto-merge December 26, 2023 07:01
@BugenZhao BugenZhao added this pull request to the merge queue Dec 26, 2023
Merged via the queue into main with commit d25c5da Dec 26, 2023
28 of 29 checks passed
@BugenZhao BugenZhao deleted the bz/log-thread-name branch December 26, 2023 07:53
StrikeW added a commit that referenced this pull request Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants