本文整理汇总了TypeScript中dd-trace.use函数的典型用法代码示例。如果您正苦于以下问题:TypeScript use函数的具体用法?TypeScript use怎么用?TypeScript use使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了use函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: init
export function init() {
const ddServicePrefix = "positron"
tracer.init({
// Setting the service name to `.undetected` so that we detect services that
// are running as part of the application, but aren't explicitly configured
// with `tracer.use`. We want to to explicitly configure services so that we
// can enforce our `.`-deliminited Service naming convention.
service: `${ddServicePrefix}.undetected`,
hostname: process.env.DATADOG_AGENT_HOSTNAME,
})
tracer.use("express", {
service: `${ddServicePrefix}`,
})
tracer.use("mongodb-core", {
service: `${ddServicePrefix}.mongodb`,
})
tracer.use("elasticsearch", {
service: `${ddServicePrefix}.elasticsearch`,
})
tracer.use("http", {
service: `${ddServicePrefix}.http`,
})
}
开发者ID:artsy,项目名称:positron,代码行数:28,代码来源:tracer.ts
示例2: useWebFrameworkPlugin
function useWebFrameworkPlugin(plugin: "express" | "hapi" | "koa" | "restify") {
tracer.use(plugin, {
service: "incoming-request",
headers: ["User-Agent"],
validateStatus: code => code !== 418,
});
}
开发者ID:Jeremy-F,项目名称:DefinitelyTyped,代码行数:7,代码来源:dd-trace-tests.ts
示例3:
import ddTracer from "dd-trace"
if (process.env.DD_APM_ENABLED) {
ddTracer.init({
hostname: process.env.DD_TRACE_AGENT_HOSTNAME,
service: "force",
plugins: false,
})
ddTracer.use("express", {
// We want the root spans of MP to be labelled as just `service`
service: "force",
headers: ["User-Agent"],
})
ddTracer.use("http", {
service: `force.http-client`,
})
}
开发者ID:artsy,项目名称:force-public,代码行数:17,代码来源:datadog.ts
注:本文中的dd-trace.use函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论