Skip to content

Commit

Permalink
Kafka server spans shouldn't be producers and consumers (#1452)
Browse files Browse the repository at this point in the history
  • Loading branch information
grcevski authored Dec 12, 2024
1 parent e05d16c commit d4d8ecf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ compile-cache:
@echo "### Compiling Beyla K8s cache"
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build -mod vendor -ldflags="-X '$(BUILDINFO_PKG).Version=$(RELEASE_VERSION)' -X '$(BUILDINFO_PKG).Revision=$(RELEASE_REVISION)'" -a -o bin/$(CACHE_CMD) $(CACHE_MAIN_GO_FILE)

.PHONY: debug
debug:
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build -mod vendor -gcflags "-N -l" -ldflags="-X '$(BUILDINFO_PKG).Version=$(RELEASE_VERSION)' -X '$(BUILDINFO_PKG).Revision=$(RELEASE_REVISION)'" -a -o bin/$(CMD) $(MAIN_GO_FILE)

.PHONY: dev
dev: prereqs generate compile-for-coverage
Expand Down
4 changes: 2 additions & 2 deletions pkg/export/otel/traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,11 +672,11 @@ func traceAttributes(span *request.Span, optionalAttrs map[attr.Name]struct{}) [

func spanKind(span *request.Span) trace2.SpanKind {
switch span.Type {
case request.EventTypeHTTP, request.EventTypeGRPC, request.EventTypeRedisServer:
case request.EventTypeHTTP, request.EventTypeGRPC, request.EventTypeRedisServer, request.EventTypeKafkaServer:
return trace2.SpanKindServer
case request.EventTypeHTTPClient, request.EventTypeGRPCClient, request.EventTypeSQLClient, request.EventTypeRedisClient:
return trace2.SpanKindClient
case request.EventTypeKafkaClient, request.EventTypeKafkaServer:
case request.EventTypeKafkaClient:
switch span.Method {
case request.MessagingPublish:
return trace2.SpanKindProducer
Expand Down

0 comments on commit d4d8ecf

Please sign in to comment.