Navigation Menu

Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

Add a dogstatsd metric emitter #269

Merged
merged 3 commits into from Apr 26, 2018

Conversation

baptiste-bonnaudet
Copy link
Contributor

@baptiste-bonnaudet baptiste-bonnaudet commented Apr 20, 2018

Allows direct integration with Datadog using statsd agent.

  • I used the influxDb emitter as an example.
  • The event hostname, state and attributes are set as Datadog tags.

Adds new configuration flags for atc:

--datadog-agent-host 127.0.0.1 
--datadog-agent-port 8125 
--datadog-prefix concoursedev

Signed-off-by: baptiste-bonnaudet <baptiste.bonnaudet@lightspeedhq.com>
Copy link
Contributor

@vito vito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting this! Looks good, just left a couple comments for some minor things I noticed.


func (emitter *DogstatsdEmitter) Emit(logger lager.Logger, event metric.Event) {

reg, _ := regexp.Compile("[^a-zA-Z0-9_]+")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be better to do this outside of Emit so it's only compiled once. You could use regexp.MustCompile too.

Something like:

var specialChars = regexp.MustCompile(...)

func (emitter *DogstatsdEmitter) Emit(logger lager.Logger, event metric.Event) {

} else if f, ok := event.Value.(float64); ok {
value = f
} else {
logger.Error(fmt.Sprintf("failed-to-convert-metric-for-dogstatsd: %s", name), nil)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than a format string, lager.Data should be used here:

logger.Error("failed-to-convert-metric-for-dogstatsd", nil, lager.Data{
  "metric-name": name,
})

Signed-off-by: baptiste-bonnaudet <baptiste.bonnaudet@lightspeedhq.com>
@baptiste-bonnaudet
Copy link
Contributor Author

baptiste-bonnaudet commented Apr 23, 2018

@vito, thanks for the review! I fixed the requested changes and created the PR for the documentation concourse/docs#54

@mhuangpivotal mhuangpivotal merged commit 8ca07c1 into vmware-archive:master Apr 26, 2018
@jama22 jama22 added this to the v3.13.0 milestone Apr 30, 2018
wendorf added a commit to wendorf/charts that referenced this pull request May 24, 2018
Concourse 3.13.0 adds support for exporting metrics to Datadog (see
vmware-archive/atc#269). This adds support for the
new flags, and bumps the Concourse version.
wendorf pushed a commit to opendoor-labs/charts that referenced this pull request May 24, 2018
Concourse 3.13.0 adds support for exporting metrics to Datadog (see
vmware-archive/atc#269). This adds support for the new flags, and bumps the
Concourse version.

NOTE: This is a modification to helm#5650 and should be
removed when that is merged. Usage of this fork will also need to be
updated to match the changed key names.
k8s-ci-robot pushed a commit to helm/charts that referenced this pull request May 30, 2018
Concourse 3.13.0 adds support for exporting metrics to Datadog (see
vmware-archive/atc#269). This adds support for the
new flags, and bumps the Concourse version.
or1can pushed a commit to or1can/charts that referenced this pull request Jul 10, 2018
Concourse 3.13.0 adds support for exporting metrics to Datadog (see
vmware-archive/atc#269). This adds support for the
new flags, and bumps the Concourse version.
voron pushed a commit to dysnix/helm-charts that referenced this pull request Sep 5, 2018
Concourse 3.13.0 adds support for exporting metrics to Datadog (see
vmware-archive/atc#269). This adds support for the
new flags, and bumps the Concourse version.

Signed-off-by: voron <av@arilot.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants