File tree Expand file tree Collapse file tree 2 files changed +21
-6
lines changed
Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Original file line number Diff line number Diff line change 1111 inherit ( cfg . server ) grpc_listen_port ;
1212 } ;
1313
14- clients = [ {
15- url =
16- "http://${ config . cluster . nodes . monitoring . privateIP } :3100/loki/api/v1/push" ;
17- } ] ;
14+ inherit ( cfg ) clients ;
1815
1916 positions = { filename = "/var/lib/promtail/positions.yaml" ; } ;
2017
@@ -106,6 +103,17 @@ in {
106103 services . promtail = {
107104 enable = lib . mkEnableOption "Enable Promtail" ;
108105
106+ clients = lib . mkOption {
107+ default = [ ] ;
108+ type = with lib . types ; listOf ( submodule {
109+ options = {
110+ url = lib . mkOption {
111+ type = lib . types . string ;
112+ } ;
113+ } ;
114+ } ) ;
115+ } ;
116+
109117 server = lib . mkOption {
110118 default = { } ;
111119 type = with lib . types ;
126134 } ;
127135 } ;
128136
129- config = lib . mkIf ( cfg . enable && config . cluster . nodes ? monitoring ) {
137+ config = lib . mkIf cfg . enable {
130138 systemd . services . promtail = {
131139 description = "Promtail service for Loki" ;
132140 after = [ "network-online.target" ] ;
Original file line number Diff line number Diff line change 1- _ : { services . promtail . enable = true ; }
1+ _ : {
2+ services . promtail . enable = true ;
3+
4+ services . promtail . clients = [ {
5+ url =
6+ "http://${ config . cluster . nodes . monitoring . privateIP } :3100/loki/api/v1/push" ;
7+ } ] ;
8+ }
You can’t perform that action at this time.
0 commit comments