【问题标题】:Splunk custom RUM data with angularjsSplunk 使用 angularjs 自定义 RUM 数据
【发布时间】:2021-07-09 06:00:05
【问题描述】:

我正在尝试将自定义 RUM 数据发送到 Splunk。我指的是ManualInstrumentation。由于我在 Angularjs 中有前端,因此无法从 opentelemetry/api 导入 traceopentelemetry/api 是否有任何 .js 文件,例如 splunk-otel-web.js,以便我可以直接使用 trace

【问题讨论】:

  • 只是好奇,为什么导入跟踪不起作用?
  • @JerryJeremiah 我无法导入trace,因为我在Angularjs-v1.2.20 中有一个前端并且没有node_modules,所有必需的js 库都在vendor 中导入webapp 文件夹下的文件夹。

标签: angularjs splunk open-telemetry


【解决方案1】:

问题已解决...我不必使用opentelemetry/api,因为我可以使用以下代码语法从splunk-otel-web.js 获取tracer

const span = SplunkRum.provider.getTracer('searchbox').startSpan('search');
span.setAttribute('searchLength', searchString.length);
// time passes
span.end();

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-09
    相关资源
    最近更新 更多