FreeBSD Bugzilla – Attachment 194094 Details for
Bug 228185
[PATCH] net-mgmt/prometheus2: Update to 2.3.1, add default Prometheus web consoles and logging examples
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
net-mgmt/prometheus2: Update to 2.3.0, add default consoles and improve logging
prometheus2.3.0.diff (text/plain), 9.32 KB, created by
David O'Rourke
on 2018-06-09 10:44:42 UTC
(
hide
)
Description:
net-mgmt/prometheus2: Update to 2.3.0, add default consoles and improve logging
Filename:
MIME Type:
Creator:
David O'Rourke
Created:
2018-06-09 10:44:42 UTC
Size:
9.32 KB
patch
obsolete
>diff --git a/net-mgmt/prometheus2/Makefile b/net-mgmt/prometheus2/Makefile >index 21e8d85b903b..1e48efe4d8ee 100644 >--- a/net-mgmt/prometheus2/Makefile >+++ b/net-mgmt/prometheus2/Makefile >@@ -2,7 +2,7 @@ > > PORTNAME= prometheus > DISTVERSIONPREFIX= v >-DISTVERSION= 2.2.1 >+DISTVERSION= 2.3.0 > CATEGORIES= net-mgmt > > MAINTAINER= dor.bsd@xm0.uk >@@ -16,8 +16,41 @@ GO_PKGNAME= github.com/${GH_ACCOUNT}/${GH_PROJECT} > USE_GITHUB= yes > USE_RC_SUBR= prometheus > >-USERS= prometheus >-GROUPS= prometheus >+OPTIONS_DEFINE= EXAMPLES >+OPTIONS_DEFAULT= EXAMPLES >+EXAMPLES_DESC= Install example configuration files for syslog and newsyslog >+ >+PROMETHEUS_USER?= prometheus >+PROMETHEUS_GROUP?= prometheus >+ >+USERS= ${PROMETHEUS_USER} >+GROUPS= ${PROMETHEUS_GROUP} >+ >+PROMETHEUS_BINARIES= prometheus promtool >+PROMETHEUS_SHARE_DIR= ${DATADIR} >+PROMETHEUS_CONSOLES_DIR= ${PROMETHEUS_SHARE_DIR}/consoles >+PROMETHEUS_CONSOLE_LIBRARIES_DIR= ${PROMETHEUS_SHARE_DIR}/console_libraries >+PROMETHEUS_DB_DIR= /var/db/${PORTNAME} >+PROMETHEUS_LOG_DIR= /var/log/prometheus >+PROMETHEUS_LOG_FILE= ${PROMETHEUS_LOG_DIR}/prometheus.log >+ >+SUB_FILES= prometheus \ >+ newsyslog.conf \ >+ syslog.d.conf >+ >+SUB_LIST+= PROMETHEUS_USER=${PROMETHEUS_USER} \ >+ PROMETHEUS_GROUP=${PROMETHEUS_GROUP} \ >+ PROMETHEUS_CONSOLE_LIBRARIES_DIR=${PROMETHEUS_CONSOLE_LIBRARIES_DIR} \ >+ PROMETHEUS_CONSOLES_DIR=${PROMETHEUS_CONSOLES_DIR} \ >+ PROMETHEUS_DB_DIR=${PROMETHEUS_DB_DIR} \ >+ PROMETHEUS_LOG_DIR=${PROMETHEUS_LOG_DIR} \ >+ PROMETHEUS_LOG_FILE=${PROMETHEUS_LOG_FILE} \ >+ PROMETHEUS_SHARE_DIR=${PROMETHEUS_SHARE_DIR} >+ >+PLIST_SUB+= PROMETHEUS_CONSOLE_LIBRARIES_DIR=${PROMETHEUS_CONSOLE_LIBRARIES_DIR} \ >+ PROMETHEUS_CONSOLES_DIR=${PROMETHEUS_CONSOLES_DIR} \ >+ PROMETHEUS_DB_DIR=${PROMETHEUS_DB_DIR} \ >+ PROMETHEUS_LOG_DIR=${PROMETHEUS_LOG_DIR} > > BUILD_USER?= ${USER} > LD_FLAG_X_PREFIX= -X ${GO_PKGNAME}/vendor/${GO_PKGNAME:H}/common/version >@@ -26,22 +59,43 @@ LD_FLAG_STRING= -s \ > ${LD_FLAG_X_PREFIX}.Revision=${PORTREVISION} \ > ${LD_FLAG_X_PREFIX}.Branch=release-${PORTVERSION:R} \ > ${LD_FLAG_X_PREFIX}.BuildUser=${BUILD_USER} >-PROMETHEUS_BINARIES= prometheus promtool > > do-build: > .for bin in ${PROMETHEUS_BINARIES} > ( cd ${GO_WRKSRC}/cmd/${bin} ; \ >- ${SETENV} ${MAKE_ENV} ${GO_ENV} go install -ldflags "${LD_FLAG_STRING}" ) >+ ${SETENV} ${MAKE_ENV} ${GO_ENV} \ >+ ${GO_CMD} install -v -ldflags "${LD_FLAG_STRING}" ) > .endfor > > do-install: > .for bin in ${PROMETHEUS_BINARIES} > ${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/${bin} ${STAGEDIR}${PREFIX}/bin > .endfor >+ > ${INSTALL_DATA} \ > ${WRKSRC}/documentation/examples/prometheus.yml \ > ${STAGEDIR}${LOCALBASE}/etc/prometheus.yml.sample > >- ${MKDIR} ${STAGEDIR}${DESTDIR}/var/db/prometheus >+ ${MKDIR} ${STAGEDIR}${DESTDIR}${PROMETHEUS_DB_DIR} >+ ${MKDIR} ${STAGEDIR}${DESTDIR}${PROMETHEUS_CONSOLES_DIR} >+ ${MKDIR} ${STAGEDIR}${DESTDIR}${PROMETHEUS_CONSOLE_LIBRARIES_DIR} >+ ${MKDIR} ${STAGEDIR}${PROMETHEUS_LOG_DIR} >+ >+ ( cd ${WRKSRC}/console_libraries \ >+ && ${COPYTREE_SHARE} . ${STAGEDIR}${PROMETHEUS_CONSOLE_LIBRARIES_DIR} \ >+ ) >+ ( cd ${WRKSRC}/consoles \ >+ && ${COPYTREE_SHARE} . ${STAGEDIR}${PROMETHEUS_CONSOLES_DIR} \ >+ ) >+ >+post-install-EXAMPLES-on: >+ ${MKDIR} ${STAGEDIR}${EXAMPLESDIR} >+ ${INSTALL_DATA} \ >+ ${WRKDIR}/syslog.d.conf \ >+ ${STAGEDIR}${EXAMPLESDIR}/syslog.d.conf >+ >+ ${INSTALL_DATA} \ >+ ${WRKDIR}/newsyslog.conf \ >+ ${STAGEDIR}${EXAMPLESDIR}/newsyslog.conf > > .include <bsd.port.mk> >diff --git a/net-mgmt/prometheus2/distinfo b/net-mgmt/prometheus2/distinfo >index 6b93b44f6666..66bc22cd6238 100644 >--- a/net-mgmt/prometheus2/distinfo >+++ b/net-mgmt/prometheus2/distinfo >@@ -1,3 +1,3 @@ >-TIMESTAMP = 1523391674 >-SHA256 (prometheus-prometheus-v2.2.1_GH0.tar.gz) = 4f75427449bb72d1886f6cd46f752fe6300242da48b8bb870dbbd7ffc879ed92 >-SIZE (prometheus-prometheus-v2.2.1_GH0.tar.gz) = 5629500 >+TIMESTAMP = 1528477845 >+SHA256 (prometheus-prometheus-v2.3.0_GH0.tar.gz) = 5c971a0b749572469b6fe850e4f077fd2e32562de120dd26faa368fa31b3fcff >+SIZE (prometheus-prometheus-v2.3.0_GH0.tar.gz) = 6171790 >diff --git a/net-mgmt/prometheus2/files/newsyslog.conf.in b/net-mgmt/prometheus2/files/newsyslog.conf.in >new file mode 100644 >index 000000000000..997171f5e8cd >--- /dev/null >+++ b/net-mgmt/prometheus2/files/newsyslog.conf.in >@@ -0,0 +1,6 @@ >+# newsyslog(8) file for net-mgmt/prometheus2 >+# See newsyslog.conf(5) for details. >+# >+# Log file will be rotated daily, and we'll keep 15 days of logs matching the >+# default Prometheus TSDB retention time. >+%%PROMETHEUS_LOG_FILE%% 640 15 * @T00 JC >diff --git a/net-mgmt/prometheus2/files/prometheus.in b/net-mgmt/prometheus2/files/prometheus.in >index 73814e4591e5..913d291b5037 100644 >--- a/net-mgmt/prometheus2/files/prometheus.in >+++ b/net-mgmt/prometheus2/files/prometheus.in >@@ -7,18 +7,27 @@ > # Add the following lines to /etc/rc.conf.local or /etc/rc.conf > # to enable this service: > # >-# prometheus_enable (bool): Set to NO by default >-# Set it to YES to enable prometheus >-# prometheus_user (string): Set user to run prometheus >-# Default is "prometheus" >-# prometheus_group (string): Set group to run prometheus >-# Default is "prometheus" >-# prometheus_data_dir (string): Set dir to run prometheus in >-# Default is "/var/db/prometheus" >-# prometheus_log_file (string): Set file that prometheus will log to >-# Default is "/var/log/prometheus.log" >-# prometheus_args (string): Set additional command line arguments >-# Default is "" >+# prometheus_enable (bool) >+# Set to NO by default >+# Set it to YES to enable prometheus >+# prometheus_user (string) >+# Set user to run prometheus >+# Default is "%%PROMETHEUS_USER%%" >+# prometheus_group (string) >+# Set group to run prometheus >+# Default is "%%PROMETHEUS_GROUP%%" >+# prometheus_data_dir (string) >+# Set dir to run prometheus in >+# Default is "%%PROMETHEUS_DB_DIR%%" >+# prometheus_consoles (string) >+# Set dir that contains Prometheus consoles >+# Default is "%%PROMETHEUS_CONSOLES_DIR%%" >+# prometheus_console_libraries (string) >+# Set dir containing Prometheus console libraries >+# Default is "%%PROMETHEUS_CONSOLE_LIBRARIES_DIR%%" >+# prometheus_args (string) >+# Set additional command line arguments >+# Default is "" > > . /etc/rc.subr > >@@ -28,11 +37,12 @@ rcvar=prometheus_enable > load_rc_config $name > > : ${prometheus_enable:="NO"} >-: ${prometheus_user:="prometheus"} >-: ${prometheus_group:="prometheus"} >+: ${prometheus_user:="%%PROMETHEUS_USER%%"} >+: ${prometheus_group:="%%PROMETHEUS_GROUP%%"} > : ${prometheus_config:="%%PREFIX%%/etc/prometheus.yml"} >-: ${prometheus_data_dir:="/var/db/prometheus"} >-: ${prometheus_log_file:="/var/log/prometheus.log"} >+: ${prometheus_data_dir:="%%PROMETHEUS_DB_DIR%%"} >+: ${prometheus_consoles_dir:="%%PROMETHEUS_CONSOLES_DIR%%"} >+: ${prometheus_console_libraries_dir:="%%PROMETHEUS_CONSOLE_LIBRARIES_DIR%%"} > : ${prometheus_args:=""} > > pidfile="/var/run/${name}.pid" >@@ -41,10 +51,13 @@ command="/usr/sbin/daemon" > procname="%%PREFIX%%/bin/${name}" > sig_reload="HUP" > extra_commands="reload" >-command_args="-p ${pidfile} /usr/bin/env ${procname} \ >+command_args="-p ${pidfile} -m 3 -T ${name} \ >+ /usr/bin/env ${procname} \ > --config.file=${prometheus_config} \ > --storage.tsdb.path=${prometheus_data_dir} \ >- ${prometheus_args} >> ${prometheus_log_file} 2>&1" >+ --web.console.templates=${prometheus_consoles_dir} \ >+ --web.console.libraries=${prometheus_console_libraries_dir} \ >+ ${prometheus_args}" > > start_precmd=prometheus_startprecmd > >@@ -73,13 +86,6 @@ prometheus_startprecmd() > -g ${prometheus_group} \ > /dev/null ${pidfile}; > fi >- if [ ! -f "${prometheus_log_file}" ]; then >- install \ >- -o ${prometheus_user} \ >- -g ${prometheus_group} \ >- -m 640 \ >- /dev/null ${prometheus_log_file}; >- fi > if [ ! -d ${prometheus_data_dir} ]; then > install \ > -d \ >diff --git a/net-mgmt/prometheus2/files/syslog.d.conf.in b/net-mgmt/prometheus2/files/syslog.d.conf.in >new file mode 100644 >index 000000000000..36f10d3c31bc >--- /dev/null >+++ b/net-mgmt/prometheus2/files/syslog.d.conf.in >@@ -0,0 +1,5 @@ >+# syslogd(8) configuration file for net-mgmt/prometheus2 >+# >+# See syslog.conf(5) for details. >+!prometheus >+daemon.* %%PROMETHEUS_LOG_FILE%% >diff --git a/net-mgmt/prometheus2/pkg-plist b/net-mgmt/prometheus2/pkg-plist >index 39ce271e8e86..b79cda9ae94a 100644 >--- a/net-mgmt/prometheus2/pkg-plist >+++ b/net-mgmt/prometheus2/pkg-plist >@@ -1,4 +1,16 @@ > bin/prometheus > bin/promtool >+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/newsyslog.conf >+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/syslog.d.conf >+%%PROMETHEUS_CONSOLE_LIBRARIES_DIR%%/menu.lib >+%%PROMETHEUS_CONSOLE_LIBRARIES_DIR%%/prom.lib >+%%PROMETHEUS_CONSOLES_DIR%%/index.html.example >+%%PROMETHEUS_CONSOLES_DIR%%/node-cpu.html >+%%PROMETHEUS_CONSOLES_DIR%%/node-disk.html >+%%PROMETHEUS_CONSOLES_DIR%%/node-overview.html >+%%PROMETHEUS_CONSOLES_DIR%%/node.html >+%%PROMETHEUS_CONSOLES_DIR%%/prometheus-overview.html >+%%PROMETHEUS_CONSOLES_DIR%%/prometheus.html > @sample etc/prometheus.yml.sample >-@dir(prometheus,prometheus) /var/db/prometheus >+@dir(prometheus,prometheus) %%PROMETHEUS_DB_DIR%% >+@dir(root,root) %%PROMETHEUS_LOG_DIR%%
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dor.bsd
:
maintainer-approval+
Actions:
View
|
Diff
Attachments on
bug 228185
:
193310
|
193442
|
194094
|
194564