Skip to content

Commit bfbb270

Browse files
committed
DLPX-96312 Sending all data to influxDB now
1 parent e7b0552 commit bfbb270

7 files changed

Lines changed: 52 additions & 77 deletions

File tree

influxdb/delphix-influxdb-init

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ cat >"$INFLUXDB_OUTPUT" <<EOF
184184
token = "$WRITE_TOKEN"
185185
organization = "$INFLUXDB_ORG"
186186
bucket = "$INFLUXDB_BUCKET"
187-
namepass = ["cpu", "disk", "diskio", "mem", "net", "procstat", "processes", "swap", "system", "zfs", "estat_nfs", "estat_iscsi"]
188187
EOF
189188
# Enforce restrictive permissions so the write token is not world-readable.
190189
chmod 640 "$INFLUXDB_OUTPUT"

telegraf/connstat-stats.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
/usr/bin/connstat -PLe -i 10 -T u \
3+
-o laddr,lport,raddr,rport,inbytes,outbytes,retranssegs,suna,unsent,swnd,cwnd,rwnd,rtt \
4+
| grep --line-buffered -v "^="

telegraf/delphix-telegraf-service

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ BASE_CONFIG=/etc/telegraf/telegraf.base
33
DOSE_INPUTS=/etc/telegraf/telegraf.inputs.dose
44
DCT_INPUTS=/etc/telegraf/telegraf.inputs.dct
55
PLAYBOOK_INPUTS=/etc/telegraf/telegraf.inputs.playbook
6-
NFS_ISCSI_INPUTS=/etc/telegraf/telegraf.inputs.nfs_iscsi
6+
STORAGE_IO_INPUTS=/etc/telegraf/telegraf.inputs.storage_io
77
INFLUXDB_OUTPUT=/etc/telegraf/telegraf.outputs.influxdb
88
PLAYBOOK_FLAG=/etc/telegraf/PLAYBOOK_ENABLED
99
INFLUXDB_FLAG=/etc/telegraf/INFLUXDB_ENABLED
@@ -50,12 +50,8 @@ else
5050
fi
5151
fi
5252

53-
if playbook_is_enabled || influxdb_is_enabled; then
54-
cat $NFS_ISCSI_INPUTS >> $TELEGRAF_CONFIG
55-
fi
56-
5753
if influxdb_is_enabled && [[ -f $INFLUXDB_OUTPUT ]]; then
58-
cat $INFLUXDB_OUTPUT >> $TELEGRAF_CONFIG
54+
cat $STORAGE_IO_INPUTS $INFLUXDB_OUTPUT >> $TELEGRAF_CONFIG
5955
fi
6056

6157
# Restrict permissions so the InfluxDB write token is not world-readable.

telegraf/telegraf.base

Lines changed: 20 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,9 @@
1111
###############################################################################
1212
# OUTPUT PLUGINS #
1313
###############################################################################
14-
# Define the main metric output file, excluding aggregated stats and
15-
# Performance Playbook (estat) data.
16-
[[outputs.file]]
17-
files = ["/var/log/telegraf/metrics.json"]
18-
rotation_max_size = "50MB"
19-
rotation_max_archives = 9
20-
data_format = "json"
21-
namedrop = ["*estat_*", "agg_*", "zfs", "zpool*", "zcache*", "docker*"]
22-
23-
# Define output file for ZFS related metrics
24-
[[outputs.file]]
25-
files = ["/var/log/telegraf/metrics_zfs.json"]
26-
rotation_max_size = "30MB"
27-
rotation_max_archives = 5
28-
data_format = "json"
29-
namepass = ["zpool*", "zcache*", "zfs"]
30-
31-
# Define output file for Performance Playbook (estat) metrics
32-
[[outputs.file]]
33-
files = ["/var/log/telegraf/metrics_estat.json"]
34-
rotation_max_size = "30MB"
35-
rotation_max_archives = 5
36-
data_format = "json"
37-
namepass = ["*estat_*"]
38-
39-
# Define output file for aggregate statistics
40-
[[outputs.file]]
41-
files = ["/var/log/telegraf/metric_aggregates.json"]
42-
rotation_max_size = "30MB"
43-
rotation_max_archives = 5
44-
data_format = "json"
45-
namepass = ["agg_*"]
46-
47-
# InfluxDB output is managed via /etc/telegraf/telegraf.outputs.influxdb (written by
48-
# delphix-influxdb-init) and the /etc/telegraf/INFLUXDB_ENABLED flag.
14+
# All metrics are ingested into InfluxDB. The output stanza is written by
15+
# delphix-influxdb-init to /etc/telegraf/telegraf.outputs.influxdb and
16+
# appended here by delphix-telegraf-service when InfluxDB is enabled.
4917
# Use 'perf_influxdb enable|disable' to toggle and restart Telegraf.
5018

5119
###############################################################################
@@ -64,15 +32,10 @@
6432
[[inputs.disk]]
6533
mount_points = ["/","/domain0"]
6634

67-
# Get disk I/O stats
35+
# Get disk I/O stats, excluding ZFS zvol devices (zd*) which are internal
36+
# ZFS block devices not useful for performance diagnostics.
6837
[[inputs.diskio]]
69-
70-
# Track stats for the current metric files
71-
[[inputs.filestat]]
72-
files = ["/var/log/telegraf/metrics.json",
73-
"/var/log/telegraf/metrics_estat.json",
74-
"/var/log/telegraf/metrics_zfs.json",
75-
"/var/log/telegraf/metric_aggregates.json"]
38+
tagdrop = {name = ["zd*"]}
7639

7740
# Get Memory stats
7841
[[inputs.mem]]
@@ -81,6 +44,20 @@
8144
[[inputs.net]]
8245
fieldpass = ["tcp*","bytes*","packets*","err*","drop*"]
8346

47+
# Per-connection TCP stats (bytes, RTT, window sizes) via connstat.
48+
# Mirrors the TCP_STATS collected by the mgmt stack into analytics_datapoint.
49+
[[inputs.execd]]
50+
command = ["/etc/telegraf/connstat-stats.sh"]
51+
name_override = "tcp_stats"
52+
signal = "none"
53+
restart_delay = "30s"
54+
data_format = "csv"
55+
csv_delimiter = ","
56+
csv_trim_space = true
57+
csv_column_names = ["laddr", "lport", "raddr", "rport", "inbytes", "outbytes", "retranssegs", "suna", "unsent", "swnd", "cwnd", "rwnd", "rtt"]
58+
csv_column_types = ["string", "int", "string", "int", "int", "int", "int", "int", "int", "int", "int", "int", "int"]
59+
csv_tag_columns = ["laddr", "lport", "raddr", "rport"]
60+
8461
# Track CPU and Memory for the "delphix-mgmt" service (and children).
8562
[[inputs.procstat]]
8663
systemd_unit = "delphix-mgmt.service"

telegraf/telegraf.inputs.dct

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,5 @@
1111
]
1212
docker_label_exclude = ["com.docker.compose.*", "resty*"]
1313

14-
[[outputs.file]]
15-
files = ["/var/log/telegraf/metrics_docker.json"]
16-
rotation_max_size = "30MB"
17-
rotation_max_archives = 5
18-
data_format = "json"
19-
namepass = ["docker*"]
20-
2114
####################### End of Docker/DCT services Metrics #######################
2215

telegraf/telegraf.inputs.playbook

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
##############################################################################
22
# Performance Playbook (estat, nfs_threads) collection
3-
# Note: estat_nfs and estat_iscsi are in telegraf.inputs.nfs_iscsi so they
4-
# are also available when only InfluxDB is enabled (without the full playbook).
3+
# Note: estat_nfs, estat_iscsi, and estat_backend-io live in
4+
# telegraf.inputs.nfs_iscsi and are always collected when InfluxDB is
5+
# enabled, independent of playbook state.
56

67
# Collect output from "estat zpl -jm 10"
78
[[inputs.execd]]
@@ -16,19 +17,6 @@
1617
]
1718
json_string_fields = ["iops(/s)", "avg latency(us)", "stddev(us)", "throughput(k/s)", "microseconds"]
1819

19-
# Collect output from "estat backend-io -jm 10"
20-
[[inputs.execd]]
21-
command = ["estat", "backend-io", "-jm", "10"]
22-
name_override = "estat_backend-io"
23-
signal = "none"
24-
restart_delay = "30s"
25-
data_format = "json"
26-
tag_keys = [
27-
"name",
28-
"axis"
29-
]
30-
json_string_fields = ["iops(/s)", "avg latency(us)", "stddev(us)", "throughput(k/s)", "microseconds"]
31-
3220
# Collect output from "estat zvol -jm 10"
3321
[[inputs.execd]]
3422
command = ["estat", "zvol", "-jm", "10"]
@@ -99,8 +87,11 @@
9987
###############################################################################
10088
# PROCESSOR PLUGINS #
10189
###############################################################################
102-
# Convert strings from estat into integer values so they don't get dropped
90+
# Convert strings from estat into integer values so they don't get dropped.
91+
# Scoped to playbook-only metrics; estat_nfs/iscsi have their own converter
92+
# in telegraf.inputs.nfs_iscsi.
10393
[[processors.converter]]
94+
namepass = ["estat_zpl", "estat_zio", "estat_zvol", "estat_zio-queue", "estat_metaslab-alloc"]
10495
[processors.converter.fields]
10596
integer = ["iops(/s)", "avg latency(us)", "stddev(us)", "throughput(k/s)"]
10697

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
##############################################################################
2-
# NFS server I/O and iSCSI target I/O — included when InfluxDB is enabled
3-
# but Performance Playbook is not (playbook already contains these inputs).
2+
# Storage I/O collection: NFS server, iSCSI target, and backend disk I/O.
3+
# Always included when InfluxDB is enabled, independent of playbook state.
44

5+
# Collect output from "estat nfs -jm 10"
56
[[inputs.execd]]
67
command = ["estat", "nfs", "-jm", "10"]
78
name_override = "estat_nfs"
@@ -14,6 +15,7 @@
1415
]
1516
json_string_fields = ["iops(/s)", "avg latency(us)", "stddev(us)", "throughput(k/s)", "microseconds"]
1617

18+
# Collect output from "estat iscsi -jm 10"
1719
[[inputs.execd]]
1820
command = ["estat", "iscsi", "-jm", "10"]
1921
name_override = "estat_iscsi"
@@ -26,11 +28,24 @@
2628
]
2729
json_string_fields = ["iops(/s)", "avg latency(us)", "stddev(us)", "throughput(k/s)", "microseconds"]
2830

31+
# Collect output from "estat backend-io -jm 10" (stbtrace io equivalent)
32+
[[inputs.execd]]
33+
command = ["estat", "backend-io", "-jm", "10"]
34+
name_override = "estat_backend-io"
35+
signal = "none"
36+
restart_delay = "30s"
37+
data_format = "json"
38+
tag_keys = [
39+
"name",
40+
"axis"
41+
]
42+
json_string_fields = ["iops(/s)", "avg latency(us)", "stddev(us)", "throughput(k/s)", "microseconds"]
43+
2944
# Convert estat string fields to integers so they are not dropped by Telegraf.
3045
[[processors.converter]]
31-
namepass = ["estat_nfs", "estat_iscsi"]
46+
namepass = ["estat_nfs", "estat_iscsi", "estat_backend-io"]
3247
[processors.converter.fields]
3348
integer = ["iops(/s)", "avg latency(us)", "stddev(us)", "throughput(k/s)"]
3449

35-
# End of NFS/iSCSI section
50+
# End of Storage I/O section
3651
##############################################################################

0 commit comments

Comments
 (0)