-
Notifications
You must be signed in to change notification settings - Fork 388
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Batch traces by env instead of tags (#296)
- Loading branch information
Showing
9 changed files
with
147 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
target: | ||
go build -o bin/trace-intake.so -buildmode=c-shared cmd/trace/main.go | ||
go build -o bin/trace-intake.so -gcflags="-e" -buildmode=c-shared cmd/trace/main.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
aws/logs_monitoring/trace_forwarder/cmd/trace/main_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Unless explicitly stated otherwise all files in this repository are licensed | ||
* under the Apache License Version 2.0. | ||
* | ||
* This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
* Copyright 2020 Datadog, Inc. | ||
*/ | ||
package main | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/DataDog/datadog-agent/pkg/trace/pb" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestUnmarshalSerializedTraces(t *testing.T) { | ||
input := "[{\"message\":\"traces\",\"tags\":\"tag1:value\"},{\"message\":\"traces\",\"tags\":\"tag1:value\"}]" | ||
|
||
output, _ := unmarshalSerializedTraces(input) | ||
|
||
assert.Equal(t, output[0].Message, "traces") | ||
assert.Equal(t, output[0].Tags, "tag1:value") | ||
assert.Equal(t, output[1].Message, "traces") | ||
assert.Equal(t, output[1].Tags, "tag1:value") | ||
} | ||
|
||
func TestAggregateTracePayloadsByEnv(t *testing.T) { | ||
payload1 := pb.TracePayload{ | ||
HostName: "Host", | ||
Env: "Env1", | ||
Traces: make([]*pb.APITrace, 0), | ||
} | ||
|
||
payload2 := pb.TracePayload{ | ||
HostName: "Host", | ||
Env: "Env1", | ||
Traces: make([]*pb.APITrace, 0), | ||
} | ||
|
||
payload3 := pb.TracePayload{ | ||
HostName: "Host", | ||
Env: "Env2", | ||
Traces: make([]*pb.APITrace, 0), | ||
} | ||
|
||
input := []*pb.TracePayload{&payload1, &payload2, &payload3} | ||
output := aggregateTracePayloadsByEnv(input) | ||
assert.Equal(t, len(output), 2) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters