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

new traces for every request, parent-id changes everytime. #78

Open
luck0r opened this issue Dec 2, 2024 · 1 comment
Open

new traces for every request, parent-id changes everytime. #78

luck0r opened this issue Dec 2, 2024 · 1 comment

Comments

@luck0r
Copy link

luck0r commented Dec 2, 2024

Describe the bug

I have requests to grafana dashboards http://url/**d**/
these have datasources querys ( http requests) and i want for every request to a dashboard to see all querys as spans. Problem is that all requests are in seperate traces. I tried several configuration options.
Here is my configuration:

location / {
    otel_trace on;                 
    otel_span_name "frontend-request";
    proxy_pass http://localhost:3001;
    include /etc/nginx/proxy.conf;

}
  location /d/ {
    otel_trace on;                
    otel_span_name "dashboard-request";
    otel_trace_context extract;
    proxy_set_header traceparent "00-$otel_trace_id-$otel_span_id-01";  
    proxy_set_header tracestate $http_tracestate;
    proxy_pass http://localhost:3001;
    include /etc/nginx/proxy.conf;

}
    location /api/ {
    otel_trace on;
    otel_trace_context propagate;
    otel_span_name "api";
    proxy_set_header traceparent "00-$otel_trace_id-$otel_span_id-01";  
    proxy_set_header tracestate $http_tracestate;
    include /etc/nginx/proxy.conf;
    proxy_pass http://localhost:3001/api/;

  }

To reproduce

Steps to reproduce the behavior:

  1. open a dashboard /d/uid
  2. See in nginx log files that all parent ids are different.

Expected behavior

one requests creates a parted id and that is used in the "subrequests"

Your environment

packages from nginx.org( i tried stable and mainline):#
nginx 1.27.3-1~jammy

nginx-module-otel 1.27.3+0.1.0-1~jammy

@p-pautov
Copy link
Contributor

p-pautov commented Dec 2, 2024

I suspect that the parent needs to be set by browser for this to work. Can you describe the issue with curl as a client?

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