Skip to content

Commit

Permalink
Add unit test for parsing collector UserAgent string
Browse files Browse the repository at this point in the history
  • Loading branch information
pchila committed Aug 12, 2024
1 parent 6ac23c0 commit 7538cf0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/ottl/ottlfuncs/func_useragent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ func TestUserAgentParser(t *testing.T) {
semconv.AttributeUserAgentVersion: "",
},
},
{
Name: "Otel collector 0.106.1 linux/amd64 user agent",
UAString: "OpenTelemetry Collector Contrib/0.106.1 (linux/amd64)",
ExpectedMap: map[string]any{
semconv.AttributeUserAgentOriginal: "OpenTelemetry Collector Contrib/0.106.1 (linux/amd64)",
semconv.AttributeUserAgentName: "Other",
semconv.AttributeUserAgentVersion: "",
},
},
}

for _, tt := range testCases {
Expand Down

0 comments on commit 7538cf0

Please sign in to comment.