Skip to content

general tracing support #15784

Closed
Closed

Description

@wbpcode

Title: general tracing support

Description:

Envoy provides powerful tracing capabilities. However, it is currently only available for the HTTP protocol. Because Tracer uses Http::RequestHeaderMap to pass the tracing context of the request.
While other protocols can implement an Http::RequestHeaderMap to directly reuse the existing Tracer, this requires a significant amount of work.
But if a simpler abstraction can be provided, then other protocols can more easily integrate the tracer into it.
For example, simply implementing the following method:

class TraceableStream {
    virtual void setContext(const std::string_view key, const std::string_view value) PURE;
    virtual std::optional<std::string_view> getContext(const std::string_view key) const PURE;
};

And then create tracing span from it:

  /**
   * Start driver specific span.
   */
  virtual SpanPtr startSpan(const Config& config, TraceableStream& stream,
                            const std::string& operation_name, SystemTime start_time,
                            const Tracing::Decision tracing_decision) PURE;

[optional Relevant Links:]

Any extra documentation required to understand the issue.

Activity

  1. added
    enhancement
    triage
    on Mar 31, 2021
  2. mattklein123 commented on Mar 31, 2021

    @mattklein123
    Member

    Yeah this is something I would love to clean up. Would definitely appreciate cleanup work here to make this code all generic.

  3. added
    help wanted
    and removed
    enhancement
    triage
    on Mar 31, 2021
  4. wbpcode commented on Apr 1, 2021

    @wbpcode
    MemberAuthor

    I can try to figure it out. Because I just want to enhance the tracing of the dubbo protocol. General tracing support is a very important pre-work. 🤔 @mattklein123

  5. wbpcode commented on Sep 3, 2021

    @wbpcode
    MemberAuthor

    This is ok now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions