-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Configurable message and labels #31
Comments
Sorry, my method does not work in a real app because pino is executed in a Worker. Need to find another solution. |
Working solution implemented, please check |
That fix looks great, would be interested in seeing this merged to master |
Hate to piggy back on this. But would really love to see the better formatter as an option |
Would love too. It seems that "values": [
[ "<unix epoch in nanoseconds>", "<log line>", {"trace_id": "0242ac120002", "user_id": "superUser123"}]
] https://grafana.com/docs/loki/latest/reference/loki-http-api/#ingest-logs |
Sorry for the late reply! Have you considered formatting your logs directly in Grafana/LogQL? {application="my-app"} | json | line_format "{{.msg}}" This should give you the exact same result. You can even create a custom grafana dashboard with this default LogQL query, so you don't have to type it every time manually. The solution proposed in #32 seems a bit "fragile" to me, because with Pino, it's possible to log without a logger.info(['hello', 'world']) // Will throw an error since we don't have a `msg` Reference: https://getpino.io/#/docs/api?id=logging-method-parameters Happy to discuss about that feature if you guys have better ideas. |
Using
pino-loki
in projects like NestJS leads to not-so-friendly messages in Grafana. Please see exampleCurrently there's not way to configure pino-loki to make message look like this:
The text was updated successfully, but these errors were encountered: