Skip to content

Commit

Permalink
[Backport 7.61.x] [Bug Fix] fix backward compatibility issue in remot…
Browse files Browse the repository at this point in the history
…e tagger dca server (#31726)

Co-authored-by: adel121 <[email protected]>
  • Loading branch information
agent-platform-auto-pr[bot] and adel121 authored Dec 24, 2024
1 parent 3de4be2 commit a4cad4d
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 a4cad4d

Please sign in to comment.