-
Notifications
You must be signed in to change notification settings - Fork 232
Make the whole URL for remoteSampler / Service name configurable #565
Comments
At this time only agent exposes this configuration API, and the agent is supposed to run as a sidecar or host agent on the same host as the application. I think there were PRs somewhere to introduce |
Thanks, I checked the PR but the URL is still hard coded |
That is handled by a different project - https://github.com/opentracing-contrib/java-spring-jaeger |
Why do you need to have the service name configured separately? Do you want to use sampling strategies for different service name than one used to report spans? |
That's correct. I am doing a project with springcloud (serveral microservices), and I'd like to control the tracing behavior of the microservices (config-service, api-gateway, etc) separately. Currently the service name is passed as a parameter ( ?service=....), it is fine but I have to build another web service to provide the tracing config json. If it can be configurable ( remoteURL=http://xxx.com/${serviceName} ) Then I can re-use the spring cloud config server, which is better to me. |
Sorry, I don't follow the use case.
jaeger agent + collector already provide the ability to control sampling per-service via configuration. Why do you need another service?
A given tracer represents a single service, so when it calls for sampling configuration it asks for sampling for that service (and you pass the name of the service to the tracer when creating it). With your suggestion you can force the tracer to ask for sampling strategy under a different service name - I don't understand that use case. |
Hi Thanks for you message.
This is mostly for enable / disable tracing for a specific micro service at runtime without restarting. And due to some firewall limit, the HTTP pulling of sampling configuration is blocked. That's why I have to build a web service internally to provide the configs.
Sorry, I did not want to ask for a different service name. All I need is to set the serviceName as part of the URL (Restful style), not as a parameter. The following is my code for test: https://192.168.1.200/config/service1 etc. Of course, if the old style (as a parameter) is needed, it can be configured as
|
I think this is the crucial aspect and it would make easier the life of people replacing specific parts of Jaeger with their implementations. |
Fair enough, I can see the value there. But I still think we must keep the existing simpler way of pointing to the agent with just the |
Actually, I still don't see why the independent service cannot provide the same API as provided by the agent, with the same URL structure? |
A Jaeger-collector is now exposing sampling API endpoint, so we can throw spans directly to it and get sampler configuration too (without jaeger-agent) jaegertracing/jaeger#1990 Waiting for #554, jaegertracing/documentation#124, |
Currently the service name is hard coded, as in HttpSamplingManager.java
jsonString = makeGetRequest( "http://" + hostPort + "/?service=" + URLEncoder.encode(serviceName, "UTF-8"));
In my project, I found that it would be greate helpful if the whole endpoint can be configured, instead of just hostPort.
For example,
I can config it as a RESTFUL service:
remoteURL=http://xxx.com/${serviceName}
or ,
as a query parameter
remoteURL=http://xxx.com/?q=${serviceName}
or, as HTTPS:
remoteURL=https://xxx.com/${serviceName}
Thanks.
The text was updated successfully, but these errors were encountered: