Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal/civisibility: specify if the user is setting the DD_SERVICE #2988

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions internal/civisibility/constants/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ const (
// ItrCorrelationIDTag defines the correlation ID for the intelligent test runner tag for the CI Visibility Protocol.
// This constant is used to tag traces with the correlation ID for intelligent test runs.
ItrCorrelationIDTag string = "itr_correlation_id"

// UserProvidedTestServiceTag defines if the user provided the test service.
UserProvidedTestServiceTag string = "_dd.test.is_user_provided_service"
)

// Coverage tags
Expand Down
7 changes: 7 additions & 0 deletions internal/civisibility/utils/environmentTags.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ func createCITagsMap() map[string]string {
}
log.Debug("civisibility: test session name: %v", localTags[constants.TestSessionName])

// Check if the user provided the test service
if ddService := os.Getenv("DD_SERVICE"); ddService != "" {
localTags[constants.UserProvidedTestServiceTag] = "true"
} else {
localTags[constants.UserProvidedTestServiceTag] = "false"
}

// Populate missing git data
gitData, _ := getLocalGitData()

Expand Down
Loading