Julien-R44 / pino-loki

🔉 This package provides a transport for pino that forwards messages to Loki.
MIT License
115 stars 19 forks source link

[Feature Request] convertArrays should perform a shallow conversion instead of a deep conversion #30

Open anthonyma94 opened 4 months ago

anthonyma94 commented 4 months ago

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

image

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:

image

Julien-R44 commented 4 months ago

Hey! Indeed, looks like a bug. Happy to accept a PR for the same Thankss