feat: Add Truenas-exporter (#18733)

**Description**


**⚙️ Type of change**

- [x] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [ ] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 🔃 Refactor of current code

**🧪 How Has This Been Tested?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ Checklist:**

- [ ] ⚖️ My code follows the style guidelines of this project
- [ ] 👀 I have performed a self-review of my own code
- [ ] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [ ] 📄 I have made corresponding changes to the documentation
- [ ] ⚠️ My changes generate no new warnings
- [ ] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [ ] ⬆️ I increased versions for any altered app according to semantic
versioning

** App addition**

If this PR is an app addition please make sure you have done the
following.

- [ ] 🖼️ I have added an icon in the Chart's root directory called
`icon.png`

---

_Please don't blindly check all the boxes. Read them and only check
those that apply.
Those checkboxes are there for the reviewer to see what is this all
about and
the status of this PR with a quick glance._
This commit is contained in:
Kjeld Schouten 2024-03-01 15:03:32 +01:00 committed by GitHub
parent a8fdb8bcf4
commit 82422760e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 6155 additions and 0 deletions

View File

@ -0,0 +1,30 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
# OWNERS file for Kubernetes
OWNERS
# helm-docs templates
*.gotmpl
# docs folder
/docs
# icon
icon.png

View File

@ -0,0 +1,3 @@
---
title: Changelog
---

View File

@ -0,0 +1,35 @@
annotations:
max_scale_version: 24.04.0
min_scale_version: 23.10.0
truecharts.org/SCALE-support: "true"
truecharts.org/category: system
truecharts.org/max_helm_version: "3.14"
truecharts.org/min_helm_version: "3.11"
truecharts.org/train: incubator
apiVersion: v2
appVersion: 18.0.1
dependencies:
- name: common
version: 17.5.1
repository: oci://tccr.io/truecharts
condition: ""
alias: ""
tags: []
import-values: []
deprecated: false
description: A metrics exporter for TrueNAS
home: https://truecharts.org/charts/incubator/truenas-exporter
icon: https://truecharts.org/img/hotlink-ok/chart-icons/truenas-exporter.png
keywords:
- truenas-exporter
- metrics
kubeVersion: ">=1.24.0-0"
maintainers:
- name: TrueCharts
email: info@truecharts.org
url: https://truecharts.org
name: truenas-exporter
sources:
- https://github.com/Supporterino/truenas-graphite-to-prometheus/tree/main
type: application
version: 0.0.1

View File

@ -0,0 +1,28 @@
---
title: README
---
## General Info
TrueCharts can be installed as both _normal_ Helm Charts or as Apps on TrueNAS SCALE.
However only installations using the TrueNAS SCALE Apps system are supported.
For more information about this App, please check the docs on the TrueCharts [website](https://truecharts.org/charts/incubator/atuin)
**This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/truecharts/charts/issues/new/choose)**
## Support
- Please check our [quick-start guides for TrueNAS SCALE](https://truecharts.org/manual/SCALE/guides/scale-intro).
- See the [Website](https://truecharts.org)
- Check our [Discord](https://discord.gg/tVsPTHWTtr)
- Open a [issue](https://github.com/truecharts/charts/issues/new/choose)
---
## Sponsor TrueCharts
TrueCharts can only exist due to the incredible effort of our staff.
Please consider making a [donation](https://truecharts.org/sponsor) or contributing back to the project any way you can!
_All Rights Reserved - The TrueCharts Project_

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,9 @@
# Connecting TrueNAS SCALE
TrueNAS Scale
Inside of TrueNAS you have to open the `Reporting` tab and then click the `Exporters` button to adjust the already present graphite exporter by hitting the edit icon.
Once in the edit view you have to adjust three fields to match your later desired metrics.
The `prefix` for the graphite metrics need to be set to `truenas` for the mapping file to work
The `hostname` field should be choosen according to your needs it will later populate the instance label of your metrics
The `update` every field should match your scrape time. This is set to `5` by default

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -0,0 +1,75 @@
# Include{groups}
portals:
open:
# Include{portalLink}
questions:
# Include{global}
# Include{workload}
# Include{workloadDeployment}
# Include{replicas1}
# Include{podSpec}
# Include{containerMain}
# Include{containerBasic}
# Include{containerAdvanced}
# Include{containerConfig}
# Include{podOptions}
# Include{serviceRoot}
# Include{serviceMain}
# Include{serviceSelectorLoadBalancer}
# Include{serviceSelectorExtras}
- variable: main
label: "Main Service Port Configuration"
schema:
additional_attrs: true
type: dict
attrs:
- variable: port
label: "Port"
description: "This port exposes the container port on the service"
schema:
type: int
default: 9109
required: true
# Include{serviceExpertRoot}
# Include{serviceExpert}
# Include{serviceList}
# Include{ingressRoot}
- variable: main
label: "Main Ingress"
schema:
additional_attrs: true
type: dict
attrs:
# Include{ingressDefault}
# Include{ingressAdvanced}
# Include{ingressList}
# Include{securityContextRoot}
- variable: runAsUser
label: "runAsUser"
description: "The UserID of the user running the application"
schema:
type: int
default: 568
- variable: runAsGroup
label: "runAsGroup"
description: "The groupID of the user running the application"
schema:
type: int
default: 568
# Include{securityContextContainer}
# Include{securityContextAdvanced}
# Include{securityContextPod}
- variable: fsGroup
label: "fsGroup"
description: "The group that should own ALL storage."
schema:
type: int
default: 568
# Include{resources}
# Include{advanced}
# Include{addons}
# Include{codeserver}
# Include{netshoot}
# Include{vpn}
# Include{documentation}

View File

@ -0,0 +1 @@
{{- include "tc.v1.common.lib.chart.notes" $ -}}

View File

@ -0,0 +1 @@
{{ include "tc.v1.common.loader.all" . }}

View File

@ -0,0 +1,491 @@
image:
repository: prom/graphite-exporter
pullPolicy: IfNotPresent
tag: v0.15.0
service:
main:
ports:
main:
protocol: tcp
port: 9109
metrics:
enabled: true
ports:
metrics:
enabled: true
protocol: http
port: 9108
workload:
main:
podSpec:
containers:
main:
args:
- '--graphite.mapping-config=/config/graphite_mapping.conf'
metrics:
main:
enabled: true
targetSelector: metrics
endpoints:
- port: metrics
portal:
open:
enabled: false
persistence:
config:
enabled: true
type: configmap
mountPath: /config/graphite_mapping.conf
objectName: config
readOnly: true
subPath: graphite_mapping.conf
configmap:
dashboard:
enabled: true
labels:
grafana_dashboard: "1"
data:
truenasexporter.json: >-
{{ .Files.Get "dashboard.json" | indent 8 }}
config:
enabled: true
data:
graphite_mapping.conf: >-
mappings:
################################################
# memory mapping
################################################
- match: "truenas.*.system.ram.*"
name: "physical_memory"
labels:
job: "truenas"
instance: "${1}"
kind: "${2}"
- match: "truenas.*.mem.*.*"
name: "memory_${2}"
labels:
job: "truenas"
instance: "${1}"
kind: "${3}"
- match: "truenas.*.system.swap.*"
name: "swap"
labels:
job: "truenas"
instance: "${1}"
kind: "${2}"
################################################
# disk smart metrics
################################################
- match: "truenas.*.smart.log.smart.disktemp.*.*"
name: "disk_temperature"
labels:
job: "truenas"
instance: "${1}"
serial: "${2}"
################################################
# disk operation mappings
################################################
- match: "truenas.*.disk.*.*"
name: "disk_io"
labels:
job: "truenas"
instance: "${1}"
disk: "${2}"
op: "${3}"
- match: "truenas.*.disk_ops.*.*"
name: "disk_io_ops"
labels:
job: "truenas"
instance: "${1}"
disk: "${2}"
op: "${3}"
- match: "truenas.*.disk_ext.*.*"
name: "disk_io"
labels:
job: "truenas"
instance: "${1}"
disk: "${2}"
op: "${3}"
- match: "truenas.*.disk_ext_ops.*.*"
name: "disk_io_ops"
labels:
job: "truenas"
instance: "${1}"
disk: "${2}"
op: "${3}"
- match: "truenas.*.disk_backlog.*.backlog"
name: "disk_io_backlog"
labels:
job: "truenas"
instance: "${1}"
disk: "${2}"
- match: "truenas.*.disk_busy.*.busy"
name: "disk_busy"
labels:
job: "truenas"
instance: "${1}"
disk: "${2}"
- match: "truenas.*.disk_util.*.utilization"
name: "disk_utilization"
labels:
job: "truenas"
instance: "${1}"
disk: "${2}"
- match: "truenas.*.disk_mops.*.*"
name: "disk_io"
labels:
job: "truenas"
instance: "${1}"
disk: "${2}"
op: "merged_${3}"
- match: "truenas.*.disk_ext_mops.*.*"
name: "disk_io"
labels:
job: "truenas"
instance: "${1}"
disk: "${2}"
op: "merged_${3}"
- match: "truenas.*.disk_iotime.*.*"
name: "disk_iotime"
labels:
job: "truenas"
instance: "${1}"
disk: "${2}"
op: "${3}"
- match: "truenas.*.disk_ext_iotime.*.*"
name: "disk_iotime"
labels:
job: "truenas"
instance: "${1}"
disk: "${2}"
op: "${3}"
- match: "truenas.*.disk_qops.*.operations"
name: "disk_qops"
labels:
job: "truenas"
instance: "${1}"
disk: "${2}"
- match: "truenas.*.disk_await.*.*"
name: "disk_await"
labels:
job: "truenas"
instance: "${1}"
disk: "${2}"
op: "${3}"
- match: "truenas.*.disk_ext_await.*.*"
name: "disk_await"
labels:
job: "truenas"
instance: "${1}"
disk: "${2}"
op: "${3}"
- match: "truenas.*.disk_avgsz.*.*"
name: "disk_io_size"
labels:
job: "truenas"
instance: "${1}"
disk: "${2}"
op: "${3}"
- match: "truenas.*.disk_ext_avgsz.*.*"
name: "disk_io_size"
labels:
job: "truenas"
instance: "${1}"
disk: "${2}"
op: "${3}"
- match: "truenas.*.disk_svctm.*.svctm"
name: "disk_svctm"
labels:
job: "truenas"
instance: "${1}"
disk: "${2}"
- match: "truenas.*.system.io.*"
name: "system_io"
labels:
job: "truenas"
instance: "${1}"
op: "${2}"
################################################
# CPU mapping
################################################
- match: "truenas.*.system.intr.interrupts"
name: "interrupts"
labels:
job: "truenas"
instance: "${1}"
kind: "hard"
- match: "truenas.*.system.cpu.softirq"
name: "interrupts"
labels:
job: "truenas"
instance: "${1}"
kind: "soft"
- match: "truenas.*.cpu.*.softirq"
name: "cpu_softirq"
labels:
job: "truenas"
instance: "${1}"
cpu: "${2}"
- match: "truenas.*.system.ctxt.switches"
name: "context_switches"
labels:
job: "truenas"
instance: "${1}"
- match: "truenas.*.system.cpu.*"
name: "cpu_total"
labels:
job: "truenas"
instance: "${1}"
kind: "${2}"
- match: "truenas.*.cputemp.temperatures.*"
name: "cpu_temperature"
labels:
job: "truenas"
instance: "${1}"
cpu: "cpu${2}"
- match: "truenas.*.cpu.core_throttling.*"
name: "cpu_throttling"
labels:
job: "truenas"
instance: "${1}"
cpu: "${2}"
- match: "truenas.*.cpu.cpufreq.*"
name: "cpu_frequency"
labels:
job: "truenas"
instance: "${1}"
cpu: "${2}"
- match: 'truenas\.(.*)\.cpu\.(.*)_cpuidle\.(.*)'
match_type: "regex"
name: "cpu_idlestate"
labels:
job: "truenas"
instance: "${1}"
cpu: "${2}"
state: "${3}"
- match: 'truenas\.(.*)\.cpu\.(.*)\.(.*)'
match_type: "regex"
name: "cpu_usage"
labels:
job: "truenas"
instance: "${1}"
cpu: "${2}"
kind: "${3}"
################################################
# process mapping
################################################
- match: "truenas.*.system.forks.started"
name: "processes_forks"
labels:
job: "truenas"
instance: "${1}"
- match: "truenas.*.system.processes.*"
name: "processes"
labels:
job: "truenas"
instance: "${1}"
kind: "${2}"
- match: "truenas.*.system.active_processes.*"
name: "processes"
labels:
job: "truenas"
instance: "${1}"
kind: "${2}"
################################################
# uptime mapping
################################################
- match: "truenas.*.system.uptime.uptime"
name: "uptime"
labels:
job: "truenas"
instance: "${1}"
- match: "truenas.*.system.clock_sync_state.state"
name: "clock_synced"
labels:
job: "truenas"
instance: "${1}"
- match: "truenas.*.system.clock_status.*"
name: "clock_status"
labels:
job: "truenas"
instance: "${1}"
state: "${2}"
- match: "truenas.*.system.clock_sync_offset.offset"
name: "clock_offset"
labels:
job: "truenas"
instance: "${1}"
################################################
# load mapping
################################################
- match: "truenas.*.system.load.*"
name: "system_load"
labels:
job: "truenas"
instance: "${1}"
kind: "${2}"
################################################
# nsfd mappings
################################################
- match: "truenas.*.nfsd.*.*"
name: "nfs_${2}"
labels:
job: "truenas"
instance: "${1}"
op: "${3}"
################################################
# zfs mappings
################################################
- match: "truenas.*.zfs.*.*"
name: "zfs_${2}"
labels:
job: "truenas"
instance: "${1}"
op: "${3}"
- match: 'truenas\.(.*)\.zfspool\.state_(.*)\.(.*)'
match_type: "regex"
name: "zfs_pool"
labels:
job: "truenas"
instance: "${1}"
pool: "${2}"
state: "${3}"
################################################
# network mappings
################################################
- match: "truenas.*.net.*.*"
name: "interface_io"
labels:
job: "truenas"
instance: "${1}"
interface: "${2}"
op: "${3}"
- match: "truenas.*.net_speed.*.speed"
name: "interface_speed"
labels:
job: "truenas"
instance: "${1}"
interface: "${2}"
- match: "truenas.*.net_duplex.*.*"
name: "interface_duplex"
labels:
job: "truenas"
instance: "${1}"
interface: "${2}"
state: "${3}"
- match: "truenas.*.net_operstate.*.*"
name: "interface_operationstate"
labels:
job: "truenas"
instance: "${1}"
interface: "${2}"
state: "${3}"
- match: "truenas.*.net_carrier.*.*"
name: "interface_carrierstate"
labels:
job: "truenas"
instance: "${1}"
interface: "${2}"
state: "${3}"
- match: "truenas.*.net_mtu.*.mtu"
name: "interface_mtu"
labels:
job: "truenas"
instance: "${1}"
interface: "${2}"
- match: "truenas.*.net_packets.*.*"
name: "interface_packets"
labels:
job: "truenas"
instance: "${1}"
interface: "${2}"
op: "${3}"
- match: "truenas.*.net_errors.*.*"
name: "interface_errors"
labels:
job: "truenas"
instance: "${1}"
interface: "${2}"
op: "${3}"
- match: "truenas.*.net_drops.*.*"
name: "interface_drops"
labels:
job: "truenas"
instance: "${1}"
interface: "${2}"
op: "${3}"
- match: "truenas.*.system.net.*"
name: "system_net_io"
labels:
job: "truenas"
instance: "${1}"
op: "${2}"