Skip to content

Commit

Permalink
internal/civisibility: specify if the user is setting the DD_SERVICE (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyredondo authored Nov 26, 2024
1 parent ee8eeef commit ba16c62
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
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

0 comments on commit ba16c62

Please sign in to comment.