Skip to content
This repository has been archived by the owner on Jun 19, 2022. It is now read-only.

Commit

Permalink
Eliminate creating a new broker ingress span and add broker ingress a…
Browse files Browse the repository at this point in the history
…ttributes to the existing http span (#1585)

* Eliminate broker ingress span

* Set broker ingress span name

* Fix TestGCPBrokerTracing integration test
  • Loading branch information
bharattkukreja authored Aug 19, 2020
1 parent 9ca7d11 commit 9e13549
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/broker/ingress/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ func (h *Handler) ServeHTTP(response nethttp.ResponseWriter, request *nethttp.Re

event.SetExtension(EventArrivalTime, cev2.Timestamp{Time: time.Now()})

ctx, span := trace.StartSpan(ctx, kntracing.BrokerMessagingDestination(broker))
defer span.End()
span := trace.FromContext(ctx)
span.SetName(kntracing.BrokerMessagingDestination(broker))
if span.IsRecordingEvents() {
span.AddAttributes(
append(
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/lib/helpers/broker_tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,9 @@ func BrokerTestTree(namespace string, brokerName string, trigger string, respTri

func ingressSpan(namespace string, broker string) *SpanMatcher {
brokerName := fmt.Sprintf("broker:%s.%s", broker, namespace)
spanName := fmt.Sprintf("Recv.%s", brokerName)
return &SpanMatcher{
Name: brokerName,
Name: spanName,
Labels: map[string]string{
"messaging.system": "knative",
"messaging.destination": brokerName,
Expand Down

0 comments on commit 9e13549

Please sign in to comment.