-
Notifications
You must be signed in to change notification settings - Fork 182
Standard tag for service name #77
Comments
If you're implementing an OpenTracing API, you still have a Tracer object, don't you? So you can record the service name in that object and when instrumentation calls The main point of OpenTracing is that people can reuse instrumentation of various frameworks, we already have plenty of those in opentracing-contrib. How would all those frameworks know what your service name is when they create new spans? |
@yurishkuro "you can attach that as an attribute of the span"... that's exactly what we're doing. I wanted to (re)open the conversation about a standard, suggested tag for this. I believe @tedsuo expressed similar interest. Thoughts on whether or not you'd like to see a PR to update the documentation with a standard tag ( |
Well, the standard tags exist for the purpose of letting instrumentation know which tags to use for which semantic data elements. In your case the tag is added by your tracer implementation, not instrumentation, so it does not need any standardization, you can name it anything you want, as long as your tracer and the tracing backend agree on what it is. Am I missing something? |
Nope, not missing anything. This is more of a "people (n >= 3) keep asking for it because it seems like it should be there." I'll wait for any input from @tedsuo; otherwise, I'll close this in a few days. |
We just need a clear use case that affects vendor-neutral instrumentation. |
@yurishkuro we have some cases where instrumentations want to override the |
To be clear: if tracers don't support the So right now, the problem is: |
@tedsuo to make sure I understand: a single process (e.g. a routing proxy like Envoy) creates spans on behalf of many different services, via a single instance of the Tracer, therefore you want the instrumentation to tell the Tracer on a per-Span basic the service name it represents. If that's correct, then it's a much large scope than simply defining a standard tag, it's also prescribing new behavior to the tracers. For example, if you use Jaeger and do |
Yes, that exactly it! Only I think there's no problem if Jaeger does not support it. You can still search by Specifically, we want to reserve the tag |
Yes, one can search by the tag, but all aggregations will be incorrect as the spans will be attributed to the service name given at Tracer construction, not according to the "service" tag. I don't mind reserving the |
We had something similar for Hawkular APM: during the "report" phase, we'd check if the application has set the service name. If not, we'd derive it from a configuration option, or from an env var: I do think it makes sense to allow specific spans to set their service names, specially if they are dealing with out-of-band data or processing (like parts of a batch, queued items, ...). |
Thanks @jpkrohling. @yurishkuro maybe we are still lacking some process around standardizing tags. I don't know what it means to reserve a tag but not define it's meaning. Are we missing an incubation step? It feels kind of chicken and egg: either we provide a vendor-neutral tag like I agree that we should should be slow to add standard tags, while avoiding overly narrow solutions and non-existent problems. But, I believe
To solve this issue without vendor-specific solutions, a a) the b) if a tracer provides a "tracer name," "service name," or similar concept, and would like to allow OT instrumentation to override it, the @yurishkuro, is your preference to standardize on a), and "incubate" b)? |
Indeed. Partially because until now support for tags was entirely optional for tracer implementations, in the sense that almost none of them required any special behavior of the tracer aside from simply recording the tag on the span. The two minor exceptions are So what I am really trying to do is to take into account (intensive) past criticism of introducing features into the API before they are widely supported by the existing implementations. If we define the tag with a) and/or b) definition, it sets the expectation that such behavior should be generally supported by many implementations, which in case of Jaeger is a non-trivial amount of work across multiple languages. So I am not sure how to answer your question. I do think we need some incubation process for the new tags of such critical impact. One possible way to do that is to say "It's incubating with a) and b) semantics, but the semantics might change prior to graduation". |
Question about |
@yurishkuro I think you are right that we should develop the usecase further. I disagree that this tag would force anyone to change or be "broken" in regard to OT: your tracer will work fine, there is just nothing special about the service tag. I'm interested in getting out-of-band reporting to work via a tag convention specifically because it would allow us to add this concept to OT without making breaking changes, such as a new StartSpanOption or other changes that would literally break the API for tracers, regardless of whether you support this usecase. So really, this is about incubating an entire concept: out of band reporting. I will think more about how we should do this: working groups, etc, so that when things are finally standardized they have been reviewed properly. You may well be right that there is interest in supporting out-of-band reporting in the OT community, but it requires deeper changes that need review and new API surface area. In the meantime... we're going to start setting the @beberlei I think service naming conventions are user preference, based on how you think of your system. If you were going to draw a boxes and arrows diagram of your system, "service" would be the name your wrote on each box. So for systems that are more complicated "mysql-db" may not be enough. In general, db services I have seen tend to be named things like As far as reserving the name "Service" for this concept in the OT universe: Tracers in general have a concept of "service name," often set on tracer initialization, that is a very important part of how they index things. What appears to be shaping up in OT is that "operations" exist in a "component" namespace, and components exist in a service namespace. So the "fully qualified span name" is often something like |
At Datadog we have internally added the some tags, but are seeing how this issue resolves to influence further decision. I guess my point is that I support better standardization of tags that would support finer grained grouping. |
@tedsuo's entire paragraph from #77 (comment) ...
... perfectly summarizes what I was trying to articulate earlier on in this discussion. |
Is there anything blocking this from moving forward? Does the following plan make sense?
|
How to define the diff between peer.service and This question is similar with @beberlei . According to @tedsuo 's explanation:
It it up to user, if so, hard to tell the difference. |
"peer service" means "the other service". I don't think its confusing. Both tags refer to the same domain of values - the names of the services in the architecture. |
IMO, if a span represents a client for calling remote service, the |
@wu-sheng When A calls B and they report spans on both sides of the RPC then: A reports (the client-side of the RPC):
B reports (the server-side of the RPC):
peer.service may be unknown |
@mabn If A is just a client, I didn't think A will set itself as a service tag, so as B. IMO, A and b are a pair for this RPC call, they share the same service name. e.g. |
@wu-sheng I know, this is hard, right? There are only so many words, we are going to use them up quickly. :) In this case I agree with @mabn, I'm glad to see that @StephenWithPH @tylerbenson and others have a similar concept for service. @wu-sheng are you satisfied with this reasoning enough to try it out? If so I will make a PR along the lines of what @yurishkuro has suggested. |
If we have
|
Thanks @wu-sheng, I'll try to make it clear. BTW @tylerbenson, your tag |
I was thinking more about this recently. In Jaeger we identify the service (originator of the span) via a Process object that contains not only service name, but also a collection of key/value tags that typically represent other metadata about the service, such as host/ip where the service is running, maybe software version, zone/datacenter, deployment group, etc. Simply setting the service name via tag doesn't allow for expressing this level of service identity & metadata. It's also going to be quite inefficient to do for every span since the tracer internally pre-processes the service metadata into a format ready to be sent over the wire (or even communicating it to the backend upon establishing the connection). So it seems like instantiating multiple tracers in the proxy service for this scenario would be a better approach. |
@yurishkuro in our case, we only set the service name tag on the top span of each name, then it implicitly cascades (until it is manually changed to something else). In my opinion, is much easier to deal with than managing multiple different tracer instances. |
I don't have strong objection to introducing this tag. |
@yurishkuro @tedsuo Should I just submit a PR, or is there a different process for this? |
I think a PR is fine. As it's adding a new tag it doesn't need to go through the full RFC cycle. The PR is just to add the tag to the data conventions. It's description should spell out what the tracers are expected to do with it if they support it. |
@tedsuo and @yurishkuro: this is a continuation of the conversation from #75.
This also has overlay with #58 from @ruinanchen
Referring back to that issue...several of the existing OT-compatible tracers make service name a first-class item. See:
https://github.com/openzipkin/zipkin-go-opentracing/blob/master/zipkin-recorder.go#L71
https://github.com/uber/jaeger-client-go/blob/master/tracer.go#L71
https://github.com/instana/golang-sensor/blob/master/options.go#L6
https://github.com/hawkular/hawkular-apm-opentracing-javascript/blob/master/lib/deployment-meta-data.js#L28
I believe guidance on a standard tag for service name would be useful. Yes, this need is largely driven by UI considerations, but "which service?" is a valid question.
Quoting @tedsuo
Quoting @yurishkuro
In our case, our "tracer" is just raw spans to stdout. That's why we want the span itself to reflect the service. We could certainly append something in the process that picks up stdout and ships, but we feel it's cleaner to just add a tag on the span.
Thoughts?
The text was updated successfully, but these errors were encountered: