File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,4 +44,8 @@ ENV DOTNET_EnableDiagnostics_IPC=0
4444ENV DOTNET_EnableDiagnostics_Debugger=0
4545ENV DOTNET_EnableDiagnostics_Profiler=1
4646
47+ # Pyroscope basic auth (set at runtime)
48+ ENV PYROSCOPE_BASIC_AUTH_USER=""
49+ ENV PYROSCOPE_BASIC_AUTH_PASSWORD=""
50+
4751ENTRYPOINT ["dotnet" , "GithubActionsOrchestrator.dll" ]
Original file line number Diff line number Diff line change @@ -110,7 +110,16 @@ public static void Main(string[] args)
110110 . AddSource ( "Npgsql" )
111111 . AddAspNetCoreInstrumentation ( )
112112 . AddHttpClientInstrumentation ( )
113- . AddOtlpExporter ( )
113+ . AddOtlpExporter ( opt =>
114+ {
115+ var otlpUser = Environment . GetEnvironmentVariable ( "OTEL_EXPORTER_OTLP_AUTH_USER" ) ;
116+ var otlpPass = Environment . GetEnvironmentVariable ( "OTEL_EXPORTER_OTLP_AUTH_PASSWORD" ) ;
117+ if ( ! string . IsNullOrEmpty ( otlpUser ) && ! string . IsNullOrEmpty ( otlpPass ) )
118+ {
119+ var credentials = Convert . ToBase64String ( System . Text . Encoding . UTF8 . GetBytes ( $ "{ otlpUser } :{ otlpPass } ") ) ;
120+ opt . Headers = $ "Authorization=Basic { credentials } ";
121+ }
122+ } )
114123 . AddProcessor ( new Pyroscope . OpenTelemetry . PyroscopeSpanProcessor ( ) ) ;
115124 } ) ;
116125 builder . Services . AddSingleton < RunnerQueue > ( ) ;
You can’t perform that action at this time.
0 commit comments