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: add alias prefixing to pino logs #916

Merged
merged 42 commits into from
Sep 24, 2024
Merged

Conversation

schaeferka
Copy link
Contributor

@schaeferka schaeferka commented Jun 26, 2024

Description

We need to verify that we are able to inject the name of the .Alias into logs of the callback function.

If it were possible it would need to be done with the Log object (import it into the mutate/validate/watch processor)

const Log = pino({
  transport,
  timestamp: pinoTimeFunction,
});

and import that into the mutate processor and set

set Log.prefix = the bindings alias before executing the callback

Checklist

  • Ensure npx pepr monitor is working and soak
  • soak and verify with user base that feature is performing as expected

Related Issue

Fixes #858

Relates to #676

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Checklist before merging

@schaeferka schaeferka added the Lula Needed for Lula integration into UDS Core label Jun 26, 2024
@schaeferka schaeferka self-assigned this Jun 26, 2024
@schaeferka schaeferka changed the title 858 prefixing pino logs feature: add alias prefixing to pino logs Jun 26, 2024
@schaeferka schaeferka changed the title feature: add alias prefixing to pino logs feat: add alias prefixing to pino logs Jun 26, 2024
Copy link

codecov bot commented Jul 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.97%. Comparing base (aa6823d) to head (cc0e3f3).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #916      +/-   ##
==========================================
+ Coverage   85.87%   92.97%   +7.09%     
==========================================
  Files          26       27       +1     
  Lines        1218     1252      +34     
  Branches      292      285       -7     
==========================================
+ Hits         1046     1164     +118     
+ Misses        158       86      -72     
+ Partials       14        2      -12     
Files with missing lines Coverage Δ
src/lib/capability.ts 94.90% <100.00%> (+64.60%) ⬆️
src/lib/schedule.ts 100.00% <ø> (ø)
src/lib/types.ts 100.00% <ø> (ø)

... and 4 files with indirect coverage changes

src/lib/types.ts Outdated Show resolved Hide resolved
@schaeferka schaeferka marked this pull request as ready for review September 24, 2024 11:03
package-lock.json Outdated Show resolved Hide resolved
src/lib/capability.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@cmwylie19 cmwylie19 left a comment

Choose a reason for hiding this comment

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

e2es look good, comments are addressed. Runs well and passes tests. Good job!

@cmwylie19 cmwylie19 merged commit 0ef5731 into main Sep 24, 2024
16 checks passed
@cmwylie19 cmwylie19 deleted the 858-prefixing-pino-logs branch September 24, 2024 17:21
@cmwylie19 cmwylie19 mentioned this pull request Sep 30, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lula Needed for Lula integration into UDS Core
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

SPIKE: Discovery - Feasibility of Prefixing Pino Logs to use .Alias if it is defined
2 participants