Merge pull request #3174 from kit101/add-datadog-tag

Datadog add the tag of 'remote:gitee'
This commit is contained in:
TP Honey 2022-01-04 10:27:14 +00:00 committed by GitHub
commit 3398f2eb57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 0 deletions

View file

@ -489,6 +489,12 @@ func (c *Config) IsGitea() bool {
return c.Gitea.Server != ""
}
// IsGitee returns true if the Gitee integration
// is activated.
func (c *Config) IsGitee() bool {
return c.Gitee.ClientID != ""
}
// IsBitbucket returns true if the Bitbucket Cloud
// integration is activated.
func (c *Config) IsBitbucket() bool {

View file

@ -212,6 +212,7 @@ func provideDatadog(
EnableStash: config.IsStash(),
EnableGogs: config.IsGogs(),
EnableGitea: config.IsGitea(),
EnableGitee: config.IsGitee(),
EnableAgents: !config.Agent.Disabled,
},
)

View file

@ -29,5 +29,6 @@ type Config struct {
EnableStash bool
EnableGogs bool
EnableGitea bool
EnableGitee bool
EnableAgents bool
}

View file

@ -42,6 +42,8 @@ func createTags(config Config) []string {
tags = append(tags, "remote:gogs")
case config.EnableGitea:
tags = append(tags, "remote:gitea")
case config.EnableGitee:
tags = append(tags, "remote:gitee")
default:
tags = append(tags, "remote:undefined")
}