File tree Expand file tree Collapse file tree 1 file changed +56
-1
lines changed Expand file tree Collapse file tree 1 file changed +56
-1
lines changed Original file line number Diff line number Diff line change 14
14
{
15
15
options . services . pyroscope = with lib ; {
16
16
enable = mkEnableOption ( lib . mdDoc "Grafana Agent (Flow mode)" ) ;
17
+ args = {
18
+ server = {
19
+ http-listen-port = mkOption {
20
+ type = types . port ;
21
+ default = 4040 ;
22
+ example = 8080 ;
23
+ } ;
24
+ http-listen-address = mkOption {
25
+ type = types . str ;
26
+ default = "127.0.0.1" ;
27
+ example = "0.0.0.0" ;
28
+ } ;
29
+
30
+ grpc-listen-port = mkOption {
31
+ type = types . port ;
32
+ default = 9095 ;
33
+ example = 9096 ;
34
+ } ;
35
+ grpc-listen-address = mkOption {
36
+ type = types . str ;
37
+ default = "127.0.0.1" ;
38
+ example = "0.0.0.0" ;
39
+ } ;
40
+ } ;
41
+
42
+ log = {
43
+ level = mkOption {
44
+ type = types . enum [
45
+ "debug"
46
+ "info"
47
+ "warn"
48
+ "error"
49
+ ] ;
50
+ default = "info" ;
51
+ example = "debug" ;
52
+ } ;
53
+ format = mkOption {
54
+ type = types . enum [
55
+ "logfmt"
56
+ "json"
57
+ ] ;
58
+ default = "logfmt" ;
59
+ example = "json" ;
60
+ } ;
61
+ } ;
62
+ } ;
17
63
} ;
64
+
18
65
config = {
19
66
systemd . services . pyroscope = lib . mkIf cfg . enable {
20
67
description = "Pyroscope" ;
21
68
wantedBy = [ "multi-user.target" ] ;
22
69
serviceConfig = {
23
- ExecStart = ''${ lib . getExe package } '' ;
70
+ ExecStart = ''
71
+ ${ lib . getExe package } \
72
+ -server.http-listen-port ${ cfg . args . server . http-listen-port } \
73
+ -server.http-listen-address ${ cfg . args . server . http-listen-address } \
74
+ -server.grpc-listen-port ${ cfg . args . server . grpc-listen-port } \
75
+ -server.grpc-listen-address ${ cfg . args . server . grpc-listen-address } \
76
+ -log.level ${ cfg . args . log . level } \
77
+ -log.format ${ cfg . args . log . format }
78
+ '' ;
24
79
} ;
25
80
} ;
26
81
} ;
You can’t perform that action at this time.
0 commit comments