SDK 会尝试从环境变量 SENTRY_RELEASE 中读取该值

跨 SDK 的常见选项列表。这些功能在所有 SDK 中或多或少都是一样的,但是为了更好地支持平台,会存在一些细微的差异。可以从环境变量或你的 ~/.sentryclirc 文件中自动的读取的选项(SENTRY_DSN, SENTRY_ENVIRONMENT, SENTRY_RELEASE)。有关更多信息,请参见Working with Projects。

dsn

DSN 告诉 SDK 将事件发送到哪里。如果没有提供这个值,SDK 将尝试从 SENTRY_DSN 环境变量中读取它。如果这个变量也不存在,SDK 就不会发送任何事件。

在没有进程环境(如浏览器)的运行时中,fallback 不会应用。

debug

打开或关闭调试模式。如果启用了调试,如果发送事件时出现问题,SDK 将尝试打印出有用的调试信息。默认值总是 false。一般不建议在生产环境中打开它,尽管打开 debug 模式不会引起任何安全问题。

release

设置 release(发行版)。某些 SDK 会尝试自动配置 release,但是最好手动设置 release,以确保该 release 与您的 deploy integrations 或 source map uploads 同步。版本名称是字符串,但是 Sentry 会检测到某些格式,并且它们的呈现方式可能有所不同。在 releases 文档中了解有关如何发送 release 数据的更多信息,以便 Sentry 可以告诉您 release 之间的回归并确定潜在的来源。

默认情况下,SDK 会尝试从环境变量 SENTRY_RELEASE 中读取该值(在浏览器 SDK 中,将从 window.SENTRY_RELEASE 中读取该值,如果可用)。

environment

设置环境。此字符串为自由形式,默认情况下不设置。一个 release 可以与多个环境相关联,以便在 UI 中将它们分开(可以考虑staging 与 prod 或类似的方式)。

默认情况下,SDK 将尝试从 SENTRY_ENVIRONMENT 环境变量中读取该值(浏览器 SDK 除外)。

sampleRate

配置错误事件的采样率,范围为 0.0 到 1.0。默认值为 1.0,表示发送了 100% 的错误事件。如果设置为 0.1,则仅发送 10% 的错误事件。事件是随机选择的。

maxBreadcrumbs

这个变量控制应该捕获的面包屑( breadcrumbs )总数。默认值为 100。

attachStacktrace

当启用时,堆栈跟踪将自动附加到所有记录的消息。堆栈跟踪总是附加到异常;然而,当设置此选项时,堆栈跟踪也会与消息一起发送。例如,该选项意味着堆栈跟踪显示在所有日志消息的旁边。

该选项默认为 off。

对于有堆栈跟踪和没有堆栈跟踪的事件,Sentry中的分组是不同的。结果,在为某些事件启用或禁用此 flag 时,您将获得新的组。

sendDefaultPii

如果启用此 flag,则某些个人识别信息(PII)将由 active integrations 添加。默认情况下,不发送此类数据。如果可能的话,我们建议默认情况下启用此功能以发送所有此类数据,并使用管理 敏感数据 的功能手动删除您不想发送的内容。

denyUrls

与不应该发送到 Sentry 的错误 URL 相匹配的字符串或正则表达式模式列表。默认情况下,将发送所有错误。这是一个 “contains(包含)” 匹配整个文件 URL。因此,如果你添加 foo.com,它也会匹配 https://bar.com/myfile/foo.com。默认情况下,将发送所有错误。

allowUrls

匹配错误 URL 的字符串列表或正则表达式模式的遗留别名,这些错误 URL 应该专门发送给 Sentry。默认情况下,将发送所有错误。这是一个 “contains(包含)” 匹配整个文件 URL。因此,如果您将 foo.com 添加到它,它也将匹配 https://bar.com/myfile/foo.com。默认情况下,所有错误将被发送。

autoSessionTracking

当设置为 true 时,SDK 将发送 session 事件给 Sentry。所有浏览器 SDK 都支持这一点,每个页面加载都向 Sentry 发送一个 session。

normalizeDepth

Sentry SDK 将任何上下文数据标准化到给定深度。任何包含比其更深的结构的数据的 key 都将被修剪并使用其类型([Object] 或 [Array])进行标记,而无需进一步进行操作。默认情况下,walking 的深度为 3 级。

Integration Configuration
对于许多平台,SDK 集成可以与之一起配置。在一些平台上,这是 init() 调用的一部分,而在另一些平台上,则应用不同的模式。

integrations

在一些 SDK 中,在库初始化时通过这个参数配置集成。要了解更多信息,请参阅我们的文档了解特定的集成。
https://github.com/users/fnuh1891/projects/969
https://github.com/users/iuiz66DY/projects/970
https://github.com/users/zlri87gyr/projects/969
https://github.com/users/fnuh1891/projects/970
https://github.com/users/iuiz66DY/projects/971
https://github.com/users/aopugfGY/projects/966
https://github.com/users/ofbz122/projects/971
https://github.com/users/zlri87gyr/projects/970
https://github.com/users/iuiz66DY/projects/972
https://github.com/users/aopugfGY/projects/967
https://github.com/users/ofbz122/projects/972
https://github.com/users/fnuh1891/projects/971
https://github.com/users/iuiz66DY/projects/973
https://github.com/users/ofbz122/projects/973
https://github.com/users/aopugfGY/projects/968
https://github.com/users/fnuh1891/projects/972
https://github.com/users/zlri87gyr/projects/971
https://github.com/users/iuiz66DY/projects/974
https://github.com/users/ofbz122/projects/974
https://github.com/users/aopugfGY/projects/969
https://github.com/users/fnuh1891/projects/973
https://github.com/users/zlri87gyr/projects/972
https://github.com/users/ofbz122/projects/975
https://github.com/users/iuiz66DY/projects/975
https://github.com/users/aopugfGY/projects/970
https://github.com/users/fnuh1891/projects/974
https://github.com/users/zlri87gyr/projects/973
https://github.com/users/iuiz66DY/projects/976
https://github.com/users/ofbz122/projects/976
https://github.com/users/aopugfGY/projects/971
https://github.com/users/fnuh1891/projects/975
https://github.com/users/zlri87gyr/projects/974
https://github.com/users/iuiz66DY/projects/977
https://github.com/users/ofbz122/projects/977
https://github.com/users/fnuh1891/projects/976
https://github.com/users/aopugfGY/projects/972
https://github.com/users/zlri87gyr/projects/975
https://github.com/users/iuiz66DY/projects/978
https://github.com/users/fnuh1891/projects/977
https://github.com/users/ofbz122/projects/978
https://github.com/users/zlri87gyr/projects/976
https://github.com/users/aopugfGY/projects/973
https://github.com/users/iuiz66DY/projects/979
https://github.com/users/fnuh1891/projects/978
https://github.com/users/ofbz122/projects/979
https://github.com/users/aopugfGY/projects/974
https://github.com/users/zlri87gyr/projects/977
https://github.com/users/iuiz66DY/projects/980
https://github.com/users/fnuh1891/projects/979
https://github.com/users/ofbz122/projects/980
https://github.com/users/zlri87gyr/projects/978
https://github.com/users/aopugfGY/projects/975
https://github.com/users/fnuh1891/projects/980
https://github.com/users/iuiz66DY/projects/981
https://github.com/users/ofbz122/projects/981
https://github.com/users/zlri87gyr/projects/979
https://github.com/users/aopugfGY/projects/976
https://github.com/users/fnuh1891/projects/981
https://github.com/users/ofbz122/projects/982
https://github.com/users/iuiz66DY/projects/982
https://github.com/users/aopugfGY/projects/977
https://github.com/users/zlri87gyr/projects/980
https://github.com/users/fnuh1891/projects/982
https://github.com/users/ofbz122/projects/983
https://github.com/users/aopugfGY/projects/978
https://github.com/users/iuiz66DY/projects/983
https://github.com/users/zlri87gyr/projects/981
https://github.com/users/iuiz66DY/projects/984
https://github.com/users/fnuh1891/projects/983
https://github.com/users/ofbz122/projects/984
https://github.com/users/aopugfGY/projects/979
https://github.com/users/zlri87gyr/projects/982
https://github.com/users/iuiz66DY/projects/985
https://github.com/users/zlri87gyr/projects/983
https://github.com/users/ofbz122/projects/985
https://github.com/users/fnuh1891/projects/984
https://github.com/users/aopugfGY/projects/980
https://github.com/users/iuiz66DY/projects/986
https://github.com/users/zlri87gyr/projects/984
https://github.com/users/ofbz122/projects/986
https://github.com/users/fnuh1891/projects/985
https://github.com/users/aopugfGY/projects/981
https://github.com/users/iuiz66DY/projects/987
https://github.com/users/ofbz122/projects/987
https://github.com/users/fnuh1891/projects/986
https://github.com/users/zlri87gyr/projects/985
https://github.com/users/aopugfGY/projects/982
https://github.com/users/iuiz66DY/projects/988
https://github.com/users/zlri87gyr/projects/986
https://github.com/users/ofbz122/projects/988
https://github.com/users/fnuh1891/projects/987
https://github.com/users/aopugfGY/projects/983
https://github.com/users/iuiz66DY/projects/989
https://github.com/users/ofbz122/projects/989
https://github.com/users/zlri87gyr/projects/987
https://github.com/users/fnuh1891/projects/988
https://github.com/users/aopugfGY/projects/984
https://github.com/users/iuiz66DY/projects/990
https://github.com/users/ofbz122/projects/990
https://github.com/users/zlri87gyr/projects/988
https://github.com/users/fnuh1891/projects/989
https://github.com/users/aopugfGY/projects/985
https://github.com/users/iuiz66DY/projects/991
https://github.com/users/ofbz122/projects/991
https://github.com/users/zlri87gyr/projects/989
https://github.com/users/fnuh1891/projects/990
https://github.com/users/aopugfGY/projects/986
https://github.com/users/iuiz66DY/projects/992
https://github.com/users/ofbz122/projects/992
https://github.com/users/zlri87gyr/projects/990
https://github.com/users/fnuh1891/projects/991
https://github.com/users/iuiz66DY/projects/993
https://github.com/users/aopugfGY/projects/987
https://github.com/users/zlri87gyr/projects/991
https://github.com/users/ofbz122/projects/993
https://github.com/users/fnuh1891/projects/992
https://github.com/users/zlri87gyr/projects/992
https://github.com/users/iuiz66DY/projects/994
https://github.com/users/aopugfGY/projects/988
https://github.com/users/ofbz122/projects/994
https://github.com/users/fnuh1891/projects/993
https://github.com/users/zlri87gyr/projects/993
https://github.com/users/iuiz66DY/projects/995
https://github.com/users/aopugfGY/projects/989
https://github.com/users/ofbz122/projects/995
https

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值