[Feature Request] convertArrays should perform a shallow conversion instead of a deep conversion
Loki's documentation is poor in this regard, but it actually supports arrays nested in an object:
logger.info(["hello", "world", 2]); // omitted
logger.info({ data: ["hello", "world", 2] }); // shows up
If the purpose of convertArrays is only to allow for ingest, I think it should only convert in cases where it would otherwise be omitted, i.e. top-level conversion. Currently it converts array in all levels:
Hey! Indeed, looks like a bug. Happy to accept a PR for the same Thankss
from the document, for structured metadata, it expect only string both key and value as stated here
https://grafana.com/docs/loki/latest/reference/loki-http-api/#ingest-logs
You can optionally attach structured metadata to each log line by adding a JSON object to the end of the log line array. The JSON object must be a valid JSON object with string keys and string values. The JSON object should not contain any nested object. The JSON object must be set immediately after the log line. Here is an example of a log entry with some structured metadata attached: