This repository has been archived by the owner. It is now read-only.

Add a dogstatsd metric emitter #269

Merged
merged 3 commits into from Apr 26, 2018

Conversation

Projects
None yet
4 participants
@baptiste-bonnaudet
Contributor

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

@baptiste-bonnaudet baptiste-bonnaudet force-pushed the baptiste-bonnaudet:master branch from 1588f54 to 9bad856 Apr 20, 2018

Add dogstatsd emitter
Signed-off-by: baptiste-bonnaudet <baptiste.bonnaudet@lightspeedhq.com>

@baptiste-bonnaudet baptiste-bonnaudet force-pushed the baptiste-bonnaudet:master branch from 9bad856 to e3466af Apr 21, 2018

@vito

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_]+")

This comment has been minimized.

@vito

vito Apr 22, 2018

Member

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)

This comment has been minimized.

@vito

vito Apr 22, 2018

Member

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,
})
small corrections to dogstatsd Emitter
Signed-off-by: baptiste-bonnaudet <baptiste.bonnaudet@lightspeedhq.com>
@baptiste-bonnaudet

This comment has been minimized.

Contributor

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 concourse:master Apr 26, 2018

2 checks passed

ci/pivotal-cla Thank you for signing the Contributor License Agreement!
Details
concourse-ci/status Concourse CI build success
Details

@jama-pivotal jama-pivotal 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

[stable/concourse] Add optional datadog metrics config
Concourse 3.13.0 adds support for exporting metrics to Datadog (see
concourse/atc#269). This adds support for the
new flags, and bumps the Concourse version.

wendorf added a commit to opendoor-labs/charts that referenced this pull request May 24, 2018

[stable/concourse] Add optional datadog metrics config
Concourse 3.13.0 adds support for exporting metrics to Datadog (see
concourse/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 added a commit to helm/charts that referenced this pull request May 30, 2018

[stable/concourse] Add optional datadog metrics config (#5650)
Concourse 3.13.0 adds support for exporting metrics to Datadog (see
concourse/atc#269). This adds support for the
new flags, and bumps the Concourse version.

or1can added a commit to or1can/charts that referenced this pull request Jul 10, 2018

[stable/concourse] Add optional datadog metrics config (helm#5650)
Concourse 3.13.0 adds support for exporting metrics to Datadog (see
concourse/atc#269). This adds support for the
new flags, and bumps the Concourse version.

voron added a commit to arilot/charts that referenced this pull request Sep 5, 2018

[stable/concourse] Add optional datadog metrics config (helm#5650)
Concourse 3.13.0 adds support for exporting metrics to Datadog (see
concourse/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.