Is your feature request related to a problem? Please describe.
Currently, we are creating the ServiceMonitor for the OpenTelemetry Operator's metrics endpoint statically from a manifest file. However, this approach has a significant limitation: users may install the operator in a namespace other than the default namespace provided in the manifest. When users specify tlsConfig, this leads to a failure in scraping metrics, as the serverName field in the ServiceMonitor depends on the namespace where the operator was deployed.
Describe the solution you'd like
Enhance the operator to create the ServiceMonitor programmatically, ensuring it is configured automatically based on the namespace where the operator is installed. This will dynamically adjust the serverName and ensure metrics scraping works regardless of the installation namespace.
Component(s)
No response
Is your feature request related to a problem? Please describe.
Currently, we are creating the
ServiceMonitor
for the OpenTelemetry Operator's metrics endpoint statically from a manifest file. However, this approach has a significant limitation: users may install the operator in a namespace other than the default namespace provided in the manifest. When users specify tlsConfig, this leads to a failure in scraping metrics, as the serverName field in the ServiceMonitor depends on the namespace where the operator was deployed.Describe the solution you'd like
Enhance the operator to create the ServiceMonitor programmatically, ensuring it is configured automatically based on the namespace where the operator is installed. This will dynamically adjust the
serverName
and ensure metrics scraping works regardless of the installation namespace.Describe alternatives you've considered
No response
Additional context
No response