Switch branches/tags
Find file History
olivielpeau [config] Support new 'site' option in Infra Agent (#2412)
Overriden by `dd_url` if latter is set. Should be fully backward
compatible.

Windows MSI: allow passing `SITE` option on the command line.

To encourage users not to use 'dd_url' anymore, and to use 'site'
instead, the legacy config importer now ignores dd_url if left to
default.

Also included, not directly required by the feature:
* Improve testability of `config` package:
  * avoid mutating global Datadog config from arbitrary functions  
  * always pass a Config to all these functions
* [flare] Fix domain used to send flares:
  We should use a versioned domain. This was broken since 6.5.0 and
  ec90952. It didn't prevent
  flares from being sent though.
* [config] Remove unused test fixtures
* [Dockerfiles] Remove explicit setting of DD_DD_URL in entrypoints:
  `dd_url` is an optional setting in Agent 6, no need to always set it
  (and it's actually counter-productive now that we offer the `site`
  option)
Latest commit 020e0e8 Oct 11, 2018

README.md

DogStatsD6 docker image

This docker image runs dogstatsd as a standalone container. It can be used in cases a full-fledged agent6 is not needed on the node, or as a sidecar container inside pods. It supports both the UDP protocol (default) or Unix Domain Socket (if DD_DOGSTATSD_SOCKET is set to a valid path). To know more about each protocol, see the dogstatsd readme.

How to run it

The following environment variables are supported:

  • DD_API_KEY: your API key (required)
  • DD_HOSTNAME: hostname to use for metrics
  • DD_DOGSTATSD_SOCKET: path to the unix socket to use instead of UDP. Must be in a rw mounted volume.
  • DD_ENABLE_METADATA_COLLECTION: whether to collect metadata (default is true, set to false only if running alonside an existing dd-agent)

This is a sample Kubernetes DaemonSet, using the UDS protocol, running alongside an existing agent5:

apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: dogstatsd
spec:
  template:
    metadata:
      labels:
        app: dogstatsd
      name: dogstatsd
    spec:
      containers:
      - image: datadog/dogstatsd:latest
        imagePullPolicy: Always
        name: dogstatsd
        env:
          - name: DD_API_KEY
            value: ___value___
          - name: DD_DOGSTATSD_SOCKET
            value: "/socket/statsd.socket"
          - name: DD_SEND_HOST_METADATA
            # Legacy option name, keep as `false` when running alongside another Agent 
            value: "false"
          - name: DD_ENABLE_METADATA_COLLECTION
            value: "false"
          - name: DD_HOSTNAME
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
        volumeMounts:
          - name: dsdsocket
            mountPath: /socket
      volumes:
        - hostPath:
            path: /var/run/dogstatsd
          name: dsdsocket

If you want to use the UDP protocol on port 8125, running alongside an existing agent5:

apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: dogstatsd
spec:
  template:
    metadata:
      labels:
        app: dogstatsd
      name: dogstatsd
    spec:
      containers:
      - image: datadog/dogstatsd:latest
        imagePullPolicy: Always
        name: dogstatsd
        ports:
          - containerPort: 8125
            name: dogstatsdport
            protocol: UDP
        env:
          - name: DD_API_KEY
            value: ___value___
          - name: DD_SEND_HOST_METADATA
            # Legacy option name, keep as `false` when running alongside another Agent 
            value: "false"
          - name: DD_ENABLE_METADATA_COLLECTION
            value: "false"
          - name: DD_HOSTNAME
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName

How to build it

You can use inv dogstatsd.image-build to build your own dogstatsd image