Skip to content

Commit 3a66e72

Browse files
committed
Update to use v0.10.0 as release.
Fix problem with update_p4prom.sh not checking for p4metrics.yaml
1 parent 968e231 commit 3a66e72

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,18 @@ Note these metrics will all have these labels: sdpinst (if SDP), serverid. Extra
150150
| p4_error_count | subsystem, error_id, level | (Deprecated - monitor_metrics.sh) Server errors by id - for sudden spurts of errors |
151151
| p4_errors_count | subsys, severity | Server errors by subsystem and severiy (e.g. error/fatal) - for sudden spurts of errors |
152152
| p4_filesys_min | filesys | Value of P4D configurable filesys.*.min |
153+
| p4_journal_size | | Size of P4JOURNAL in bytes |
154+
| p4_journals_rotated | | Count of rotations of P4JOURNAL by p4metrics |
153155
| p4_license_expires | | P4D License expiry (epoch secs) |
154156
| p4_license_info | info | P4D License info (if present) |
155157
| p4_license_IP | IP | P4D License IP address (if present) |
156158
| p4_license_support_expires | | P4D License support expiry (epoch secs) |
157159
| p4_license_time_remaining | | P4D License time remaining (secs) |
158160
| p4_licensed_user_count | | P4D Licensed User count |
159161
| p4_licensed_user_limit | | P4D Licensed User Limit |
162+
| p4_log_size | | Size of P4LOG in bytes |
163+
| p4_logs_file_count| | Count of files in SDP logs directory (not created for non-SDP) |
164+
| p4_logs_rotated | | Count of rotations of P4LOG by p4metrics |
160165
| p4_monitor_by_cmd | cmd | P4 running processes - counted by cmd |
161166
| p4_monitor_by_state | state | P4 running processes - counted by state (see 'p4 monitor show' status field) |
162167
| p4_monitor_by_user | user | P4 running processes - counted by user |

cmd/p4metrics/p4metrics.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ func (p4m *P4MonitorMetrics) monitorJournalAndLogs() {
941941
p4m.logger.Debugf("journal volume - size %d, free space %d", jstat.Size(), jvol.Free)
942942
if float64(jstat.Size())*1.1 < float64(pvol.Free) {
943943
if p4m.config.MaxJournalSizeInt > 0 && jstat.Size() > p4m.config.MaxJournalSizeInt {
944-
p4m.logger.Debugf("journal volume will rotate - size %d, max %d", jstat.Size(), p4m.config.MaxJournalSizeInt)
944+
p4m.logger.Debugf("journal will be rotated - size %d, max %d", jstat.Size(), p4m.config.MaxJournalSizeInt)
945945
rotateJournal = true
946946
}
947947
} else {
@@ -951,7 +951,7 @@ func (p4m *P4MonitorMetrics) monitorJournalAndLogs() {
951951
if !rotateJournal && p4m.config.MaxJournalPercentInt > 0 {
952952
percentSize := float64(jvol.Total) * float64(p4m.config.MaxJournalPercentInt) / float64(100.0)
953953
if float64(jstat.Size()) > percentSize {
954-
p4m.logger.Debugf("journal volume will rotate - size %d, max percent %d, val %.0f", jstat.Size(), p4m.config.MaxJournalPercentInt, percentSize)
954+
p4m.logger.Debugf("journal will be rotated - size %d, max percent %d, val %.0f", jstat.Size(), p4m.config.MaxJournalPercentInt, percentSize)
955955
rotateJournal = true
956956
}
957957
}
@@ -987,13 +987,13 @@ func (p4m *P4MonitorMetrics) monitorJournalAndLogs() {
987987
if ok3 {
988988
p4m.logger.Debugf("log volume - size %d, free space %d", lstat.Size(), lvol.Free)
989989
if p4m.config.MaxLogSizeInt > 0 && lstat.Size() > p4m.config.MaxLogSizeInt {
990-
p4m.logger.Debugf("log will be rotate - size %d, max %d", lstat.Size(), p4m.config.MaxLogSizeInt)
990+
p4m.logger.Debugf("log will be rotated - size %d, max %d", lstat.Size(), p4m.config.MaxLogSizeInt)
991991
rotateLog = true
992992
}
993993
if !rotateLog && p4m.config.MaxLogPercentInt > 0 {
994994
percentSize := float64(lvol.Total) * float64(p4m.config.MaxLogPercentInt) / float64(100.0)
995995
if float64(lstat.Size()) > percentSize {
996-
p4m.logger.Debugf("log will rotate - size %d, max percent %d, val %.0f", lstat.Size(), p4m.config.MaxLogPercentInt, percentSize)
996+
p4m.logger.Debugf("log will be rotated - size %d, max percent %d, val %.0f", lstat.Size(), p4m.config.MaxLogPercentInt, percentSize)
997997
rotateLog = true
998998
}
999999
}

scripts/install_p4prom.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ metrics_link=/p4/metrics
2121
local_bin_dir=/usr/local/bin
2222

2323
VER_NODE_EXPORTER="1.3.1"
24-
VER_P4PROMETHEUS="0.9.8"
24+
VER_P4PROMETHEUS="0.10.0"
2525

2626
# Default to amd but allow arm architecture
2727
arch="amd64"

scripts/update_p4prom.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ metrics_link=/p4/metrics
1919
local_bin_dir=/usr/local/bin
2020

2121
VER_NODE_EXPORTER="1.3.1"
22-
VER_P4PROMETHEUS="0.9.8"
22+
VER_P4PROMETHEUS="0.10.0"
2323

2424
# Default to amd but allow arm architecture
2525
arch="amd64"
@@ -152,6 +152,9 @@ fi
152152
p4prom_config_file="$p4prom_config_dir/p4prometheus.yaml"
153153
p4metrics_config_file="$p4prom_config_dir/p4metrics.yaml"
154154

155+
[[ -f "$p4prom_config_file" ]] || bail "Config file '$p4prom_config_file' does not exist - please run install_p4prom.sh instead of this script!"
156+
[[ -f "$p4metrics_config_file" ]] || bail "Config file '$p4metrics_config_file' does not exist - please run install_p4prom.sh instead of this script!"
157+
155158
download_and_untar () {
156159
fname=$1
157160
url=$2

0 commit comments

Comments
 (0)