@@ -104,7 +104,13 @@ func New(ctx context.Context, c *Config) (*Server, error) {
104
104
registry := metrics .NewPrefixedRegistry ("policybot." )
105
105
middlewares := append (
106
106
[]func (http.Handler ) http.Handler {
107
- func (h http.Handler ) http.Handler { return otelhttp .NewHandler (h , "policy-bot" ) },
107
+ func (h http.Handler ) http.Handler {
108
+ return otelhttp .NewHandler (h , "policy-bot" , otelhttp .WithFilter (func (r * http.Request ) bool {
109
+ skip := r .URL .Path == "/" || r .URL .Path == "/api/github/hook" ||
110
+ strings .HasPrefix (r .URL .Path , "/static" )
111
+ return ! skip
112
+ }))
113
+ },
108
114
},
109
115
baseapp .DefaultMiddleware (logger , registry )... ,
110
116
)
@@ -218,14 +224,14 @@ func New(ctx context.Context, c *Config) (*Server, error) {
218
224
219
225
dispatcher := githubapp .NewEventDispatcher (
220
226
[]githubapp.EventHandler {
221
- & handler.Installation {Base : basePolicyHandler },
222
- & handler.MergeGroup {Base : basePolicyHandler },
223
- & handler.PullRequest {Base : basePolicyHandler },
224
- & handler.PullRequestReview {Base : basePolicyHandler },
225
- & handler.IssueComment {Base : basePolicyHandler },
226
- & handler.Status {Base : basePolicyHandler },
227
- & handler.CheckRun {Base : basePolicyHandler },
228
- & handler.WorkflowRun {Base : basePolicyHandler },
227
+ policybototel . Trace ( & handler.Installation {Base : basePolicyHandler }) ,
228
+ policybototel . Trace ( & handler.MergeGroup {Base : basePolicyHandler }) ,
229
+ policybototel . Trace ( & handler.PullRequest {Base : basePolicyHandler }) ,
230
+ policybototel . Trace ( & handler.PullRequestReview {Base : basePolicyHandler }) ,
231
+ policybototel . Trace ( & handler.IssueComment {Base : basePolicyHandler }) ,
232
+ policybototel . Trace ( & handler.Status {Base : basePolicyHandler }) ,
233
+ policybototel . Trace ( & handler.CheckRun {Base : basePolicyHandler }) ,
234
+ policybototel . Trace ( & handler.WorkflowRun {Base : basePolicyHandler }) ,
229
235
},
230
236
c .Github .App .WebhookSecret ,
231
237
githubapp .WithErrorCallback (githubapp .MetricsErrorCallback (base .Registry ())),
0 commit comments