Skip to content

Commit

Permalink
[Bug Fix] fix backward compatibility issue in remote tagger dca server (
Browse files Browse the repository at this point in the history
  • Loading branch information
adel121 authored Dec 3, 2024
1 parent daeb6ba commit 1c2acb4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion comp/core/tagger/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

"github.com/google/uuid"

tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def"
"github.com/DataDog/datadog-agent/comp/core/tagger/proto"
"github.com/DataDog/datadog-agent/comp/core/tagger/types"
Expand Down Expand Up @@ -57,7 +59,15 @@ func (s *Server) TaggerStreamEntities(in *pb.StreamTagsRequest, out pb.AgentSecu

filter := filterBuilder.Build(cardinality)

subscriptionID := fmt.Sprintf("streaming-client-%s", in.GetStreamingID())
streamingID := in.GetStreamingID()
if streamingID == "" {
// this is done to preserve backward compatibility
// if CLC runner is using an old version, the streaming ID would be an empty string,
// and the server needs to auto-assign a unique id
streamingID = uuid.New().String()
}

subscriptionID := fmt.Sprintf("streaming-client-%s", streamingID)
subscription, err := s.taggerComponent.Subscribe(subscriptionID, filter)
if err != nil {
return err
Expand Down

0 comments on commit 1c2acb4

Please sign in to comment.