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

tracing-appender: make worker thread name configurable #2364

Closed
nstinus opened this issue Nov 2, 2022 · 6 comments
Closed

tracing-appender: make worker thread name configurable #2364

nstinus opened this issue Nov 2, 2022 · 6 comments

Comments

@nstinus
Copy link
Contributor

nstinus commented Nov 2, 2022

Configure worker thread name in tracing-appender

Crates

tracing-appender

Motivation

In v0.3.16, the worker thread does not have a proper name, so it takes the application's name. In master, it seems it uses "tracing-appender". It is useful to quickly identify threads for auditing or affinity pinning.

Proposal

Add a field to NonBlockingBuilder with a setter. Pass this name during worker init.

@davidbarsky
Copy link
Member

For what it's worth, the v0.1.x branch also has the thread named tracing-appender. We should probably get a release of tracing-appender 0.2.3 out with this change, but in the meantime, are you comfortable taking a git dependency on the v0.1.x branch for the named thread? To step back, do you want to change the name of the thread from tracing-appender to something else?

@nstinus
Copy link
Contributor Author

nstinus commented Nov 2, 2022

One may have more that one non blocking appender in an app and the easiest way to distinguish them would be to allow it to be configured by the user. I have a change ready on master but I was a bit confused regarding the branch situation. What are the stable and dev branches? Where should such a change go, provided it is not breaking?

@davidbarsky
Copy link
Member

Adding a configuration option via a setter isn't a breaking change, so I wouldn't worry about that. Opening the PR against is preferred—we handle backports.

nstinus added a commit to nstinus/tracing that referenced this issue Nov 3, 2022
The worker thread name in non blocking mode is always "tracing-appender".
It can be convenient to quickly identify the appender threads for
audit reasons or affinity pinning.

This patch adds a new setter to the builder and propagates the info to
the thread initialization.
@nstinus
Copy link
Contributor Author

nstinus commented Nov 3, 2022

To make sure I understand properly, the PR should be done on the master branch and you will backport it to the stable branch?
The issue I have is that I am using the following versions in my projects and upgrading to master to test my changes breaks a lot of stuff.

 tracing-appender = "~0.2"
 tracing-core = "~0.1"
 tracing-subscriber = { version = "~0.3", features = ["local-time"] }

Is there an upgrade/migration documentation?

nstinus added a commit to nstinus/tracing that referenced this issue Nov 4, 2022
The worker thread name in non blocking mode is always "tracing-appender".
It can be convenient to quickly identify the appender threads for
audit reasons or affinity pinning.

This patch adds a new setter to the builder and propagates the info to
the thread initialization.
@hawkw hawkw closed this as completed in 662b294 Nov 4, 2022
@nstinus
Copy link
Contributor Author

nstinus commented Nov 4, 2022

Thank you @hawkw! Is it reasonable to expect this patch to be released under tracing-appender 0.2.x?

@hawkw
Copy link
Member

hawkw commented Nov 4, 2022

Yup, we'll take care of backporting this and publishing a release at some point in the near future! Thanks for the contribution!

hawkw pushed a commit that referenced this issue Apr 21, 2023
## Motivation

The worker thread name in non blocking mode is always "tracing-appender".
It can be convenient to quickly identify the appender threads for
audit reasons or affinity pinning.

## Solution

This patch adds a new setter to the builder and propagates the info to
the thread initialization.

Closes #2364
hawkw pushed a commit that referenced this issue Apr 21, 2023
## Motivation

The worker thread name in non blocking mode is always "tracing-appender".
It can be convenient to quickly identify the appender threads for
audit reasons or affinity pinning.

## Solution

This patch adds a new setter to the builder and propagates the info to
the thread initialization.

Closes #2364
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants