Giter Site home page Giter Site logo

Comments (11)

isaachier avatar isaachier commented on May 24, 2024

Try updating the config.yml to look something like this:

sampler:
  samplingServerURL: <collector-url>

By default, the value of <collector-url> is 127.0.0.1:5778.

from jaeger-client-cpp.

yurishkuro avatar yurishkuro commented on May 24, 2024

@isaachier I suggest adding a section to the readme

from jaeger-client-cpp.

sebastian-garofalo avatar sebastian-garofalo commented on May 24, 2024

@isaachier
I tried with that but it's ignoring the sampling URL and stills sends the traces to localhost:9411
my config file looks like this:

disabled: false
reporter:
    logSpans: true
sampler:
  type: const
  param: 1
  samplingServerURL: zipkin.istio-system.svc.cluster.local:9411

Also is there any way to see logs of what the library is doing? I can't see any error logs if I stop the localhost jaeger.

from jaeger-client-cpp.

isaachier avatar isaachier commented on May 24, 2024

The default logger is noop. You can change it by passing the consoleLogger to the Tracer constructor. See here: https://github.com/jaegertracing/jaeger-client-cpp/blob/master/src/jaegertracing/Logging.h, https://github.com/jaegertracing/jaeger-client-cpp/blob/master/src/jaegertracing/Tracer.h.

from jaeger-client-cpp.

sebastian-garofalo avatar sebastian-garofalo commented on May 24, 2024

I was doing that, but I can only see the traces I generate, but no errors about contacting the collector

void setUpTracer(const char* configFilePath)
{
    auto configYAML = YAML::LoadFile(configFilePath);
    auto config = jaegertracing::Config::parse(configYAML);
    auto tracer = jaegertracing::Tracer::make("followers-service", config, jaegertracing::logging::consoleLogger());
    opentracing::Tracer::InitGlobal(std::static_pointer_cast<opentracing::Tracer>(tracer));
}

And I see something like this

Followers Service starting...
Initializing Jaeger tracing...
INFO: Initializing logging reporter
INFO: Reporting span f218f30d30fd823b:4e0db680f75733dc:f218f30d30fd823b:1
INFO: Reporting span f218f30d30fd823b:f218f30d30fd823b:0:1

from jaeger-client-cpp.

isaachier avatar isaachier commented on May 24, 2024

The collector manages the sampling strategy. The agent forwards traces to the collector from your application. It seems you meant to change the agent endpoint. That requires updating the reporting config, not the sampling config. Please override the localAgentHostPort property of the reporter section like so:

reporter:
    logSpans: true
    localAgentHostPort: <agent-host-port>

from jaeger-client-cpp.

isaachier avatar isaachier commented on May 24, 2024

Final thought: you might have the correct setup in your application, but your agent might experience errors when it sends traces to an invalid endpoint. See the main Jaeger repo for how to set up the agent etc.

from jaeger-client-cpp.

sebastian-garofalo avatar sebastian-garofalo commented on May 24, 2024

Will do, thanks a lot for your help @isaachier

from jaeger-client-cpp.

isaachier avatar isaachier commented on May 24, 2024

No problem, I'll try to add some stuff to the README about this.

from jaeger-client-cpp.

tarunz avatar tarunz commented on May 24, 2024
reporter:
    logSpans: true
    localAgentHost: 10.244.1.140
    localAgentHostPort: 6832

Setting yml like this, throws an error:

Running main function
terminate called after throwing an instance of 'std::runtime_error'
  what():  Cannot connect socket to remote address { family=2, addr=0.0.26.176, port=0 }
Aborted (core dumped)

Kindly help @isaachier , how can I define agentHost, agentPort?

from jaeger-client-cpp.

MikeGoldsmith avatar MikeGoldsmith commented on May 24, 2024

@tarunz you pass the host and port in the same parameter:
localAgentHostPort: 10.244.1.140:6832

from jaeger-client-cpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.