@@ -153,6 +153,18 @@ var (
153153 Value : "http://localhost:4040" ,
154154 Category : flags .LoggingCategory ,
155155 }
156+ pyroscopeAuthUsernameFlag = & cli.StringFlag {
157+ Name : "pyroscope.username" ,
158+ Usage : "Pyroscope basic authentication username" ,
159+ Value : "" ,
160+ Category : flags .LoggingCategory ,
161+ }
162+ pyroscopeAuthPasswordFlag = & cli.StringFlag {
163+ Name : "pyroscope.password" ,
164+ Usage : "Pyroscope basic authentication password" ,
165+ Value : "" ,
166+ Category : flags .LoggingCategory ,
167+ }
156168 pyroscopeTagsFlag = & cli.StringFlag {
157169 Name : "pyroscope.tags" ,
158170 Usage : "Comma separated list of key=value tags to add to profiling data" ,
@@ -183,6 +195,8 @@ var Flags = []cli.Flag{
183195 traceFlag ,
184196 pyroscopeFlag ,
185197 pyroscopeServerFlag ,
198+ pyroscopeAuthUsernameFlag ,
199+ pyroscopeAuthPasswordFlag ,
186200 pyroscopeTagsFlag ,
187201}
188202
@@ -324,6 +338,8 @@ func Setup(ctx *cli.Context) error {
324338 // Pyroscope profiling
325339 if ctx .Bool (pyroscopeFlag .Name ) {
326340 pyroscopeServer := ctx .String (pyroscopeServerFlag .Name )
341+ pyroscopeAuthUsername := ctx .String (pyroscopeAuthUsernameFlag .Name )
342+ pyroscopeAuthPassword := ctx .String (pyroscopeAuthPasswordFlag .Name )
327343
328344 rawTags := ctx .String (pyroscopeTagsFlag .Name )
329345 tags := make (map [string ]string )
@@ -335,7 +351,12 @@ func Setup(ctx *cli.Context) error {
335351 }
336352 }
337353
338- Handler .StartPyroscopeProfiler (pyroscopeServer , tags )
354+ Handler .StartPyroscopeProfiler (
355+ pyroscopeServer ,
356+ pyroscopeAuthUsername ,
357+ pyroscopeAuthPassword ,
358+ tags ,
359+ )
339360 }
340361
341362 if len (logFile ) > 0 || rotation {
0 commit comments