Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PrivateStorageio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tom Prince
PrivateStorageio
Commits
c605f391
Commit
c605f391
authored
3 years ago
by
Tom Prince
Browse files
Options
Downloads
Patches
Plain Diff
Stop using `/etc/hosts` to name the monitoring host.
parent
4a28b54e
Branches
dont-use-etc-hosts
No related tags found
No related merge requests found
Pipeline
#1821
failed
3 years ago
Stage: build
Stage: test
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
morph/lib/base.nix
+15
-7
15 additions, 7 deletions
morph/lib/base.nix
morph/lib/monitoring.nix
+5
-0
5 additions, 0 deletions
morph/lib/monitoring.nix
nixos/modules/monitoring/exporters/promtail.nix
+7
-1
7 additions, 1 deletion
nixos/modules/monitoring/exporters/promtail.nix
with
27 additions
and
8 deletions
morph/lib/base.nix
+
15
−
7
View file @
c605f391
...
...
@@ -18,6 +18,12 @@
corresponding private keys for the system.
''
;
};
monitoringEndpoint
=
lib
.
mkOption
{
type
=
lib
.
types
.
str
;
description
=
''
The IPv4 address of the monitoring node this node should conenct to.
''
;
};
monitoringvpnIPv4
=
lib
.
mkOption
{
type
=
lib
.
types
.
str
;
description
=
''
...
...
@@ -57,15 +63,17 @@
# qualified domain name.
deployment
.
targetHost
=
config
.
networking
.
fqdn
;
networking
.
hosts
=
{
# This is the host that nodes should connect to for push-based monitoring.
# Note that this needs to be overridden on the monitoring host, otherwise
# we'd end up with infinite recursion.
grid
.
monitoringEndpoint
=
nodes
.
monitoring
.
config
.
grid
.
monitoringEndpoint
;
# To stream logs to the monitoring host, all nodes need to know its address
${
nodes
.
monitoring
.
config
.
services
.
private-storage
.
monitoring
.
vpn
.
server
.
ip
}
=
[
"monitoring"
"monitoring.monitoringvpn"
]
;
services
.
private-storage
.
monitoring
.
exporters
.
promtail
=
{
enable
=
true
;
serverHost
=
config
.
grid
.
monitoringEndpoint
;
};
services
.
private-storage
.
monitoring
.
exporters
.
promtail
.
enable
=
true
;
assertions
=
[
# This is a check to save somebody in the future trying to debug why
# setting `nixpkgs.config` is not having an effect.
...
...
This diff is collapsed.
Click to expand it.
morph/lib/monitoring.nix
+
5
−
0
View file @
c605f391
...
...
@@ -92,6 +92,11 @@ in {
}
];
# We use `mkForce` here, to override the value specified in `morph/lib/base.nix`,
# Since the default value depends on the value defined on this node, there
# would otherwise be infinite recursiion.
grid
.
monitoringEndpoint
=
lib
.
mkForce
monitoringvpnIPv4
;
deployment
.
secrets
=
lib
.
mkMerge
[
{
"monitoringvpn-private-key"
=
{
...
...
This diff is collapsed.
Click to expand it.
nixos/modules/monitoring/exporters/promtail.nix
+
7
−
1
View file @
c605f391
...
...
@@ -15,6 +15,12 @@ let
in
{
options
.
services
.
private-storage
.
monitoring
.
exporters
.
promtail
=
{
enable
=
lib
.
mkEnableOption
"Promtail log exporter service"
;
serverHost
=
lib
.
mkOption
{
type
=
lib
.
types
.
str
;
description
=
''
The server host that logs should be pushed to.
''
;
};
};
config
=
lib
.
mkIf
cfg
.
enable
{
...
...
@@ -28,7 +34,7 @@ in {
};
clients
=
[{
url
=
"http://
monitoring
:3100/loki/api/v1/push"
;
url
=
"http://
${
cfg
.
serverHost
}
:3100/loki/api/v1/push"
;
}];
scrape_configs
=
[{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment