Add prometheus #118

Merged
esy merged 27 commits from prometheus2 into main 2024-05-23 21:52:10 +00:00
esy commented 2024-05-21 06:16:07 +00:00 (Migrated from gitlab.skynet.ie)

Should give data to grafana through provision
Few things probably need to be changed regarding the prometheus server config and provision config

Should give data to grafana through provision Few things probably need to be changed regarding the prometheus server config and provision config
silver commented 2024-05-21 06:29:08 +00:00 (Migrated from gitlab.skynet.ie)

There is an automatic way to do this, I'll show ye this evening

There is an automatic way to do this, I'll show ye this evening
silver commented 2024-05-21 06:29:08 +00:00 (Migrated from gitlab.skynet.ie)

Since ye are defining collecter_port on L31 try targets = map (server: "${server}.skynet.ie:${cfg.collecter_port}") cfg.servers;

Since ye are defining ``collecter_port`` on L31 try ``targets = map (server: "${server}.skynet.ie:${cfg.collecter_port}") cfg.servers;``
silver commented 2024-05-21 06:29:08 +00:00 (Migrated from gitlab.skynet.ie)

THis should be services.skynet.prometheus.servers not services.skynet.prometheus.server.servers.

And as remarked earlier there is a way to automagically get these.
Take a look at this:
https://colmena.cli.rs/unstable/tutorial/index.html?highlight=nodes#basic-configuration
time.timeZone = nodes.host-b.config.time.timeZone;

THis should be ``services.skynet.prometheus.servers`` not ``services.skynet.prometheus.server.servers``. And as remarked earlier there is a way to automagically get these. Take a look at this: https://colmena.cli.rs/unstable/tutorial/index.html?highlight=nodes#basic-configuration ``time.timeZone = nodes.host-b.config.time.timeZone;``
silver commented 2024-05-21 06:29:09 +00:00 (Migrated from gitlab.skynet.ie)

Looks good for a start.
Ill talk to ye this evening

Looks good for a start. Ill talk to ye this evening
esy commented 2024-05-21 06:32:41 +00:00 (Migrated from gitlab.skynet.ie)

changed this line in version 2 of the diff

changed this line in [version 2 of the diff](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=492&start_sha=183f5a0e7df037e0e16cbb2f417ae7b932378157#9a2ed875c4d10e07769eaf3d67c02e077287e1a1_39_39)
esy commented 2024-05-21 06:32:41 +00:00 (Migrated from gitlab.skynet.ie)

added 1 commit

Compare with previous version

added 1 commit <ul><li>4637777e - Fix servers list location</li></ul> [Compare with previous version](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=492&start_sha=183f5a0e7df037e0e16cbb2f417ae7b932378157)
esy commented 2024-05-21 06:34:57 +00:00 (Migrated from gitlab.skynet.ie)

changed this line in version 3 of the diff

changed this line in [version 3 of the diff](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=494&start_sha=4637777e5c9d5c532870a4a70b838f536bcdaa45#9a2ed875c4d10e07769eaf3d67c02e077287e1a1_59_59)
esy commented 2024-05-21 06:34:57 +00:00 (Migrated from gitlab.skynet.ie)

added 1 commit

Compare with previous version

added 1 commit <ul><li>7f5f21dc - Use port from cfg</li></ul> [Compare with previous version](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=494&start_sha=4637777e5c9d5c532870a4a70b838f536bcdaa45)
esy commented 2024-05-21 06:37:26 +00:00 (Migrated from gitlab.skynet.ie)

The error about servers was from prometheus.nix, fixed it in a recent commit. Unless your not talking about error from failed pipeline

The error about servers was from prometheus.nix, fixed it in a recent commit. Unless your not talking about error from failed pipeline
silver commented 2024-05-21 07:07:41 +00:00 (Migrated from gitlab.skynet.ie)

Ha, that is one way to fix it.
Although the location you had it was better from a schematic point of view.

prometheus.server.servers
vs
prometheus.servers

Ha, that is one way to fix it. Although the location you had it was better from a schematic point of view. prometheus.server.servers vs prometheus.servers
esy commented 2024-05-21 17:25:22 +00:00 (Migrated from gitlab.skynet.ie)

changed this line in version 4 of the diff

changed this line in [version 4 of the diff](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=497&start_sha=7f5f21dc8a796ce836f01120df20f4ddf43ab142#777219a51b4d614f5aeb0fe8703ff52b85af9861_63_62)
esy commented 2024-05-21 17:25:23 +00:00 (Migrated from gitlab.skynet.ie)

added 1 commit

  • cf600e2d - Using nodes instead of hardcoded server names

Compare with previous version

added 1 commit <ul><li>cf600e2d - Using nodes instead of hardcoded server names</li></ul> [Compare with previous version](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=497&start_sha=7f5f21dc8a796ce836f01120df20f4ddf43ab142)
esy commented 2024-05-21 17:33:58 +00:00 (Migrated from gitlab.skynet.ie)

added 2 commits

Compare with previous version

added 2 commits <ul><li>be56e6b9 - Reorganise prometheus/marvin config</li><li>82305d43 - fmt</li></ul> [Compare with previous version](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=499&start_sha=cf600e2dc10e08d5ef351e836db7a6d64e45b41f)
esy commented 2024-05-21 17:42:34 +00:00 (Migrated from gitlab.skynet.ie)

Changed the server/servers around in prometheus config, now giving server names through nodes-
servers = lib.attrsets.mapAttrsToList (server: server.name) nodes;
Is this what you meant?

Changed the server/servers around in prometheus config, now giving server names through nodes- `servers = lib.attrsets.mapAttrsToList (server: server.name) nodes;` Is this what you meant?
silver commented 2024-05-21 20:59:37 +00:00 (Migrated from gitlab.skynet.ie)

Took a look at it and name is not an attribute, however deployment is, and inside deployment there is hostname

Took a look at it and name is not an attribute, however ``deployment`` is, and inside deployment there is ``hostname``
silver commented 2024-05-21 21:01:19 +00:00 (Migrated from gitlab.skynet.ie)

ye dont have to do this here, you can do it inside prometheus.nix

What would be useful is a place toa dd extra nodes, not handled by nix (we have two of those, game servers)

ye dont have to do this here, you can do it inside prometheus.nix What would be useful is a place toa dd extra nodes, not handled by nix (we have two of those, game servers)
silver commented 2024-05-21 21:03:08 +00:00 (Migrated from gitlab.skynet.ie)

{collecter_port} -> ${collecter_port}

If ye take my other comment of hostname then ye wont need the .skynet.ie

``{collecter_port}`` -> ``${collecter_port}`` If ye take my other comment of hostname then ye wont need the ``.skynet.ie``
esy commented 2024-05-22 00:51:28 +00:00 (Migrated from gitlab.skynet.ie)

changed this line in version 6 of the diff

changed this line in [version 6 of the diff](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=501&start_sha=82305d43ff1c941bc22294cd106ead312d7fb412#777219a51b4d614f5aeb0fe8703ff52b85af9861_56_56)
esy commented 2024-05-22 00:51:28 +00:00 (Migrated from gitlab.skynet.ie)

changed this line in version 6 of the diff

changed this line in [version 6 of the diff](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=501&start_sha=82305d43ff1c941bc22294cd106ead312d7fb412#9a2ed875c4d10e07769eaf3d67c02e077287e1a1_60_63)
esy commented 2024-05-22 00:51:28 +00:00 (Migrated from gitlab.skynet.ie)

added 1 commit

  • 9b3e7265 - Added new option to specify ip and port for other nodes, fixed server.name to...

Compare with previous version

added 1 commit <ul><li>9b3e7265 - Added new option to specify ip and port for other nodes, fixed server.name to...</li></ul> [Compare with previous version](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=501&start_sha=82305d43ff1c941bc22294cd106ead312d7fb412)
esy commented 2024-05-22 00:54:49 +00:00 (Migrated from gitlab.skynet.ie)

Added another option to the config that should allow for this I think

Added another option to the config that should allow for this I think
esy commented 2024-05-22 00:55:03 +00:00 (Migrated from gitlab.skynet.ie)

Should be good now

Should be good now
silver commented 2024-05-22 23:31:53 +00:00 (Migrated from gitlab.skynet.ie)

Am I right in thinking that this currentyl does nothing?
What was teh original intention?

Am I right in thinking that this currentyl does nothing? What was teh original intention?
silver commented 2024-05-22 23:35:17 +00:00 (Migrated from gitlab.skynet.ie)

Would ye be able to add brackets so its easier to see what is being used in each map function?

Would ye be able to add brackets so its easier to see what is being used in each map function?
silver commented 2024-05-22 23:37:19 +00:00 (Migrated from gitlab.skynet.ie)

This might notbe useful here but I tend to go {type}_{name}.
For example port_collector.

Its mroe useful though when ye have a lot of vars in code though, less so for this.

This might notbe useful here but I tend to go ``{type}_{name}``. For example ``port_collector``. Its mroe useful though when ye have a lot of vars in code though, less so for this.
silver commented 2024-05-22 23:39:26 +00:00 (Migrated from gitlab.skynet.ie)

If its the same as the default is there any real need to specify?

If its the same as the default is there any real need to specify?
silver commented 2024-05-22 23:39:50 +00:00 (Migrated from gitlab.skynet.ie)

Very nice :D

Very nice :D
esy commented 2024-05-23 00:21:46 +00:00 (Migrated from gitlab.skynet.ie)

changed this line in version 7 of the diff

changed this line in [version 7 of the diff](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=503&start_sha=9b3e7265dd4e9e29a8663bfd4e5b753022012fc7#7397df16104694d32d00a71646ef3c395e613ef5_31_28)
esy commented 2024-05-23 00:21:46 +00:00 (Migrated from gitlab.skynet.ie)

changed this line in version 7 of the diff

changed this line in [version 7 of the diff](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=503&start_sha=9b3e7265dd4e9e29a8663bfd4e5b753022012fc7#9a2ed875c4d10e07769eaf3d67c02e077287e1a1_63_63)
esy commented 2024-05-23 00:21:46 +00:00 (Migrated from gitlab.skynet.ie)

added 2 commits

Compare with previous version

added 2 commits <ul><li>ca872275 - remove redundant option</li><li>11308414 - Make map clearer, more parentheses</li></ul> [Compare with previous version](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=503&start_sha=9b3e7265dd4e9e29a8663bfd4e5b753022012fc7)
esy commented 2024-05-23 00:27:14 +00:00 (Migrated from gitlab.skynet.ie)

changed this line in version 8 of the diff

changed this line in [version 8 of the diff](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=505&start_sha=113084148c209fddfedba9d3b36ad4fe2cbc091c#9a2ed875c4d10e07769eaf3d67c02e077287e1a1_39_39)
esy commented 2024-05-23 00:27:14 +00:00 (Migrated from gitlab.skynet.ie)

changed this line in version 8 of the diff

changed this line in [version 8 of the diff](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=505&start_sha=113084148c209fddfedba9d3b36ad4fe2cbc091c#777219a51b4d614f5aeb0fe8703ff52b85af9861_62_61)
esy commented 2024-05-23 00:27:15 +00:00 (Migrated from gitlab.skynet.ie)

added 1 commit

  • 1ea703bf - Removed redundant conf, rename portcollecter

Compare with previous version

added 1 commit <ul><li>1ea703bf - Removed redundant conf, rename portcollecter</li></ul> [Compare with previous version](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=505&start_sha=113084148c209fddfedba9d3b36ad4fe2cbc091c)
esy commented 2024-05-23 00:31:00 +00:00 (Migrated from gitlab.skynet.ie)

ye its dead code, was there originally when i wasnt using host option

ye its dead code, was there originally when i wasnt using host option
esy commented 2024-05-23 00:51:22 +00:00 (Migrated from gitlab.skynet.ie)

Is this all that needs to be done for the nodes to be setup on each machine?

Is this all that needs to be done for the nodes to be setup on each machine?
silver commented 2024-05-23 00:53:05 +00:00 (Migrated from gitlab.skynet.ie)

Yep!

Yep!
silver commented 2024-05-23 01:01:10 +00:00 (Migrated from gitlab.skynet.ie)

One more thing before its finalised, take a look at services.grafana.settings.security.admin_password

One more thing before its finalised, take a look at ``services.grafana.settings.security.admin_password``
silver commented 2024-05-23 01:08:12 +00:00 (Migrated from gitlab.skynet.ie)

I would also recommend shifting it to kitt as well, its kinda becoming teh administrative server

I would also recommend shifting it to ``kitt`` as well, its kinda becoming teh administrative server
esy commented 2024-05-23 01:13:28 +00:00 (Migrated from gitlab.skynet.ie)

changed this line in version 9 of the diff

changed this line in [version 9 of the diff](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=507&start_sha=1ea703bfa13da4bbcfa4a897ce8434c9bbb00f6a#777219a51b4d614f5aeb0fe8703ff52b85af9861_75_53)
esy commented 2024-05-23 01:13:28 +00:00 (Migrated from gitlab.skynet.ie)

resolved all threads

resolved all threads
esy commented 2024-05-23 01:13:29 +00:00 (Migrated from gitlab.skynet.ie)

added 3 commits

Compare with previous version

added 3 commits <ul><li>9aeb7313 - Moved grafana / prometheus to kitt</li><li>fd3beade - Added entry in secrets.nix for grafana</li><li>40e4fe5a - fmt</li></ul> [Compare with previous version](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=507&start_sha=1ea703bfa13da4bbcfa4a897ce8434c9bbb00f6a)
silver commented 2024-05-23 01:39:53 +00:00 (Migrated from gitlab.skynet.ie)

added 1 commit

  • 23f77cae - feat: setup the password for grafana

Compare with previous version

added 1 commit <ul><li>23f77cae - feat: setup the password for grafana</li></ul> [Compare with previous version](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=509&start_sha=40e4fe5ac487aab5e3f2d05d63dd9633d9cad675)
silver commented 2024-05-23 01:41:28 +00:00 (Migrated from gitlab.skynet.ie)

Is this actually used? *ye got just port down below)

Is this actually used? *ye got just ``port`` down below)
esy commented 2024-05-23 01:45:22 +00:00 (Migrated from gitlab.skynet.ie)

changed this line in version 11 of the diff

changed this line in [version 11 of the diff](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=511&start_sha=23f77caef60dc506217631b99975d83e0af31301#7397df16104694d32d00a71646ef3c395e613ef5_31_28)
esy commented 2024-05-23 01:45:22 +00:00 (Migrated from gitlab.skynet.ie)

resolved all threads

resolved all threads
esy commented 2024-05-23 01:45:22 +00:00 (Migrated from gitlab.skynet.ie)

added 1 commit

Compare with previous version

added 1 commit <ul><li>061453e5 - remove dead code</li></ul> [Compare with previous version](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=511&start_sha=23f77caef60dc506217631b99975d83e0af31301)
silver commented 2024-05-23 01:48:50 +00:00 (Migrated from gitlab.skynet.ie)

Does this still need to be here?

Does this still need to be here?
esy commented 2024-05-23 01:52:37 +00:00 (Migrated from gitlab.skynet.ie)

image seems like none of them need to be there, should i remove them all?

![image](/uploads/c752dc2bc331e7f751d7180cd5189cf7/image.png) seems like none of them need to be there, should i remove them all?
esy commented 2024-05-23 01:57:16 +00:00 (Migrated from gitlab.skynet.ie)

changed this line in version 12 of the diff

changed this line in [version 12 of the diff](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=513&start_sha=061453e5d19b1bdc0f95a4c29b6f159661963600#777219a51b4d614f5aeb0fe8703ff52b85af9861_13_13)
esy commented 2024-05-23 01:57:16 +00:00 (Migrated from gitlab.skynet.ie)

resolved all threads

resolved all threads
esy commented 2024-05-23 01:57:16 +00:00 (Migrated from gitlab.skynet.ie)

added 1 commit

Compare with previous version

added 1 commit <ul><li>03ae1c51 - Remove config from marvin</li></ul> [Compare with previous version](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=513&start_sha=061453e5d19b1bdc0f95a4c29b6f159661963600)
silver commented 2024-05-23 03:20:55 +00:00 (Migrated from gitlab.skynet.ie)

added 6 commits

  • 0f75f119 - fix: this was blocking teh web interface
  • aba1a41d - fix: file permissions
  • 62ead11a - fix: have to actually enable it
  • 15271c1d - fix: this does need a default
  • b8c6e153 - fix: set the type of protocol
  • 9148963c - fix: final set of changes to get it working

Compare with previous version

added 6 commits <ul><li>0f75f119 - fix: this was blocking teh web interface</li><li>aba1a41d - fix: file permissions</li><li>62ead11a - fix: have to actually enable it</li><li>15271c1d - fix: this does need a default</li><li>b8c6e153 - fix: set the type of protocol</li><li>9148963c - fix: final set of changes to get it working</li></ul> [Compare with previous version](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=515&start_sha=03ae1c5101558dfefea4fd21f079ce1e15bf4484)
esy commented 2024-05-23 03:34:25 +00:00 (Migrated from gitlab.skynet.ie)

added 1 commit

  • 963a189b - Removed provision config away from kitt

Compare with previous version

added 1 commit <ul><li>963a189b - Removed provision config away from kitt</li></ul> [Compare with previous version](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=517&start_sha=9148963c1f6d3ee6569d084737247450d0863b70)
silver commented 2024-05-23 20:48:54 +00:00 (Migrated from gitlab.skynet.ie)

added 1 commit

  • 147bd86a - fix: get the attributes merging correctly

Compare with previous version

added 1 commit <ul><li>147bd86a - fix: get the attributes merging correctly</li></ul> [Compare with previous version](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=519&start_sha=963a189bcbaa93177df7c6bf21d6b4730d4b7a63)
silver commented 2024-05-23 21:04:35 +00:00 (Migrated from gitlab.skynet.ie)

added 1 commit

  • f7dd90e9 - fix: needed to open teh ports to be able to get the data

Compare with previous version

added 1 commit <ul><li>f7dd90e9 - fix: needed to open teh ports to be able to get the data</li></ul> [Compare with previous version](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=521&start_sha=147bd86ad56dbd9363eea6a6b95f17092cd48ac0)
esy commented 2024-05-23 21:34:20 +00:00 (Migrated from gitlab.skynet.ie)

added 1 commit

  • 889bb0da - doc: added link to node exporter options

Compare with previous version

added 1 commit <ul><li>889bb0da - doc: added link to node exporter options</li></ul> [Compare with previous version](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=523&start_sha=f7dd90e92ba331a40c03f7bfc25a7888da5324ca)
esy commented 2024-05-23 21:35:38 +00:00 (Migrated from gitlab.skynet.ie)

changed this line in version 18 of the diff

changed this line in [version 18 of the diff](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=525&start_sha=889bb0dab6cb03db010e4aebce3bdcde70778ea0#2dd4155673b1ea021dfd4a722198be6955291d82_35_35)
esy commented 2024-05-23 21:35:38 +00:00 (Migrated from gitlab.skynet.ie)

added 1 commit

Compare with previous version

added 1 commit <ul><li>c0816ccc - remove todo</li></ul> [Compare with previous version](/compsoc1/skynet/nixos/-/merge_requests/33/diffs?diff_id=525&start_sha=889bb0dab6cb03db010e4aebce3bdcde70778ea0)
silver commented 2024-05-23 21:50:46 +00:00 (Migrated from gitlab.skynet.ie)

approved this merge request

approved this merge request
silver commented 2024-05-23 21:52:10 +00:00 (Migrated from gitlab.skynet.ie)

mentioned in commit 694cbb2f0b

mentioned in commit 694cbb2f0b90027dd61c6ee5d7b1815ef5d50eb1
silver (Migrated from gitlab.skynet.ie) merged commit 694cbb2f0b into main 2024-05-23 21:52:10 +00:00
silver (Migrated from gitlab.skynet.ie) approved these changes 2024-08-06 19:16:50 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Skynet/nixos#118
No description provided.