@@ -52,6 +52,7 @@ import (
52
52
"github.com/open-telemetry/opentelemetry-operator/internal/version"
53
53
"github.com/open-telemetry/opentelemetry-operator/internal/webhook/podmutation"
54
54
collectorupgrade "github.com/open-telemetry/opentelemetry-operator/pkg/collector/upgrade"
55
+ "github.com/open-telemetry/opentelemetry-operator/pkg/constants"
55
56
"github.com/open-telemetry/opentelemetry-operator/pkg/featuregate"
56
57
"github.com/open-telemetry/opentelemetry-operator/pkg/instrumentation"
57
58
instrumentationupgrade "github.com/open-telemetry/opentelemetry-operator/pkg/instrumentation/upgrade"
@@ -99,25 +100,26 @@ func main() {
99
100
100
101
// add flags related to this operator
101
102
var (
102
- metricsAddr string
103
- probeAddr string
104
- pprofAddr string
105
- enableLeaderElection bool
106
- createRBACPermissions bool
107
- enableMultiInstrumentation bool
108
- collectorImage string
109
- targetAllocatorImage string
110
- operatorOpAMPBridgeImage string
111
- autoInstrumentationJava string
112
- autoInstrumentationNodeJS string
113
- autoInstrumentationPython string
114
- autoInstrumentationDotNet string
115
- autoInstrumentationApacheHttpd string
116
- autoInstrumentationNginx string
117
- autoInstrumentationGo string
118
- labelsFilter []string
119
- webhookPort int
120
- tlsOpt tlsConfig
103
+ metricsAddr string
104
+ probeAddr string
105
+ pprofAddr string
106
+ enableLeaderElection bool
107
+ createRBACPermissions bool
108
+ enableMultiInstrumentation bool
109
+ enableApacheHttpdInstrumentation bool
110
+ collectorImage string
111
+ targetAllocatorImage string
112
+ operatorOpAMPBridgeImage string
113
+ autoInstrumentationJava string
114
+ autoInstrumentationNodeJS string
115
+ autoInstrumentationPython string
116
+ autoInstrumentationDotNet string
117
+ autoInstrumentationApacheHttpd string
118
+ autoInstrumentationNginx string
119
+ autoInstrumentationGo string
120
+ labelsFilter []string
121
+ webhookPort int
122
+ tlsOpt tlsConfig
121
123
)
122
124
123
125
pflag .StringVar (& metricsAddr , "metrics-addr" , ":8080" , "The address the metric endpoint binds to." )
@@ -128,6 +130,7 @@ func main() {
128
130
"Enabling this will ensure there is only one active controller manager." )
129
131
pflag .BoolVar (& createRBACPermissions , "create-rbac-permissions" , false , "Automatically create RBAC permissions needed by the processors" )
130
132
pflag .BoolVar (& enableMultiInstrumentation , "enable-multi-instrumentation" , false , "Controls whether the operator supports multi instrumentation" )
133
+ pflag .BoolVar (& enableApacheHttpdInstrumentation , constants .FlagApacheHttpd , true , "controls whether the operator supports Apache HTTPD auto-instrumentation" )
131
134
stringFlagOrEnv (& collectorImage , "collector-image" , "RELATED_IMAGE_COLLECTOR" , fmt .Sprintf ("ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:%s" , v .OpenTelemetryCollector ), "The default OpenTelemetry collector image. This image is used when no image is specified in the CustomResource." )
132
135
stringFlagOrEnv (& targetAllocatorImage , "target-allocator-image" , "RELATED_IMAGE_TARGET_ALLOCATOR" , fmt .Sprintf ("ghcr.io/open-telemetry/opentelemetry-operator/target-allocator:%s" , v .TargetAllocator ), "The default OpenTelemetry target allocator image. This image is used when no image is specified in the CustomResource." )
133
136
stringFlagOrEnv (& operatorOpAMPBridgeImage , "operator-opamp-bridge-image" , "RELATED_IMAGE_OPERATOR_OPAMP_BRIDGE" , fmt .Sprintf ("ghcr.io/open-telemetry/opentelemetry-operator/operator-opamp-bridge:%s" , v .OperatorOpAMPBridge ), "The default OpenTelemetry Operator OpAMP Bridge image. This image is used when no image is specified in the CustomResource." )
@@ -166,6 +169,7 @@ func main() {
166
169
"go-os" , runtime .GOOS ,
167
170
"labels-filter" , labelsFilter ,
168
171
"enable-multi-instrumentation" , enableMultiInstrumentation ,
172
+ "enable-apache-httpd-instrumentation" , enableApacheHttpdInstrumentation ,
169
173
)
170
174
171
175
restConfig := ctrl .GetConfigOrDie ()
@@ -183,6 +187,7 @@ func main() {
183
187
config .WithCollectorImage (collectorImage ),
184
188
config .WithCreateRBACPermissions (createRBACPermissions ),
185
189
config .WithEnableMultiInstrumentation (enableMultiInstrumentation ),
190
+ config .WithEnableApacheHttpdInstrumentation (enableApacheHttpdInstrumentation ),
186
191
config .WithTargetAllocatorImage (targetAllocatorImage ),
187
192
config .WithOperatorOpAMPBridgeImage (operatorOpAMPBridgeImage ),
188
193
config .WithAutoInstrumentationJavaImage (autoInstrumentationJava ),
@@ -342,18 +347,12 @@ func addDependencies(_ context.Context, mgr ctrl.Manager, cfg config.Config, v v
342
347
343
348
// adds the upgrade mechanism to be executed once the manager is ready
344
349
err = mgr .Add (manager .RunnableFunc (func (c context.Context ) error {
345
- u := & instrumentationupgrade.InstrumentationUpgrade {
346
- Logger : ctrl .Log .WithName ("instrumentation-upgrade" ),
347
- DefaultAutoInstJava : cfg .AutoInstrumentationJavaImage (),
348
- DefaultAutoInstNodeJS : cfg .AutoInstrumentationNodeJSImage (),
349
- DefaultAutoInstPython : cfg .AutoInstrumentationPythonImage (),
350
- DefaultAutoInstDotNet : cfg .AutoInstrumentationDotNetImage (),
351
- DefaultAutoInstGo : cfg .AutoInstrumentationDotNetImage (),
352
- DefaultAutoInstApacheHttpd : cfg .AutoInstrumentationApacheHttpdImage (),
353
- DefaultAutoInstNginx : cfg .AutoInstrumentationNginxImage (),
354
- Client : mgr .GetClient (),
355
- Recorder : mgr .GetEventRecorderFor ("opentelemetry-operator" ),
356
- }
350
+ u := instrumentationupgrade .NewInstrumentationUpgrade (
351
+ mgr .GetClient (),
352
+ ctrl .Log .WithName ("instrumentation-upgrade" ),
353
+ mgr .GetEventRecorderFor ("opentelemetry-operator" ),
354
+ cfg ,
355
+ )
357
356
return u .ManagedInstances (c )
358
357
}))
359
358
if err != nil {
0 commit comments