<!--

Welcome to ingress-nginx!  For a smooth issue process, try to answer the following questions.
Don't worry if they're not all applicable; just try to include what you can :-).
More info helps better understanding of the issue (needless to say).

If you need to include code snippets or logs, please put them in fenced code
blocks.  If they're super-long, please use the details tag like
<details><summary>super-long log</summary> lots of stuff </details>

-->

<!--

IMPORTANT!!!

Please complete the next sections or the issue will be closed.
This questions are the first thing we need to know to understand the context.

-->

**What happened**:
Nginx ingress helm chart installation failed after trying to upgrade to latest version
<!-- (please include exact error messages if you can) -->

```
Error: exit status 1
2024/05/02 08:50:04 [emerg] 28#28: unknown "opentracing_context_x_datadog_trace_id" variable
nginx: [emerg] unknown "opentracing_context_x_datadog_trace_id" variable
nginx: configuration file /tmp/nginx/nginx-cfg1324908602 test failed

-------------------------------------------------------------------------------
E0502 08:50:05.819399       8 queue.go:131] "requeuing" err=<
	
	-------------------------------------------------------------------------------
	Error: exit status 1
	2024/05/02 08:50:04 [emerg] 28#28: unknown "opentracing_context_x_datadog_trace_id" variable
	nginx: [emerg] unknown "opentracing_context_x_datadog_trace_id" variable
	nginx: configuration file /tmp/nginx/nginx-cfg1324908602 test failed
```

From kubectl get events --watch, I can see that readyness probe fails

```
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-jl4tf    (combined from similar events): Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-jl4tf    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-jl4tf    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-jl4tf    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-jl4tf    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-jl4tf    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-jl4tf    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-rh9v2    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-rh9v2    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-rh9v2    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-rh9v2    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-rh9v2    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-rh9v2    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-rh9v2    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-rh9v2    Error reloading NGINX: ...
```
**What you expected to happen**:

<!-- What do you think went wrong? -->
  

I have reverted, so running old version, updated version where it's failing

```
apiVersion: v2
appVersion: "1.10.1"
description: real nginx ingress chart
name: ingress-nginx
version: 4.10.1
dependencies:
  - name: ingress-nginx
    version: 4.10.1
    repository: https://kubernetes.github.io/ingress-nginx
```

-->

**Kubernetes version** (use `kubectl version`):
1.26.7

**Environment**:

- **Cloud provider or hardware configuration**: GCP

Configuration:
I have added it properly in our values.yaml and it's working fine for the old version, with the upgrade, I keep getting this failure message. 
values.yaml:

```
ingress-nginx:
   config:
      enable-opentracing: "true"
      log-format-upstream: '{"remote_addr": "$remote_addr", "host": "$host", "time": "$time_iso8601", "request_id": "$req_id", "request_method": "$request_method", "request_uri": "$request_uri", "protocol": "$server_protocol", "status": $status, "bytes_sent": $body_bytes_sent, "referer": "$http_referer", "user_agent": "$http_user_agent", "request_time": $request_time, "request_length": $request_length, "upstream_name": "$proxy_upstream_name", "upstream_addr": "$upstream_addr", "upstream_response_length": "$upstream_response_length", "upstream_response_time": "$upstream_response_time", "upstream_status": "$upstream_status", "trace_id": "$opentracing_context_x_datadog_trace_id"}'
```

Nginx Ingress: Helm chart not able to find the opentracing variable declared
This is a GitHub Issue
repo:ingress-nginx
owner:kubernetes
Title : Nginx Ingress: Helm chart not able to find the opentracing variable declared
Issue date:

--- start body ---
<!--

Welcome to ingress-nginx!  For a smooth issue process, try to answer the following questions.
Don't worry if they're not all applicable; just try to include what you can :-).
More info helps better understanding of the issue (needless to say).

If you need to include code snippets or logs, please put them in fenced code
blocks.  If they're super-long, please use the details tag like
<details><summary>super-long log</summary> lots of stuff </details>

-->

<!--

IMPORTANT!!!

Please complete the next sections or the issue will be closed.
This questions are the first thing we need to know to understand the context.

-->

**What happened**:
Nginx ingress helm chart installation failed after trying to upgrade to latest version
<!-- (please include exact error messages if you can) -->

```
Error: exit status 1
2024/05/02 08:50:04 [emerg] 28#28: unknown "opentracing_context_x_datadog_trace_id" variable
nginx: [emerg] unknown "opentracing_context_x_datadog_trace_id" variable
nginx: configuration file /tmp/nginx/nginx-cfg1324908602 test failed

-------------------------------------------------------------------------------
E0502 08:50:05.819399       8 queue.go:131] "requeuing" err=<
	
	-------------------------------------------------------------------------------
	Error: exit status 1
	2024/05/02 08:50:04 [emerg] 28#28: unknown "opentracing_context_x_datadog_trace_id" variable
	nginx: [emerg] unknown "opentracing_context_x_datadog_trace_id" variable
	nginx: configuration file /tmp/nginx/nginx-cfg1324908602 test failed
```

From kubectl get events --watch, I can see that readyness probe fails

```
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-jl4tf    (combined from similar events): Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-jl4tf    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-jl4tf    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-jl4tf    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-jl4tf    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-jl4tf    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-jl4tf    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-rh9v2    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-rh9v2    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-rh9v2    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-rh9v2    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-rh9v2    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-rh9v2    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-rh9v2    Error reloading NGINX: ...
60m         Warning   RELOAD                 pod/ingress-nginx-controller-7cc74ccf5f-rh9v2    Error reloading NGINX: ...
```
**What you expected to happen**:

<!-- What do you think went wrong? -->
  

I have reverted, so running old version, updated version where it's failing

```
apiVersion: v2
appVersion: "1.10.1"
description: real nginx ingress chart
name: ingress-nginx
version: 4.10.1
dependencies:
  - name: ingress-nginx
    version: 4.10.1
    repository: https://kubernetes.github.io/ingress-nginx
```

-->

**Kubernetes version** (use `kubectl version`):
1.26.7

**Environment**:

- **Cloud provider or hardware configuration**: GCP

Configuration:
I have added it properly in our values.yaml and it's working fine for the old version, with the upgrade, I keep getting this failure message. 
values.yaml:

```
ingress-nginx:
   config:
      enable-opentracing: "true"
      log-format-upstream: '{"remote_addr": "$remote_addr", "host": "$host", "time": "$time_iso8601", "request_id": "$req_id", "request_method": "$request_method", "request_uri": "$request_uri", "protocol": "$server_protocol", "status": $status, "bytes_sent": $body_bytes_sent, "referer": "$http_referer", "user_agent": "$http_user_agent", "request_time": $request_time, "request_length": $request_length, "upstream_name": "$proxy_upstream_name", "upstream_addr": "$upstream_addr", "upstream_response_length": "$upstream_response_length", "upstream_response_time": "$upstream_response_time", "upstream_status": "$upstream_status", "trace_id": "$opentracing_context_x_datadog_trace_id"}'
```

--- end body ---
