Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE]: datadog_service_name NGINX variables support #173

Open
shugg opened this issue Feb 21, 2025 · 1 comment
Open

[FEATURE]: datadog_service_name NGINX variables support #173

shugg opened this issue Feb 21, 2025 · 1 comment

Comments

@shugg
Copy link

shugg commented Feb 21, 2025

Describe the goal of the feature

It would be great if the datadog_service_name directive supported NGINX variables. With nginx-datadog on Ingress-NGINX, this would enable dynamically assigning a service name to each ingress object.

controller:
  config:
    main-snippet: "load_module /modules_mount/ngx_http_datadog_module.so;"
    http-snippet: |
      server {
        datadog_sample_rate 0.1;
      }

    location-snippet: |
      datadog_service_name "$ingress_name-ingress";

Is your feature request related to a problem?

No response

Describe alternatives you've considered

No response

Additional context

We are looking to transition from our current setup, which uses the OpenTelemetry module (and previously OpenTracing) bundled in Ingress-NGINX, to the nginx-datadog module for improved support. Here is our current configuration:

OpenTelemetry

location-snippet: |
  opentracing_tag service.name "$ingress_name-ingress";

OpenTracing

location-snippet: |
  opentelemetry_attribute "service.name" "$ingress_name-ingress";
@dmehala
Copy link
Contributor

dmehala commented Feb 21, 2025

Hey @shugg

I actually considered a similar use case - automatically resolving $service_name/$ingress_name-ingress for an ingress-nginx runtime. However, during my testing, if found out that if a variable doesn't exist, NGINX fails to start, printing an error message about the missing variable. The only way to prevent this is by setting unintialized_variable_warn directive is set to off. I can probably enforce this behaviour only for our ingress-nginx build.

Your use case is slightly different, I don't expect any issues. I'll give it some more thought and follow up with you next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants