Skip to content

Commit

Permalink
Supporting perf events with opentracing
Browse files Browse the repository at this point in the history
Perf events can provide additional insights into what's happening within
a span. Although, latency of a span can help us in identifying the
bottle necks within a trace, perf events can compliment that in
identifying as to where was the bottle neck and which platform resource
was busy for that span. This patch is in addition to the perf events
support to zipkin-go-opentracing.

Signed-off-by: Hemant Kumar <hemant@linux.vnet.ibm.com>
  • Loading branch information
hkshaw1990 committed Jan 30, 2017
1 parent 5e5abf8 commit 9391ff1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ type StartSpanOptions struct {
// If specified, the caller hands off ownership of Tags at
// StartSpan() invocation time.
Tags map[string]interface{}

// Perfevent is the platform metric's name or an event name supported
// by perf.
Perfevent string
}

// StartSpanOption instances (zero or more) may be passed to Tracer.StartSpan.
Expand Down Expand Up @@ -262,6 +266,14 @@ func (t StartTime) Apply(o *StartSpanOptions) {
o.StartTime = time.Time(t)
}

// PerfString is the perf event's name.
type PerfString string

// Apply satisfies the StartSpanOption interface
func (e PerfString) Apply(o *StartSpanOptions) {
o.Perfevent = string(e)
}

// Tags are a generic map from an arbitrary string key to an opaque value type.
// The underlying tracing system is responsible for interpreting and
// serializing the values.
Expand Down

0 comments on commit 9391ff1

Please sign in to comment.