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

If the "service" tag exists in the span, send it to ElasticSearch and #183

Merged
merged 1 commit into from
Oct 2, 2018

Conversation

LakerBaker
Copy link
Contributor

use it in the auxiliary tags when merging spans, instead of the span's
service name. Also clean up pom.xml dependencies to fix some warnings.

use it in the auxiliary tags when merging spans, instead of the span's
service name. Also clean up pom.xml dependencies to fix some warnings.
@bulicekj bulicekj merged commit 4f5cef6 into master Oct 2, 2018
@bulicekj bulicekj deleted the ConditionallyIndexTagServiceNameIfItExists branch October 2, 2018 17:10
@@ -72,8 +73,9 @@ class ServiceMetadataStatementBuilder(cassandra: CassandraSession,
def getAndUpdateServiceMetadata(spans: Iterable[Span]): Seq[Statement] = {
this.synchronized {
spans.foreach(span => {
if (StringUtils.isNotEmpty(span.getServiceName) && StringUtils.isNotEmpty(span.getOperationName)) {
val operationsList = serviceMetadataMap.getOrElseUpdate(span.getServiceName, mutable.Set[String]())
val serviceName = SpanUtils.getEffectiveServiceName(span)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ps be careful with this. The only thing setting this tag is very new opentracing instrumentation... there's no api to ensure it is consistent for local child spans. This might not hit you yet due to little code using this tag, or only code that has one span, but it can easily mess up your dependency graph.

Copy link

@codefromthecrypt codefromthecrypt Oct 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for example, assuming brackets define process boundaries and words represent spans:

A call is made from profile service to cache via two internal hops on a proxy

... profile] -> [ proxy -> proxy ] -> [ cache ...

you might not want to see a service link profile -> proxy, proxy -> cache!

If one wanted to overlay by some override, they might want something like this.. so that the intermediate looks invisible:

... profile] -> [ profile -> profile ] -> [ cache ...

this could flatten using some heuristic

however, if non-propagating tags are used to carry the overlay, it would only affect the first span

... profile] -> [ profile -> proxy ] -> [ cache ...

that would cause some links hard to flatten, worst case not any better than the original. To fix this is processing pipeline work, to guess that the service name intended to inherit.

That said, if there is only one intermediate span, it doesn't matter as there's nothing to inherit. A naive rename can work

... profile] -> [ profile ] -> [ cache ...

I've raised concern offline with an opentracing person to help correct the api and/or docs so that they don't cause this problem.

The reason we have no api to make a tag like this in Brave yet, is we didn't want to cause this problem with a half-measure. In the rare scenario of proxying with service names simply using multiple tracers would work (or in the case of linkerd, they can use existing things present in finagle to get a consistent downstream name). There's so far only one scenario in shared library of proxying names (camel), it is possibly enough to design an api for.

In any case, knowing something is a proxied service name vs an authoritative name could be useful. In other cases, people just remap based on IP address https://developers.soundcloud.com/blog/using-kubernetes-pod-metadata-to-improve-zipkin-traces

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback; I'll keep your concerns in mind. There's a team at Expedia that wants to use Haystack to display the progress of a CICD pipeline, and the OT (mis?)use of tags to override service name allowed the Haystack team to handle their use case without having to invent another mechanism.

@codefromthecrypt
Copy link

codefromthecrypt commented Oct 12, 2018 via email

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

Successfully merging this pull request may close these issues.

3 participants