Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/promscale: init #97372

Closed

Conversation

0x4A6F
Copy link
Member

@0x4A6F 0x4A6F commented Sep 7, 2020

Motivation for this change

Enable service for timescale-prometheus.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@0x4A6F 0x4A6F force-pushed the master-timescale-prometheus-service branch 3 times, most recently from c53f3cb to 794ffe5 Compare September 10, 2020 16:57
Copy link
Member

@aanderse aanderse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking care of the password issue!

I have taken the time to actually give this module a review now. I hope at least some of the comments are helpful.

'';
};

db-connect-retries = mkOption {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, purely a style thing, feel free to ignore 100% and then some but... I think most modules typically use a database. prefix for database related options, something like

database = {
  connect-retries = mkOption { ... };
  host = mkOption { ... };
  name = mkOption { ... };
};

Consistency is always nice.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm going to stray away from original commandline argument mapping, I'd first should get rid of web-listen-address and use listenAddress and listenPort instead.

nixos/modules/services/monitoring/timescale-prometheus.nix Outdated Show resolved Hide resolved
nixos/modules/services/monitoring/timescale-prometheus.nix Outdated Show resolved Hide resolved
nixos/modules/services/monitoring/timescale-prometheus.nix Outdated Show resolved Hide resolved
nixos/modules/services/monitoring/timescale-prometheus.nix Outdated Show resolved Hide resolved
nixos/modules/services/monitoring/timescale-prometheus.nix Outdated Show resolved Hide resolved
nixos/modules/services/monitoring/timescale-prometheus.nix Outdated Show resolved Hide resolved
nixos/modules/services/monitoring/timescale-prometheus.nix Outdated Show resolved Hide resolved
nixos/tests/timescale-prometheus.nix Outdated Show resolved Hide resolved
nixos/tests/timescale-prometheus.nix Outdated Show resolved Hide resolved
Copy link
Member Author

@0x4A6F 0x4A6F left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your review.

nixos/modules/services/monitoring/timescale-prometheus.nix Outdated Show resolved Hide resolved
nixos/modules/services/monitoring/timescale-prometheus.nix Outdated Show resolved Hide resolved
'';
};

db-connect-retries = mkOption {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm going to stray away from original commandline argument mapping, I'd first should get rid of web-listen-address and use listenAddress and listenPort instead.

nixos/modules/services/monitoring/timescale-prometheus.nix Outdated Show resolved Hide resolved
nixos/modules/services/monitoring/timescale-prometheus.nix Outdated Show resolved Hide resolved
nixos/modules/services/monitoring/timescale-prometheus.nix Outdated Show resolved Hide resolved
nixos/modules/services/monitoring/timescale-prometheus.nix Outdated Show resolved Hide resolved
@aanderse
Copy link
Member

Changes are looking good. I left a few minor comments.

I should have asked before but made the assumption it cannot... so I'll ask now: can this program accept a configuration file instead of environment variables?

@0x4A6F 0x4A6F force-pushed the master-timescale-prometheus-service branch from 2bd44f8 to 1071d7c Compare September 12, 2020 17:54
Copy link
Member

@aanderse aanderse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. Do we have any subject matter experts in the community that can give this a quick one over? From my perspective we're pretty much ready for a merge 👍

@0x4A6F
Copy link
Member Author

0x4A6F commented Sep 20, 2020

Thanks, MR is updated addressing your suggestions.

I should also extend services.prometheus with remote_write and remote_read. Probably in another MR #99180, when ready to merge this one.

Copy link
Member

@aanderse aanderse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me but you need someone who knows more about prometheus to review this before merge please.

@0x4A6F 0x4A6F force-pushed the master-timescale-prometheus-service branch from c395a6e to e066be5 Compare October 6, 2020 16:19
@0x4A6F 0x4A6F changed the title nixos/timescale-prometheus: init nixos/promscale: init Oct 6, 2020
@0x4A6F
Copy link
Member Author

0x4A6F commented Oct 6, 2020

I've updated again to reflect the project rename to promscale, depends on #99875.

Thanks for your review. TIme to search for our prometheus experts.
Wondering, it this is better placed in nixos/modules/services/monitoring/prometheus/promscale.nix.

@aanderse
Copy link
Member

aanderse commented Oct 6, 2020

You might consider mentioning this on one of the discourse threads.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/324

# "-web-cors-origin example.com/public/.*" # corsOrigin:0xc00016dea0
];
services.postgresql = {
authentication = pkgs.lib.mkOverride 10 ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can probably get rid of this by using /run/postgresql/ as "host" in this test. By default postgresql uses the unix user that connects (on NixOS)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't seem to work without authentication set and db-host = "/run/postgresql/";.
Seems with these settings promscale is started before postgres is up.

@0x4A6F
Copy link
Member Author

0x4A6F commented Oct 29, 2020

Currently with promscale 0.1.1 (#102013) the test breaks, because of postgres version mismatch.
Now it needs postgresql 12, tested with following in my local branch:

--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix

-  postgresql = postgresql_11.override { this = postgresql; };
+  postgresql = postgresql_12.override { this = postgresql; };
   postgresqlPackages = recurseIntoAttrs postgresql.pkgs;
   postgresql11Packages = pkgs.postgresqlPackages;
+  postgresql12Packages = pkgs.postgresqlPackages;

@andir
Copy link
Member

andir commented Oct 30, 2020 via email

@stale
Copy link

stale bot commented Jun 4, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 4, 2021
@JamesGuthrie
Copy link
Contributor

@0x4A6F I am taking a look at using this with the latest version of promscale. Are you interested in continuing work on this change? I could support you in getting it merged if so.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 1, 2021
@0x4A6F
Copy link
Member Author

0x4A6F commented Dec 9, 2021

@JamesGuthrie Yes, but last time I looked at it timescaledb extension was broken for newer PostgreSQL versions.

P.S.: We can move to chat. My contact details are in maintainers/maintainer-list.nix.

@benpye
Copy link
Contributor

benpye commented Feb 4, 2022

This looks possible now, as of 2.5.0 timescaledb supports PostgreSQL 14 and promscale 0.7.0 adds support. I've gotten this working in my flake - https://github.com/benpye/nix-config/blob/main/modules/services/promscale.nix . Do you want to try and update this PR or are you happy if I try and submit my version?

Next on my list is to try and get the promscale extension building too.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 13, 2022
@0x4A6F
Copy link
Member Author

0x4A6F commented Apr 11, 2023

Deprecated upstream.

@0x4A6F 0x4A6F closed this Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants