From e44aae58b4f2bb86941c3fd8f0a72b302d23b01e Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Tue, 4 May 2021 19:11:57 -0400 Subject: [PATCH] metrics sink update --- cmd/drone-server/inject_service.go | 1 + metric/sink/config.go | 2 ++ metric/sink/tags.go | 9 +++++++++ 3 files changed, 12 insertions(+) diff --git a/cmd/drone-server/inject_service.go b/cmd/drone-server/inject_service.go index ceb47cd8..2fd13de3 100644 --- a/cmd/drone-server/inject_service.go +++ b/cmd/drone-server/inject_service.go @@ -211,6 +211,7 @@ func provideDatadog( sink.Config{ Endpoint: config.Datadog.Endpoint, Token: config.Datadog.Token, + Contact2: config.Server.Email, License: license.Kind, Licensor: license.Licensor, Subscription: license.Subscription, diff --git a/metric/sink/config.go b/metric/sink/config.go index 9dcac6ca..63be195c 100644 --- a/metric/sink/config.go +++ b/metric/sink/config.go @@ -19,6 +19,8 @@ type Config struct { Endpoint string Token string + Contact1 string + Contact2 string License string Licensor string Subscription string diff --git a/metric/sink/tags.go b/metric/sink/tags.go index 44011155..b289b87b 100644 --- a/metric/sink/tags.go +++ b/metric/sink/tags.go @@ -68,5 +68,14 @@ func createTags(config Config) []string { tag := fmt.Sprintf("license:%s", config.License) tags = append(tags, tag) } + + if config.Contact1 != "" { + tag := fmt.Sprintf("contact1:%s", config.Contact1) + tags = append(tags, tag) + } + if config.Contact2 != "" { + tag := fmt.Sprintf("contact2:%s", config.Contact2) + tags = append(tags, tag) + } return tags }