8000 add tracing_journald support for linux by shawn111 · Pull Request #407 · comtrya/comtrya · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

add tracing_journald support for linux #407

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

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

shawn111
Copy link
Contributor
@shawn111 shawn111 commented Mar 5, 2024

I'm submitting a

  • bug fix
  • feature
  • documentation addition

What is the current behaviour?

directly output log to stdout.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

It's not a bug, more like a log enhancement with journalctl. #254

Once, tracing_journald supported.

 journalctl -f  F_MANIFEST=zellij -o json-pretty

{
        "CODE_LINE" : "268",
...
        "SYSLOG_IDENTIFIER" : "comtrya",
        "_COMM" : "comtrya",
        "F_MANIFEST" : "zellij",
        "SPAN_TARGET" : "comtrya::commands::apply",
        "TARGET" : "comtrya::commands::apply",
...
}

What is the expected behavior?

journalctl -t comtrya                       ### all comtrya log
journalctl -t comtrya F_MANIFEST=zellij     ### comtrya manifest zellij log       

What is the motivation / use case for changing the behavior?

Linux users can easy trace manifests actions by journalctl.

Please tell us about your environment:

Version (comtrya --version): 0.8.8
Operating system: Fedora

@codecov-commenter
Copy link
codecov-commenter commented Mar 5, 2024

Codecov Report

Attention: Patch coverage is 0% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 28.43%. Comparing base (b574682) to head (c3b3077).
Report is 8 commits behind head on main.

Files Patch % Lines
app/src/main.rs 0.00% 10 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #407      +/-   ##
==========================================
- Coverage   28.59%   28.43%   -0.17%     
==========================================
  Files          85       85              
  Lines        2301     2307       +6     
==========================================
- Hits          658      656       -2     
- Misses       1643     1651       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@shawn111
Copy link
Contributor Author
shawn111 commented Mar 5, 2024

It seem tracing_journald is not stable yet.
version and api are not matched.

tokio-rs/tracing#2835

@shawn111 shawn111 force-pushed the tracing_journald branch 4 times, most recently from ff393de to c15cab3 Compare March 7, 2024 09:29
@shawn111
Copy link
Contributor Author
shawn111 commented Mar 7, 2024

╰─❯ journalctl -t comtrya F_MANIFEST=github -p 5

Mar 07 13:18:27 fedora comtrya[413440]: nothing to be done to reconcile action
Mar 07 13:18:27 fedora comtrya[413440]: Completed
Mar 07 13:20:55 fedora comtrya[414248]: need to define action summarize
Mar 07 13:20:55 fedora comtrya[414248]: not found action summarize
Mar 07 13:20:55 fedora comtrya[414248]: Completed
Mar 07 17:31:40 fedora comtrya[481344]: nothing to be done to reconcile action
Mar 07 17:31:40 fedora comtrya[481344]: Completed

╰─❯ journalctl -t comtrya F_MANIFEST=github -p 4

Mar 07 13:20:55 fedora comtrya[414248]: need to define action summarize

@shawn111 shawn111 changed the title WIP: add tracing_journald add tracing_journald Mar 7, 2024
@shawn111
Copy link
Contributor Author
shawn111 commented Mar 7, 2024

@rawkode could you help me take a look of this PR?
journalctl is very powerful for Linux user to review their comtrya log.

We can filter by F_MANIFEST or F_ACTION

journalctl -t comtrya ## all comtrya log
journalctl -f  F_MANIFEST=zellij  -o json-pretty -p 4-7
journalctl -f  F_ACTION=github.binary  -o json-pretty -p 4-7

or change output json / short-precise / ...

all comtrya log

```
$ journalctl -t comtrya
```

filter by manifest
```
$ journalctl F_MANIFEST=github
```

filter by action
```
$ journalctl F_ACTION=github.binary
```
@shawn111 shawn111 changed the title add tracing_journald add tracing_journald support for linux Mar 8, 2024
@martintc martintc merged commit f56cfc5 into comtrya:main Mar 27, 2024
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

Successfully merging this pull request may close these issues.

3 participants
0