zipkin-cpp icon indicating copy to clipboard operation
zipkin-cpp copied to clipboard

local tracing example

Open cli99 opened this issue 7 years ago • 2 comments

Can you give a complete local tracing example? I have the following test code. It compiles and runs but my zipkin server does not capture anything.

int main(int argc, char **argv)
{
  zipkin_http_conf_t conf = zipkin_http_conf_new("http://localhost:9411/api/v1/spans");
  zipkin_collector_t collector = zipkin_http_collector_new(conf);
  zipkin_tracer_t tracer = zipkin_tracer_new(collector);

  zipkin_span_t span = zipkin_span_new(tracer, "encode", NULL);
  for (int i=3; i>0; --i) {
    std::cout << i << std::endl;
    std::this_thread::sleep_for (std::chrono::seconds(1));
  }
  zipkin_span_submit(span);
  return 0;
}

I have zipkin server running as docker run -d -p 9411:9411 openzipkin/zipkin Thanks.

cli99 avatar Jul 19 '17 17:07 cli99