Datadog add the tag of 'remote:gitee'

This commit is contained in:
kit101 2021-12-27 08:44:19 +08:00
parent f51eb4ed22
commit fab2899a2b
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")
}