【问题标题】:How do I get the operation name from an opentracingsSpan?如何从 opentracingsSpan 获取操作名称?
【发布时间】:2021-07-30 16:34:09
【问题描述】:

我正在使用 Go,但我不知道这个问题是否适用于 opentracing。

span, ctx := opentracing.StartSpanFromContext(ctx, "the_name")

然后,仅给定 span 变量,我如何检索 operationName “the_name”?有 SetOperationName() 方法,但没有 GetOperationName()。

【问题讨论】:

标签: go opentracing


【解决方案1】:

我搜索了图书馆,似乎没有一种方法可以满足您的需求。另一种方法可能是创建一个 hashmap,其中 span 作为键,名称作为结果。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-01-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多