Bug 225169 - New Port: net-mgmt/prometheus2: Systems monitoring and alerting toolkit
Summary: New Port: net-mgmt/prometheus2: Systems monitoring and alerting toolkit
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Brad Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-14 22:10 UTC by David O'Rourke
Modified: 2018-03-30 22:42 UTC (History)
2 users (show)

See Also:


Attachments
net-mgmt/prometheus2.shar (7.22 KB, text/plain)
2018-01-14 22:10 UTC, David O'Rourke
no flags Details
net-mgmt/prometheus2.shar (7.22 KB, text/plain)
2018-01-23 23:33 UTC, David O'Rourke
dor.bsd: maintainer-approval+
Details
net-mgmt/prometheus2: New port (7.49 KB, text/plain)
2018-01-24 14:53 UTC, David O'Rourke
dor.bsd: maintainer-approval+
Details
net-mgmt/prometheus2: New port (7.44 KB, patch)
2018-01-24 15:44 UTC, David O'Rourke
dor.bsd: maintainer-approval+
Details | Diff
net-mgmt/prometheus2: New port (8.98 KB, text/plain)
2018-02-02 00:15 UTC, David O'Rourke
dor.bsd: maintainer-approval+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David O'Rourke 2018-01-14 22:10:45 UTC
Created attachment 189721 [details]
net-mgmt/prometheus2.shar

This bug report adds a new net-mgmt/prometheus2 port.

This is required due to the way the upgrade path is to be handled when migrating from Prometheus 1.x, which requires both services to run side by side for the period of the migration.

As this is the case, it is not possible to simply upgrade the existing net-mgmt/prometheus package and because of this, the prometheus2 package does NOT conflict with the prometheus package, as both are required to be installed together.

Details of the migration path can be found at https://prometheus.io/docs/prometheus/latest/migration/ and this has been mentioned in the pkg-message file.
Comment 1 David O'Rourke 2018-01-23 23:33:49 UTC
Created attachment 190019 [details]
net-mgmt/prometheus2.shar

Updates the shar to version 2.1.0 of Prometheus.
Comment 2 David O'Rourke 2018-01-24 14:53:14 UTC
Created attachment 190030 [details]
net-mgmt/prometheus2: New port

Further improvement to the build to correct some missing build information in the compiled binary.

This build information shows up under ${PROMETHEUS_URL}/status once the instance is up and running.

This build fix will also be submitted to net-mgmt/prometheus shortly, as it suffers from the same issue.
Comment 3 David O'Rourke 2018-01-24 15:44:49 UTC
Created attachment 190035 [details]
net-mgmt/prometheus2: New port

Updates based on build reproducability after speaking with jevonearth.
Comment 4 jevonearth 2018-01-24 15:51:14 UTC
Any movement on getting this committed to ports? New users of prometheus will avoid a lot of work by adopting 2.x immediately. David's work LGTM, for what it is worth. ;)
Comment 5 Brad Davis freebsd_committer freebsd_triage 2018-02-01 01:13:03 UTC
(In reply to jevonearth from comment #4)
Hello jevonearth,

What do you think about changing the PORTNAME of net-mgmt/prometheus to PORTNAME=prometheus1, so that this new port could be PORTNAME=prometheus to help out new users of the tool?  It could make upgrades somewhat problematic, but the pkg-message would point people in the right direction.


Thanks,
Brad
Comment 6 jevonearth 2018-02-01 01:15:07 UTC
(In reply to Brad Davis from comment #5)
I fully support this!
Comment 7 David O'Rourke 2018-02-01 20:57:21 UTC
My current plans here are:

 - Set PORTNAME=prometheus
 - Change things in this port so that it takes over all of the `prometheus_` rcconf variables.
 - Set rcconf defaults to `prometheus` variants of what they are currently.
 - The init script for this port will check the $prometheus_data_dir that is set, and if it finds a `VERSION` file containing `1`, it will exit with an error status and without starting Prometheus.
   This should ensure that Prometheus 2 doesn't do anything to endanger the historical Prometheus 1 data, and allows the user to either move the directory out of the way, if they wish to perform the "migration", or simply delete it if they don't care.

On the Prometheus 1 side:

 - Set PORTNAME=prometheus1
 - Move rcconf variables to `prometheus1_`.
 - Set defaults for rcconf variables to `prometheus1` variants of what ever they're currently set to.
 - Add a pkg-message to prometheus1 explaining a little about the migration, the rcconf variable name changes and moving configs/directories around if needed.

Both ports should receive some pkg-message information:
 - Pointing to the main Prometheus migration documentation.
 - Explain the FreeBSD specific steps.

The flow for upgrading here for a user that DID NOT want to upgrade to Prometheus 2 yet should look like the following:

 a) They read ahead of time what was happening and simply didn't upgrade the prometheus package.
 b) They upgraded and attempted to restart prometheus, it's fine because the init script refused to start Prometheus 2 with an old data directory.
 c) Ahead of time, they read what was happening, and prepare themselves to move to the prometheus1 package.

Users wishing to upgrade to Prometheus 2 and "migrate":
 - Upgrade and see that prometheus won't restart because of the data dir checking. They should refer to pkg-message instructions on upgrading, install prometheus1 package, move rcconf variables over, etc.

Users withing to upgrade to Prometheus 2 and not "migrate" (they want to lose old data):
 - Update, see that Prometheus won't start, delete and recreate data dir, start Prometheus.
Comment 8 David O'Rourke 2018-02-02 00:15:25 UTC
Created attachment 190261 [details]
net-mgmt/prometheus2: New port

This shar contains a port for Prometheus 2 with everything updated for PORTNAME=prometheus.

A check was added to the init script to ensure that Prometheus 2 doesn't start if its data dir is set to an existing Prometheus 1 data dir.

A brief description for migrating from Prometheus 1 to Prometheus 2 was added to the pkg-message.

The shar creates the port as net-mgmt/prometheus2, the port committer should move it into place after the existing net-mgmt/prometheus has been moved to net-mgmt/prometheus1.

A patch will soon be submitted to net-mgmt/prometheus preparing it for being moved to net-mgmt/prometheus1.
Comment 9 commit-hook freebsd_committer freebsd_triage 2018-02-14 21:59:05 UTC
A commit references this bug:

Author: brd
Date: Wed Feb 14 21:58:39 UTC 2018
New revision: 461844
URL: https://svnweb.freebsd.org/changeset/ports/461844

Log:
  Add net-mgmt/prometheus2

  Rename prometheus to prometheus1 so they can coexist since upgrading is
  non-trival:

  https://prometheus.io/docs/prometheus/2.0/migration/

  PR:		225169
  Submitted by:	David O'Rourke <dor.bsd@xm0.uk>
  Reviewed by:	swills

Changes:
  head/MOVED
  head/net-mgmt/Makefile
  head/net-mgmt/prometheus/
  head/net-mgmt/prometheus1/
  head/net-mgmt/prometheus1/Makefile
  head/net-mgmt/prometheus2/
  head/net-mgmt/prometheus2/Makefile
  head/net-mgmt/prometheus2/distinfo
  head/net-mgmt/prometheus2/files/
  head/net-mgmt/prometheus2/files/prometheus.in
  head/net-mgmt/prometheus2/pkg-descr
  head/net-mgmt/prometheus2/pkg-message
  head/net-mgmt/prometheus2/pkg-plist
Comment 10 commit-hook freebsd_committer freebsd_triage 2018-03-30 22:30:03 UTC
A commit references this bug:

Author: brd
Date: Fri Mar 30 22:29:50 UTC 2018
New revision: 466009
URL: https://svnweb.freebsd.org/changeset/ports/466009

Log:
  Remove to fix history

  PR:		225169
  Reported by:	mat

Changes:
  head/net-mgmt/prometheus2/
Comment 11 commit-hook freebsd_committer freebsd_triage 2018-03-30 22:35:10 UTC
A commit references this bug:

Author: brd
Date: Fri Mar 30 22:34:10 UTC 2018
New revision: 466011
URL: https://svnweb.freebsd.org/changeset/ports/466011

Log:
  Readd prometheus2 with corrected history.

  PR:		225169

Changes:
  head/net-mgmt/prometheus2/
  head/net-mgmt/prometheus2/Makefile
  head/net-mgmt/prometheus2/distinfo
  head/net-mgmt/prometheus2/files/prometheus.in
  head/net-mgmt/prometheus2/pkg-descr