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

Add tracing #26

Merged
merged 13 commits into from
Oct 18, 2019
Merged

Add tracing #26

merged 13 commits into from
Oct 18, 2019

Conversation

jisantuc
Copy link
Contributor

@jisantuc jisantuc commented Oct 16, 2019

Overview

This PR wires up work done in Raster Foundry's http4s-util subproject to add tracing to the one existing service. Tracing can be configured to point to xray or jaeger currently, but xray doesn't work for a confusing reason (probably because the http4s/circe/etc. versions bump to cats 2.0, see more in notes).

Notes

The broken XRayTracer I think has to do with binary compatibility, but I'm not sure what's causing it in particular. An obvious guess was that since http4s is behind doobie and circe on cats-2.0 upgrades, I'd just need to download everything else, but I get the same error with doobie 0.7 and circe 0.11 as I do with doobie 0.8 and circe 0.12:

java.lang.NoSuchMethodError: 'java.lang.String io.circe.Printer$.apply$default$18()'
    at com.rasterfoundry.http4s.xray.UdpClient$.<init>(UdpClient.scala:11)
    at com.rasterfoundry.http4s.xray.UdpClient$.<clinit>(UdpClient.scala)
    at com.rasterfoundry.http4s.xray.XRayTracingContext$.$anonfun$resource$4(XRayTracingContext.scala:92)
    at cats.effect.internals.IORunLoop$.cats$effect$internals$IORunLoop$$loop(IORunLoop.scala:139)
    at cats.effect.internals.IORunLoop$.start(IORunLoop.scala:34)
    at cats.effect.internals.IOBracket$.$anonfun$apply$1(IOBracket.scala:44)
    at cats.effect.internals.IOBracket$.$anonfun$apply$1$adapted(IOBracket.scala:34)
    at cats.effect.internals.IORunLoop$RestartCallback.start(IORunLoop.scala:341)
    at cats.effect.internals.IORunLoop$.cats$effect$internals$IORunLoop$$loop(IORunLoop.scala:119)
    at cats.effect.internals.IORunLoop$RestartCallback.signal(IORunLoop.scala:355)
    at cats.effect.internals.IORunLoop$RestartCallback.apply(IORunLoop.scala:376)
    at cats.effect.internals.IORunLoop$RestartCallback.apply(IORunLoop.scala:316)
    at cats.effect.internals.IOShift$Tick.run(IOShift.scala:36)
    at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)

Testing Instructions

  • api/assembly
  • bring up server
  • make some requests to /api/hello/<name>
  • look at requests under the granary service in Jaeger on 16686
  • change your GRANARY_LOG_LEVEL in docker-compose to INFO
  • restart the server
  • confirm you don't get a DEBUG message about the jaeger tracing being used

Closes #18

Copy link

@notthatbreezy notthatbreezy left a comment

Choose a reason for hiding this comment

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

Looks good to me - I pushed up the changes after our offline discussion on Resource. If you want to clean that up a little more, I say go for it.

Open question on whether to bite the bullet and use log4cats here too

api/src/main/scala/com/rasterfoundry/granary/Server.scala Outdated Show resolved Hide resolved
@jisantuc jisantuc merged commit d3edce8 into master Oct 18, 2019
@jisantuc jisantuc deleted the feature/js/add-tracing branch October 18, 2019 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add Tracing
2 participants