-
-
Notifications
You must be signed in to change notification settings - Fork 116
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: standardise logs #371
Conversation
4e98ef5
to
9d8de08
Compare
src/monitoring/logflare.ts
Outdated
@@ -20,5 +20,8 @@ export default function () { | |||
return createLogFlareWriteStream({ | |||
apiKey: logflareApiKey, | |||
sourceToken: logflareSourceToken, | |||
onPreparePayload: (payload: any) => { | |||
return payload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would need to set the project key here
https://github.com/Logflare/pino-logflare/blob/master/docs/API.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ziinc the project key is already inferred from the log-middleware https://github.com/supabase/storage-api/pull/371/files#diff-7657d30e7d33d62772ae092233fbe7844f1601fbda2d5ebe6252b220988928abR7
do you think is still worth calling defaultPreparePayload(payload, meta)
?
If yes, would this make sense:
onPreparePayload: (payload: any, meta: any) => {
const item = defaultPreparePayload(payload, meta)
item.project = payload.project
return item
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea it is needed as the key needs to be a top level field for enabling clustering
06aa132
to
f2b24e0
Compare
Pull Request Test Coverage Report for Build 6351879663
💛 - Coveralls |
f2b24e0
to
8ce2579
Compare
@@ -20,5 +22,10 @@ export default function () { | |||
return createLogFlareWriteStream({ | |||
apiKey: logflareApiKey, | |||
sourceToken: logflareSourceToken, | |||
onPreparePayload: (payload: any, meta: any) => { | |||
const item = defaultPreparePayload(payload, meta) | |||
item.project = payload.project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@supabase/logging I want to avoid project
as the top level key. Can we cluster by tenant
instead?
🎉 This PR is included in version 0.42.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
What kind of change does this PR introduce?
Improvement
What is the current behavior?
Currently, logs are a bit all over the place with different shapes.
What is the new behavior?
This PR tries to standardize logs across the service and include more useful information such as:
Lifecycle events are now also logged and you can find the lifecycle of a specific asset by filtering with:
additionally, you can filter by the following properties:
All events will also include a
reqId
field which can be correlated to the request that was issued from.