You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears this library doesn't actually support structured logging, instead it formats log lines into nested JSON message and then relies on json parser within loki to allow filtering.
You define what properties of log entry should be added as labels with propertiesAsLabels setting.
Other data as you mentioned is serialized as a JSON and relies on JSON parser for querying.
That was the concept over time to avoid the high cardinality problems, but give the possibility to query the data.
The concept of structured metadata was added later and it's a good extension point IMO.
For now I see the conceptual point to be solved:
Should it be added to V8
Design the architectural part & API (give the user possibility to define the metadata fields etc)
Ensure it will be a valid payload for older Loki version (or get the default optional configuration)
It appears this library doesn't actually support structured logging, instead it formats log lines into nested JSON message and then relies on json parser within loki to allow filtering.
As per Loki HTTP documentation to add structured logs one can append them as last item to log line array: https://grafana.com/docs/loki/latest/reference/api/#push-log-entries-to-loki
That will produce structured metadata as per https://grafana.com/docs/loki/latest/get-started/labels/structured-metadata/
Looking through the sourcecode it seems this library only serialises timestamp and message:
serilog-sinks-grafana-loki/src/Serilog.Sinks.Grafana.Loki/Models/LokiStream.cs
Line 31 in 7ce7324
The text was updated successfully, but these errors were encountered: