Giter Site home page Giter Site logo

prometheus-process-exporter's Introduction

Prometheus Process Exporter

TL;DR;

$ helm repo add prometheus-process-exporter-charts https://raw.githubusercontent.com/mumoshu/prometheus-process-exporter/master/docs
$ helm install --name process-exporter prometheus-process-exporter-charts/prometheus-process-exporter

Introduction

This chart bootstraps a prometheus process exporter daemonset on a Kubernetes cluster using the Helm package manager.

Installing the Chart

To install the chart with the release name my-release:

$ helm install --name process-exporter prometheus-process-exporter-charts/prometheus-process-exporter

The command deploys process exporter on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

Uninstalling the Chart

To uninstall/delete the my-release deployment:

$ helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following table lists the configurable parameters of the process exporter chart and their default values.

Parameter Description Default
image.repository Image repository ncabatoff/process-exporter
image.tag Image tag 0.5.0
image.pullPolicy Image pull policy IfNotPresent
groups Entries of process_names: in the process-expoter config {"groups": [{"comm": ["chronyd"]}, {"comm": ["bash"]}, {"comm": ["rsync"]}, {"comm": ["scp"]}, {"comm": ["ssh"]}]
extraArgs Additional container arguments []
extraHostVolumeMounts Additional host volume mounts {}
podLabels Additional labels to be added to pods {}
podAnnotations Additional annotations to be added to pods {}
rbac.create If true, create & use RBAC resources true
rbac.pspEnabled Specifies whether a PodSecurityPolicy should be created. true
hostNetwork Whether to enable hostNetwork on the DaemonSet false
resources CPU/Memory resource requests/limits {}
service.type Service type ClusterIP
service.port The service port 9100
service.targetPort The target port of the container 9100
service.nodePort The node port of the service
service.annotations Kubernetes service annotations {prometheus.io/scrape: "true"}
serviceAccount.create Specifies whether a service account should be created. true
serviceAccount.name Service account to be used. If not set and serviceAccount.create is true, a name is generated using the fullname template
serviceAccount.imagePullSecrets Specify image pull secrets []
serviceMonitor.enabled if true, creates a Prometheus Operator ServiceMonitor false
serviceMonitor.labels Set of labels to apply on ServiceMonitor {}
serviceMonitor.interval Set custom metric scraping interval ServiceMonitor, must be string 10s
serviceAccount.automountServiceAccountToken Specifies whether to automount API credentials for the ServiceAccount to the pods true
securityContext SecurityContext {"runAsNonRoot": true, "runAsUser": 65534}
affinity A group of affinity scheduling rules for pod assignment {}
nodeSelector Node labels for pod assignment {}
tolerations List of node taints to tolerate - effect: NoSchedule operator: Exists
priorityClassName Name of Priority Class to assign pods nil
endpoints list of addresses that have process exporter deployed outside of the cluster []
livenessProbe.initialDelaySeconds Amount of seconds to wait before the first probe 20
livenessProbe.periodSeconds Amount of seconds between the probes 10
livenessProbe.failureThreshold Amount of probe failures before the pod is restared 3
livenessProbe.successThreshold Amount of consecutive probe successes to mark the pod as healthy 1
readinessProbe.initialDelaySeconds Amount of seconds to wait before the first probe 20
readinessProbe.periodSeconds Amount of seconds between the probes 10
readinessProbe.failureThreshold Amount of probe failures before the pod is restared 3
readinessProbe.successThreshold Amount of consecutive probe successes to mark the pod as ready 1
updateStrategy Update strategy for the daemonset Rolling update with 1 max unavailable

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

$ helm install --name my-release \
  --set serviceAccount.name=process-exporter  \
    stable/prometheus-process-exporter

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

$ helm install --name my-release -f values.yaml stable/prometheus-process-exporter

Releasing a new version of this chart

$ git tag prometheus-process-exporter-${CHART_VERSION}
$ make upload
$ make index

prometheus-process-exporter's People

Contributors

daur88 avatar doris-zhou avatar jaspermarcus avatar lumi017 avatar mumoshu avatar naohiroo avatar nvtkaszpir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

prometheus-process-exporter's Issues

namedprocess_namegroup_open_filedesc is always zero

Hi,
the namedprocess_namegroup_open_filedesc always return 0 for all process when the process-exporter is deployed with the helm chart!
I have run the process-exporter binary and it is working ok but when we deploy it using helm chart it can't monitor open file descriptors.

Feature Request: Enable adding custom relabelings configs in service monitor definition

Hi @mumoshu, I have a situation where i needed to attach another label with the process-exporter metrics. Since the existing service-monitor definition does not expose a parameter to add custom relabelings config, i ended up adding a custom service monitor to my source code.

Here is a bitnami sample for adding custom relabelings config.

https://github.com/bitnami/charts/blob/dd62c04776102f90eb54a1f2cf1c901b03af6b3e/bitnami/node-exporter/templates/servicemonitor.yaml#L45C1-L46C1

securityContext value not implemented

You have the following values

securityContext:
  runAsNonRoot: true
  runAsUser: 65534

However they are not used anywhere in the chart. In the PSP you have

runAsUser:
    # Permits the container to run with root privileges as well.
    rule: 'RunAsAny'`
  supplementalGroups:
    rule: 'MustRunAs'
    ranges:
      # Forbid adding the root group.
      - min: 0
        max: 65535
  fsGroup:
    rule: 'MustRunAs'
    ranges:
      # Forbid adding the root group.
      - min: 0
        max: 65535

The logic wasn't implemented

Unable to run helm chart

getting Error: INSTALLATION FAILED: unable to build kubernetes objects from release manifest: [resource mapping not found for name: "psp-process-exporter-prometheus-process-exporter" namespace: "" from "": no matches for kind "ClusterRole" in version "rbac.authorization.k8s.io/v1beta1"
ensure CRDs are installed first, resource mapping not found for name: "psp-process-exporter-prometheus-process-exporter" namespace: "" from "": no matches for kind "ClusterRoleBinding" in version "rbac.authorization.k8s.io/v1beta1"
ensure CRDs are installed first]

please can some one help with it

pod labels

Hi @mumoshu, great work - Thanks!
Quick question - I couldn't manage to get the PodLabels working, when running the process exporter. I see the nodes, threads aso. but unfortunately, never the Pod names. Any hint or idea how to get that to work?

Thanks

why can't get metrics

---
# Source: prometheus-process-exporter/templates/psp.yaml
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
  labels:
    app: prometheus-process-exporter
  name: release-name-prometheus-process-exporter
spec:
  privileged: false
  volumes:
    - 'configMap'
    - 'emptyDir'
    - 'projected'
    - 'secret'
    - 'downwardAPI'
    - 'persistentVolumeClaim'
    - 'hostPath'
  hostNetwork: true
  hostIPC: false
  hostPID: true
  hostPorts:
    - min: 0
      max: 65535
  runAsUser:
    # Permits the container to run with root privileges as well.
    rule: 'RunAsAny'
  seLinux:
    # This policy assumes the nodes are using AppArmor rather than SELinux.
    rule: 'RunAsAny'
  supplementalGroups:
    rule: 'MustRunAs'
    ranges:
      # Forbid adding the root group.
      - min: 0
        max: 65535
  fsGroup:
    rule: 'MustRunAs'
    ranges:
      # Forbid adding the root group.
      - min: 0
        max: 65535
  readOnlyRootFilesystem: false
---
# Source: prometheus-process-exporter/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: release-name-prometheus-process-exporter
  labels:
    app: prometheus-process-exporter
automountServiceAccountToken: true
---
# Source: prometheus-process-exporter/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  namespace: alert
  name: release-name-prometheus-process-exporter
  labels:
    app: prometheus-process-exporter
data:
  config.yml: |-
    process_names:
      - name: "{{.Comm}}"
        cmdline:
        - '.+'
---
# Source: prometheus-process-exporter/templates/psp-clusterrole.yaml
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  labels:
    app: prometheus-process-exporter
  name: psp-release-name-prometheus-process-exporter
rules:
- apiGroups: ['extensions']
  resources: ['podsecuritypolicies']
  verbs:     ['use']
  resourceNames:
  - release-name-prometheus-process-exporter
---
# Source: prometheus-process-exporter/templates/psp-clusterrolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  labels:
    app: prometheus-process-exporter
  name: psp-release-name-prometheus-process-exporter
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: psp-release-name-prometheus-process-exporter
subjects:
  - kind: ServiceAccount
    name: release-name-prometheus-process-exporter
    namespace: alert
---
# Source: prometheus-process-exporter/templates/daemonset.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
  namespace: alert
  name: prometheus-process-exporter
  labels:
    app: prometheus-process-exporter
spec:
  selector:
    matchLabels:
      app: prometheus-process-exporter
  updateStrategy:
    rollingUpdate:
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: prometheus-process-exporter
    spec:
      serviceAccountName: release-name-prometheus-process-exporter
      securityContext:
        runAsNonRoot: true
        runAsUser: 65534
      containers:
        - name: prometheus-process-exporter
          image: xxx
          imagePullPolicy: IfNotPresent
          args:
            - --procfs=/host/proc
            - --config.path=/var/process-exporter/config.yml
            - --web.listen-address=0.0.0.0:9256
            - --debug=true
          ports:
            - containerPort: 9256
          resources:
            requests:
              cpu: 120m
              memory: 120Mi
          volumeMounts:
            - name: proc
              mountPath: /host/proc
              readOnly:  true
            - name: config
              mountPath: /var/process-exporter
      hostPID: true
      tolerations:
      - key: "node-role.kubernetes.io/master"
        operator: "Exists"
        effect: "NoSchedule"
      - effect: NoSchedule
        operator: Exists
      - effect: NoExecute
        operator: Exists
      volumes:
        - name: proc
          hostPath:
            path: /proc
        - name: config
          configMap:
            name: release-name-prometheus-process-exporter

image

I think the pod is running normally. Why can't I get metrics through K8s node ip: 9256/metrics?

image
I want to enter the container to check the problem, but an error is reported!

Update repository index to reflect the latest version 0.5.0

Currently, the latest Chart version according to repository index is 0.4.2 (prometheus-process-exporter/master/docs)

However, the directory prometheus-process-exporter/charts/prometheus-process-exporter/Chart.yaml has more recent version — 0.5.0

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.