diff --git a/charts/stable/prometheus-nut-exporter/Chart.yaml b/charts/stable/prometheus-nut-exporter/Chart.yaml index 152d1a40..42990247 100644 --- a/charts/stable/prometheus-nut-exporter/Chart.yaml +++ b/charts/stable/prometheus-nut-exporter/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: 1.1.1 description: Prometheus NUT Exporter a service monitor to send NUT server metrics to a Prometheus instance. name: prometheus-nut-exporter -version: 4.0.0 +version: 4.1.0 kubeVersion: ">=1.16.0-0" keywords: - nut diff --git a/charts/stable/prometheus-nut-exporter/README.md b/charts/stable/prometheus-nut-exporter/README.md index 67664c4a..14443ef7 100644 --- a/charts/stable/prometheus-nut-exporter/README.md +++ b/charts/stable/prometheus-nut-exporter/README.md @@ -1,6 +1,6 @@ # prometheus-nut-exporter -![Version: 4.0.0](https://img.shields.io/badge/Version-4.0.0-informational?style=flat-square) ![AppVersion: 1.1.1](https://img.shields.io/badge/AppVersion-1.1.1-informational?style=flat-square) +![Version: 4.1.0](https://img.shields.io/badge/Version-4.1.0-informational?style=flat-square) ![AppVersion: 1.1.1](https://img.shields.io/badge/AppVersion-1.1.1-informational?style=flat-square) Prometheus NUT Exporter a service monitor to send NUT server metrics to a Prometheus instance. @@ -76,6 +76,7 @@ N/A | Key | Type | Default | Description | |-----|------|---------|-------------| | env | object | See below | environment variables. See [application docs](https://github.com/HON95/prometheus-nut-exporter#environment-variables) for more details. | +| env.RUST_LOG | string | `"info"` | log level [info|debug|trace] | | env.TZ | string | `"UTC"` | Set the container timezone | | image.pullPolicy | string | `"IfNotPresent"` | image pull policy | | image.repository | string | `"hon95/prometheus-nut-exporter"` | image repository | diff --git a/charts/stable/prometheus-nut-exporter/templates/common.yaml b/charts/stable/prometheus-nut-exporter/templates/common.yaml index a6613c2c..aa3329a7 100644 --- a/charts/stable/prometheus-nut-exporter/templates/common.yaml +++ b/charts/stable/prometheus-nut-exporter/templates/common.yaml @@ -1 +1,13 @@ +{{/* Make sure all variables are set properly */}} +{{- include "common.values.setup" . }} + +{{/* Append the hardcoded settings */}} +{{- define "prometheus-nut-exporter.harcodedValues" -}} +env: + HTTP_PATH: "/metrics" + HTTP_PORT: "{{ .Values.service.main.ports.metrics.port }}" +{{- end -}} +{{- $_ := mergeOverwrite .Values (include "prometheus-nut-exporter.harcodedValues" . | fromYaml) -}} + +{{/* Render the templates */}} {{ include "common.all" . }} diff --git a/charts/stable/prometheus-nut-exporter/templates/servicemonitor.yaml b/charts/stable/prometheus-nut-exporter/templates/servicemonitor.yaml index ac499bf4..bb537398 100644 --- a/charts/stable/prometheus-nut-exporter/templates/servicemonitor.yaml +++ b/charts/stable/prometheus-nut-exporter/templates/servicemonitor.yaml @@ -14,10 +14,10 @@ spec: {{- include "common.labels.selectorLabels" . | nindent 6 }} endpoints: {{- range .Values.prometheus.serviceMonitor.targets }} - - port: http + - port: metrics interval: {{ .interval }} scrapeTimeout: {{ .scrapeTimeout }} - path: /nut + path: /metrics params: target: - "{{ .hostname }}:{{ .port }}" diff --git a/charts/stable/prometheus-nut-exporter/values.yaml b/charts/stable/prometheus-nut-exporter/values.yaml index 046bb205..e5763ed1 100644 --- a/charts/stable/prometheus-nut-exporter/values.yaml +++ b/charts/stable/prometheus-nut-exporter/values.yaml @@ -18,6 +18,8 @@ image: env: # -- Set the container timezone TZ: UTC + # -- log level [info|debug|trace] + RUST_LOG: info # -- Configures service settings for the chart. # @default -- See values.yaml @@ -25,6 +27,10 @@ service: main: ports: http: + enabled: false + metrics: + enabled: true + protocol: TCP port: 9995 prometheus: