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

Invalid duration time in Jaeger #20

Closed
narayanasamyr opened this issue Jan 10, 2018 · 1 comment
Closed

Invalid duration time in Jaeger #20

narayanasamyr opened this issue Jan 10, 2018 · 1 comment

Comments

@narayanasamyr
Copy link
Contributor

Hi,

I am trying to integrate nginx with jaeger, but in jaeger UI am getting long duration time for a nginx request.
When i hit / on my nginx server it takes less than a second to load, but in jaeger its showing 18+ seconds.

nginx-load-time

request-wrong-duration

spans

I have made a small fix in opentracing_request_instrumentor.cpp and after that its working as expected.
what i changed:
replaced the
"auto timepoint = ngx_timeofday()
auto finish_timestamp =opentracing::convert_time_pointstd::chrono::steady_clock(to_system_timestamp(timepoint->sec, timepoint->msec)); " to

auto finish_timestamp = std::chrono::steady_clock::now();

My env details:

  1. Jaeger: all jaeger components running in single container
    docker run -d -e COLLECTOR_ZIPKIN_HTTP_PORT=9411 -p5775:5775/udp -p6831:6831/udp -p6832:6832/udp -p5778:5778 -p16686:16686 -p14268:14268 -p9411:9411 jaegertracing/all-in-one:latest

  2. Nginx - Used the docker image which described in this project
    rnburn/nginx-opentracing:latest

  3. My nginx conf file

user nginx;
worker_processes 1;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;

load_module modules/ngx_http_opentracing_module.so;
load_module modules/ngx_http_jaeger_module.so;

events {
worker_connections 1024;
}

http {

jaeger_service_name nginx-opentracing-test-service;

opentracing on;

jaeger_sampler_type const;

jaeger_sampler_param 1;

jaeger_reporter_log_spans on;

jaeger_sampling_server_url http://10.112.81.82:5778;


jaeger_reporter_local_agent_host_port 10.112.81.82:6831;

include       /etc/nginx/mime.types;
default_type  application/octet-stream;

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for"';

access_log  /var/log/nginx/access.log  main;

sendfile        on;
#tcp_nopush     on;

keepalive_timeout  65;

#gzip  on;

include /etc/nginx/conf.d/*.conf;

}

@rnburn
Copy link
Collaborator

rnburn commented Jan 11, 2018

Thanks! I incorporated the change you suggested.

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