Skip to content

Commit 17879c1

Browse files
MartinNikovPetarKirov
authored andcommitted
config(modules/pyroscope): Add more options
1 parent d0731bb commit 17879c1

File tree

1 file changed

+58
-1
lines changed

1 file changed

+58
-1
lines changed

modules/pyroscope/default.nix

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,70 @@
1414
{
1515
options.services.pyroscope = with lib; {
1616
enable = mkEnableOption (lib.mdDoc "Grafana Agent (Flow mode)");
17+
args = {
18+
http = {
19+
port = mkOption {
20+
type = types.port;
21+
default = 4040;
22+
example = 8080;
23+
};
24+
address = mkOption {
25+
type = types.str;
26+
default = "127.0.0.1";
27+
example = "0.0.0.0";
28+
};
29+
};
30+
31+
grpc = {
32+
port = mkOption {
33+
type = types.port;
34+
default = 9095;
35+
example = 9096;
36+
};
37+
address = mkOption {
38+
type = types.str;
39+
default = "127.0.0.1";
40+
example = "0.0.0.0";
41+
};
42+
};
43+
44+
grpc = {
45+
level = mkOption {
46+
type = types.enum [
47+
"debug"
48+
"info"
49+
"warn"
50+
"error"
51+
];
52+
default = "info";
53+
example = "debug";
54+
};
55+
format = mkOption {
56+
type = types.enum [
57+
"logfmt"
58+
"json"
59+
];
60+
default = "logfmt";
61+
example = "json";
62+
};
63+
};
64+
};
1765
};
66+
1867
config = {
1968
systemd.services.pyroscope = lib.mkIf cfg.enable {
2069
description = "Pyroscope";
2170
wantedBy = [ "multi-user.target" ];
2271
serviceConfig = {
23-
ExecStart = ''${lib.getExe package}'';
72+
ExecStart = ''
73+
${lib.getExe package} \
74+
-server.http-listen-port ${cfg.args.http.port} \
75+
-server.http-listen-address ${cfg.args.http.address} \
76+
-server.grpc-listen-port ${cfg.args.grpc.address} \
77+
-server.grpc-listen-address ${cfg.args.grpc.address} \
78+
-log.level ${cfg.log.level} \
79+
-log.format ${cfg.log.format}
80+
'';
2481
};
2582
};
2683
};

0 commit comments

Comments
 (0)