Skip to content

Commit

Permalink
only enable OpenTelemetry if the module has been loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
dmathieu committed Jul 22, 2022
1 parent b29de25 commit 527ab26
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/ingress/controller/template/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -1653,6 +1653,14 @@ func shouldLoadOpenTelemetryModule(c interface{}, s interface{}) bool {
return false
}

if _, err := os.Stat("/etc/nginx/modules/otel_ngx_module.so"); err != nil {
klog.Errorf("couldn't retrieve otel_ngx_module.so. Got %#v", err)

// Switch the config to false so the templates don't try loading the plugin
cfg.EnableOpenTelemetry = false
return false
}

if cfg.EnableOpenTelemetry {
return true
}
Expand Down

0 comments on commit 527ab26

Please sign in to comment.