Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename operation name for activator's proxy span and queue-proxy's span #7934

Merged
merged 2 commits into from
May 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/queue/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func proxyHandler(reqChan chan network.ReqEvent, breaker *queue.Breaker, tracing
}

if tracingEnabled {
proxyCtx, proxySpan := trace.StartSpan(r.Context(), "proxy")
proxyCtx, proxySpan := trace.StartSpan(r.Context(), "queue_proxy")
r = r.WithContext(proxyCtx)
defer proxySpan.End()
}
Expand All @@ -149,7 +149,7 @@ func proxyHandler(reqChan chan network.ReqEvent, breaker *queue.Breaker, tracing
if breaker != nil {
var waitSpan *trace.Span
if tracingEnabled {
_, waitSpan = trace.StartSpan(r.Context(), "queueWait")
_, waitSpan = trace.StartSpan(r.Context(), "queue_wait")
}
if err := breaker.Maybe(r.Context(), func() {
waitSpan.End()
Expand Down
4 changes: 2 additions & 2 deletions cmd/queue/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,14 +474,14 @@ func TestQueueTraceSpans(t *testing.T) {
if len(gotSpans) != tc.wantSpans {
t.Errorf("Got %d spans, expected %d", len(gotSpans), tc.wantSpans)
}
spanNames := []string{"probe", "/", "proxy"}
spanNames := []string{"probe", "/", "queue_proxy"}
if !tc.probeTrace {
spanNames = spanNames[1:]
}
// We want to add `queueWait` span only if there is possible queueing
// and if the tests actually expects tracing.
if !tc.infiniteCC && tc.wantSpans > 1 {
spanNames = append([]string{"queueWait"}, spanNames...)
spanNames = append([]string{"queue_wait"}, spanNames...)
}
gs := []string{}
for i := 0; i < len(gotSpans); i++ {
Expand Down
2 changes: 1 addition & 1 deletion pkg/activator/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (a *activationHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {

proxyCtx, proxySpan := r.Context(), (*trace.Span)(nil)
if tracingEnabled {
proxyCtx, proxySpan = trace.StartSpan(r.Context(), "proxy")
proxyCtx, proxySpan = trace.StartSpan(r.Context(), "activator_proxy")
}
a.proxyRequest(logger, w, r.WithContext(proxyCtx), &url.URL{
Scheme: "http",
Expand Down
2 changes: 1 addition & 1 deletion pkg/activator/handler/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func TestActivationHandlerTraceSpans(t *testing.T) {
t.Errorf("Got %d spans, expected %d", len(gotSpans), tc.wantSpans)
}

spanNames := []string{"throttler_try", "/", "proxy"}
spanNames := []string{"throttler_try", "/", "activator_proxy"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we rename "throttler_try" to "activator_wait" while we're at it?

for i, spanName := range spanNames[0:tc.wantSpans] {
if gotSpans[i].Name != spanName {
t.Errorf("Got span %d named %q, expected %q", i, gotSpans[i].Name, spanName)
Expand Down