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

Improve tracing usage and examples #32

Merged
merged 4 commits into from
Mar 2, 2024
Merged

Improve tracing usage and examples #32

merged 4 commits into from
Mar 2, 2024

Conversation

sjoerdsimons
Copy link
Collaborator

No description provided.

@sjoerdsimons
Copy link
Collaborator Author

This is on top of #29 which should be merged first

gitlab-runner/README.md Outdated Show resolved Hide resolved
gitlab-runner/Cargo.toml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
gitlab-runner/README.md Outdated Show resolved Hide resolved
gitlab-runner/README.md Outdated Show resolved Hide resolved
gitlab-runner/README.md Outdated Show resolved Hide resolved
gitlab-runner/README.md Outdated Show resolved Hide resolved
gitlab-runner/src/run.rs Show resolved Hide resolved
gitlab-runner/examples/demo-runner.rs Outdated Show resolved Hide resolved
@refi64
Copy link
Collaborator

refi64 commented Feb 28, 2024

oh oops I ended up with review comments from #29 in here didn't I 😅 it's mostly just small nits on that end though

@sjoerdsimons sjoerdsimons mentioned this pull request Feb 29, 2024
tracing_subscriber supports per-layer filtering. This partially
works by the Filtered wrapper having a private thread-local variable
as a backchannel to the Registry. So to have functional per-layer
filtering the Filtered wrapper is required.

Adjust the GitlabLayer constructor to actually create one wrapped in a
Filtered, with a basic filter to only enable spans and events which have
a gitlab related field

Signed-off-by: Sjoerd Simons <[email protected]>
@sjoerdsimons sjoerdsimons force-pushed the sjoerd/tracing branch 4 times, most recently from 2327c04 to f24933f Compare February 29, 2024 08:56
@sjoerdsimons sjoerdsimons requested a review from refi64 February 29, 2024 08:58
gitlab-runner/README.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@refi64 refi64 left a comment

Choose a reason for hiding this comment

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

other than single nit LGTM

Define tracing target gitlab_runner::gitlab::job as the stable span
target that will add the gitlab.job field. This allows users to add that
specifically to their filtering if they want to ensure the relevant
gitlab job id gets logged even if no other spans or events from
gitlab-runner crate are enabled.

Signed-off-by: Sjoerd Simons <[email protected]>
Make the demo runners logging slighly more examplary by allowing it to
be configurable as well as switching to json style if not run on a
terminal.

Signed-off-by: Sjoerd Simons <[email protected]>
By default cargo check doesn't check examples which caused a too low
tracing_subscriber dependency to not be caught.

Signed-off-by: Sjoerd Simons <[email protected]>
@sjoerdsimons sjoerdsimons added this pull request to the merge queue Mar 2, 2024
Merged via the queue into main with commit 33c8503 Mar 2, 2024
14 checks passed
@sjoerdsimons sjoerdsimons deleted the sjoerd/tracing branch March 13, 2024 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants