squeakywheel/telegraf

By squeakywheel

Updated over 4 years ago

Image

1.4K

Telegraf | Ubuntu

About Telegraf

Telegraf is an agent for collecting, processing, aggregating, and writing metrics. Design goals are to have a minimal memory footprint with a plugin system so that developers in the community can easily add support for collecting metrics. Read more on the Telegraf website.

Tags

  • 1.15.2-focal, 1.15.2, 1.15-focal, 1.15, 1-focal, 1, focal, beta - /!\ this is a beta release

Architectures supported

  • amd64, arm64, ppc64el, s390x

Usage

Docker CLI
$ docker run -d --name telegraf -p 30273:9273 -e TZ=UTC squeakywheel/telegraf:edge

Access your Telegraf instance at localhost:30273.

Parameters

ParameterDescription
-e TZ=UTCTimezone.
-p 30273:9273Expose Telegraf on localhost:30273.
-v /my/local/telegraf.conf:/etc/telegraf/telegraf.confMount local configuration file telegraf.conf (download this example file).

Testing/Debugging

In case you need to debug what it is happening with the container you can run docker logs <name_of_the_container>. But if you want to get access to an interactive shell run:

$ docker exec -it <name_of_the_container> /bin/bash
Deploy with Kubernetes

You can use your favorite Kubernetes distribution; if you don't have one, consider installing MicroK8s.

With microk8s running, enable the dns and storage add-ons:

$ microk8s enable dns storage
$ microk8s kubectl create configmap telegraf-config --from-file=main-config=config/telegraf.conf

Use the sample deployment yaml provided here.

Apply the `telegraf-deployment.yml` (click to expand)
# telegraf-deployment.yml
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: telegraf-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: telegraf
  template:
    metadata:
      labels:
        app: telegraf
    spec:
      containers:
      - name: telegraf
        image: squeakywheel/telegraf:edge
        ports:
        - containerPort: 9273
          name: telegraf
          protocol: TCP
        volumeMounts:
        - name: telegraf-config-volume
          mountPath: /etc/telegraf/telegraf.conf
          subPath: telegraf.conf
      volumes:
        - name: telegraf-config-volume
          configMap:
            name: main-config
            items:
            - key: telegraf
              path: telegraf.conf
---
apiVersion: v1
kind: Service
metadata:
  name: telegraf-service
spec:
  type: NodePort
  selector:
    app: telegraf
  ports:
  - protocol: TCP
    port: 9273
    targetPort: 9273
    nodePort: 30273
    name: telegraf

$ microk8s kubectl apply -f telegraf-deployment.yml

Bugs and Features request

If you find a bug in our image or want to request a specific feature file a bug here:

https://bugs.launchpad.net/ubuntu-docker-images/+filebug

In the title of the bug add telegraf: <reason>.

Make sure to include:

  • The digest of the image you are using, you can find it using this command replacing <tag> with the one you used to run the image:
$ docker images --no-trunc --quiet squeakywheel/telegraf:<tag>
  • Reproduction steps for the deployment
  • If it is a feature request, please provide as much detail as possible

Docker Pull Command

docker pull squeakywheel/telegraf