Sign inSign up

jikkendd/dd-dsd-python

By jikkendd

Updated about 5 years ago

Image
0

2.1K

jikkendd/dd-dsd-python repository overview

Continuously sends a gauge metric using the datadogpy library.

Configuration options
Env VarDefaultDescription
DD_AGENT_HOST127.0.0.1IP address to send metrics to
DD_DOGSTATSD_PORT8125Port to send metrics to
DSD_METRIC_VALUE2Value of custom metric
DSD_METRIC_NAMEdsd.pythonName of custom metric
DSD_SLEEP_TIME10Time (in seconds) to wait between sending metrics
DD_DOGSTATSD_SOCKET *nullPath to socket to be used for UDS (e.g. /var/run/datadog/dsd.socket)

* When set, this will override any UDP-specific settings. Be sure to also mount the directory containing the DSD socket in the app manifest.

Tagging options**
Env VarDefaultDescription
DATADOG_TAGSnullComma-separated string of tags to send with the metric (e.g. tag1:value1,tag2:value2)
DD_ENTITY_IDnullOnly available in k8s. Set to the pod UID using the downward API (see example manifest below)
DD_ENVnullString
DD_SERVICEnullString
DD_VERSIONnullString

** Metrics will always be tagged with dsd:python and datadogpy_version:<datadogpy_version>

Image tags

Image tags correspond to the datadogpy version the image was built with.

Note: latest is 0.39.0 and uses an older version of the app for no particular reason. As of {insert time here}, 0.42.0 hasn't been thoroughly tested, but it at least sends UDP metrics in a vanilla deployment ¯\(ツ)/¯.


Example deployment manifest:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: dsd-python
  labels:
    app: dsd-python
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: dsd-python
  template:
    metadata:
      labels:
        app: dsd-python
    spec:
      containers:
      - name: dsd-python
        imagePullPolicy: Always
        image: jikkendd/dd-dsd-python:latest
        # resources:
        #   requests:
        #     memory: "128Mi"
        #     cpu: "128m"
        #   limits:
        #     memory: "128Mi"
        #     cpu: "128m"
        env:
          # - name: DD_ENTITY_ID
          #   valueFrom:
          #     fieldRef:
          #       fieldPath: metadata.uid
          # - name: DD_AGENT_HOST
          #   valueFrom:
          #     fieldRef:
          #       apiVersion: v1
          #       fieldPath: status.hostIP
          # - name: DATADOG_TAGS
          #   value: "tag_1:test,tag_2:test,tag_3:test"
          - name: DSD_METRIC_NAME
            value: "test_metric"
          - name: DD_DOGSTATSD_SOCKET
            value: "/var/run/datadog/dsd.socket"
        volumeMounts:
          - name: dsdsocket
            mountPath: /var/run/datadog
            readOnly: true
      volumes:
        - hostPath:
            path: /var/run/datadog/
          name: dsdsocket

Tag summary

Content type

Image

Digest

Size

60.7 MB

Last updated

almost 6 years ago

docker pull jikkendd/dd-dsd-python