如何使用DataDog/浏览器log删除事件属性?

发布于 2025-01-27 21:10:27 字数 118 浏览 1 评论 0原文

我正在使用DataDog/浏览器logs,并且在记录它时,它正在创建一个属性,称为包含对象数据的config。这些属性似乎是自动记录的。我不包括其中的属性,如何删除一些属性?

下图显示了我想从

I am using datadog/browser-logs and upon logging it is creating an attribute called config that contains an object data. These attributes seem to be logged automatically. There are properties I do not which to include, how can I remove some properties?

Image below shows section in question which I want to remove properties from

Datadog event attributes

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

时光礼记 2025-02-03 21:10:27

您可以使用beforesend来擦洗/更改值。

import { datadogLogs } from '@datadog/browser-logs'

datadogLogs.init({
    ...,
    beforeSend: (log) => {
        if (log.message.config)
            delete log.message.config // or whatever property you want to remove
    },
    ...
});

但是我也建议尝试了解该价值首先是如何到达那里的

You can use beforeSend to scrub/alter values.

import { datadogLogs } from '@datadog/browser-logs'

datadogLogs.init({
    ...,
    beforeSend: (log) => {
        if (log.message.config)
            delete log.message.config // or whatever property you want to remove
    },
    ...
});

but I also suggest trying to understand how the value is getting there in the first place

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文