Skip to content

Some improvements about names of span logs#47667

Merged
nickitat merged 8 commits intoClickHouse:masterfrom
FrankChen021:span_names
Mar 29, 2023
Merged

Some improvements about names of span logs#47667
nickitat merged 8 commits intoClickHouse:masterfrom
FrankChen021:span_names

Conversation

@FrankChen021
Copy link
Copy Markdown
Contributor

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Improvement name of some span logs

Description

1. use type of job name as span name

Thread name is used as name of the span that is first created on a thread. If a Job does not set the thread name by calling setThreadName inside it, the default name 'ThreadPool::worker' is used.
We often see a lot of logs with this default name, and such default name provides nothing to understand the execution flow.

image

So, there's an improvement on this part that if the thread name is not changed by the job, the type name of the job will be used as span log. This gives a very clear information that what the thread is doing.

2. use name of IProcessors only as span name

Previously, ExecutionThreadContext::executeTask() is added as prefix of the span name, this makes the log not so intuitive.
This prefix is eliminated and only the name of processor itself is used.

3. add a span for PipelineExecutor.execute to give a clear info that how many threads are forked during the execution of pipeline.

These improvements are illustrated on the pic below

image

Since these names are related to the class name, and they're might change over time, it does not make any sense to write test cases to cover the changes in this PR.

@robot-ch-test-poll robot-ch-test-poll added the pr-improvement Pull request with some product improvements label Mar 17, 2023
@nickitat nickitat added the can be tested Allows running workflows for external contributors label Mar 17, 2023
@nickitat nickitat self-assigned this Mar 17, 2023
if (trace_processors)
{
span = std::make_unique<OpenTelemetry::SpanHolder>("ExecutionThreadContext::executeTask() " + node->processor->getName());
span = std::make_unique<OpenTelemetry::SpanHolder>(node->processor->getName());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe leave some small prefix like "P:" for processors?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The names in span in most cases are function names. So 'P:' seems a little bit wired for users to understand. I think using the processor name itself is clearly.

If we really want to give a clear information that this span is processor, how about using the function name style by adding prefix 'Processor::' ?

@FrankChen021
Copy link
Copy Markdown
Contributor Author

@FrankChen021 FrankChen021 requested a review from qoega March 22, 2023 05:47
@nickitat
Copy link
Copy Markdown
Member

Stateless tests (debug) [4/5] - ../contrib/s2geometry/src/s2/s2latlng_rect.h:382 ERROR Invalid rect: [50.4210420, 0.4931979], [2.1000000, 2.9000000] Stateless tests (debug, s3 storage) [5/6] - timeout, occured few times in the last days ../contrib/s2geometry/src/s2/s2latlng.cc:38 ERROR Invalid S2LatLng in S2LatLng::ToPoint: [1.84467e+19, 1.84467e+19]
Stateless tests (tsan, s3 storage) [1/5] - should be fixed by #47953

@nickitat nickitat merged commit 87d235e into ClickHouse:master Mar 29, 2023
@FrankChen021 FrankChen021 deleted the span_names branch March 30, 2023 02:07
@FrankChen021
Copy link
Copy Markdown
Contributor Author

Thank you @nickitat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-improvement Pull request with some product improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants