grafana / faro-web-sdk

The Grafana Faro Web SDK, part of the Grafana Faro project, is a highly configurable web SDK for real user monitoring (RUM) that instruments browser frontend applications to capture observability signals. Frontend telemetry can then be correlated with backend and infrastructure data for full-stack observability.
https://grafana.com/oss/faro/
Apache License 2.0
739 stars 64 forks source link

feat: LogArgsSerializer to customize how args are converter to string #580

Closed mxab closed 5 months ago

mxab commented 5 months ago

Why

The default behaviour in pushLogs stringifies all arguments in a very simple way. This results in potential [object Object] log messages if some one or some third party library decides to put complex logs arguments e.g. console.info({foo: "bar"})

What

This PR extends the faro config with a logArgsSerializer paremeter that allows to override the default behaviour and put in a custom args renderer

fixes #564

Checklist

CLAassistant commented 5 months ago

CLA assistant check
All committers have signed the CLA.

CLAassistant commented 5 months ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

codecapitano commented 5 months ago

Hi @mxab can you also add the new property to the core readme please.

Section: Besides the mandatory properties, Faro configuration also supports the following optional properties:

mxab commented 5 months ago

Done, do you want me to squash the changes?

codecapitano commented 5 months ago

Done, do you want me to squash the changes?

Hey Max you don't need to squash them yourself. We'll squash & merge them via GH.

mxab commented 5 months ago

yeah I only executed the linter in the core package. thx

mxab commented 5 months ago

at last the linter approves 😅