Open sergk-mambu opened 9 months ago
This issue is currently awaiting triage.
If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted
label and provide further guidance.
The triage/accepted
label can be added by org members by writing /triage accepted
in a comment.
I'm interested too. It doesn't make sense in the current configuration, if it is enabled by default, why does the doc mention that is possible to enable ingress per ingress? Doc, with the current behavior, must mention the opposite, how to offboard ingresses from opentelemetry.
I have the same issue. Regardless of Global value in configmap enable-opentelemetry
set to true or false, adding annotation to a single ingress resource, enables Open Telemetry for all ingress resources.
These OTEL annotations do not work as described in the doc https://kubernetes.github.io/ingress-nginx/user-guide/third-party-addons/opentelemetry/
I used nginx.ingress.kubernetes.io/enable-opentelemetry: "true"
and then OTEL traces come from the all routes.
With nginx.ingress.kubernetes.io/enable-opentelemetry: "false"
added to a ingress route I still see traces from that route as well.
I'm in this case too. I want to activate the telemetry for a single ingress, not the whole cluster
EDIT: based on the informations from @sergk-mambu , I have a workaround to set the opentelemetry: off
in the http-snippet
This way it works, the telemetry plugin is only enabled for my ingress location, but I aggre, this should be the default value
@lerminou Could you share that snippet? 😄
Overall: +1 for this issue!
@lieberlois , just simply in the configmap:
apiVersion: v1
data:
http-snippet:
opentelemetry off;
because the http-snippet is loaded at the end of the virtual host, it overrides the default value. https://github.com/kubernetes/ingress-nginx/blob/main/rootfs/etc/nginx/template/nginx.tmpl#L535
@lerminou Seems to work as a workaround - however, this can't be the official solution. Are you aware of any updates on this topic?
While the work around works, you need at least one ingress with the annotation otherwise nginx will refuse to load its config while the snippet is present.
Currently if OpenTelemetry is disabled globally via the ConfigMap option
enable-opentelemetry: "false"
and enabled only in one ingress resource via the annotationnginx.ingress.kubernetes.io/enable-opentelemetry: "true"
then OpenTelemetry tracing becomes implicitly enabled for all other ingress resources. It happens because in otel_ngx module tracing is enabled by default. So as soon as the module is loaded then tracing is enabled for all ingress instances (all servers in nginx config). The only way to make it enabled on one ingress instance is to add the annotationnginx.ingress.kubernetes.io/enable-opentelemetry: "false"
to all other ingress instances which is cumbersome.Previously with OpenTracing it worked fine because tracing was disabled by default in that module.
I propose to add here in nginx.tmpl a config option
opentelemetry off;
the next line after the optionopentelemetry_config ...
. In this case it will mimic old OpenTracing behaviour, i.e. OpenTelemetry will be disabled in the http scope of nginx and then enabled per server/location if either global ConfigMap option or local annotation are enabled.