GithubHelp home page GithubHelp logo

cedi-dtrace's People

Contributors

matthughes avatar mpilquist avatar omerzach avatar pauljamescleary avatar sbuzzard avatar scala-steward avatar therealcisse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cedi-dtrace's Issues

Add first-class stack safety

Currently dtrace leans on it's underlying effect for stack safety, which works ok for effects like IO that provide it but even IO is inadequate for dtrace needs as even for map/ap operations, we need that suspension because of our Kleisli-like nature (with the TC => F[?] that represents a span). So we use a bunch of hacks which generally "work" but only with a bunch of implicit constraints. I labeled this an enhancement but its really fixing an underlying design flaw.

Update to 2.0 version of cats-core and cats-effect

Trying to use the current version with the newer cats libs versions (2.0) breaks around using parTraverse methods and other parallel methods.

It would be very nice to update this project and continue using dtrace with newer cats libs.

startTime for Spans gets set to past value when using parTupled

Maybe somehow related to the previous issue when notes and ids were misconfigured
When recording traces noticed that once the parallel operation is used on spans startTime gets set to some past value.
Thought that maybe timeUnit gets misconfigured but doesn't seem to be an issue.
Here's some output of Trace (traceId, startTime, timeUnit)

(08437b2120d84563aca69abb21cb11cc.cb2e8f22e93e9acd<:8304c1927248e81b,989495477311,MICROSECONDS)
(08437b2120d84563aca69abb21cb11cc.d6eb183e2d6020c6<:8304c1927248e81b,989495477485,MICROSECONDS)
(08437b2120d84563aca69abb21cb11cc.8304c1927248e81b<:7b32416c35daf7d9,1556858256813000,MICROSECONDS)
(08437b2120d84563aca69abb21cb11cc.7b32416c35daf7d9<:27e11df15d90203a,1556858256813000,MICROSECONDS)
(08437b2120d84563aca69abb21cb11cc.27e11df15d90203a<:47ead56bdca393c5,1556858256813000,MICROSECONDS)

First two correspond to 1970-01-12 10:51:35 +0000 (these were called with parTupled) while other three 2019-05-03 04:37:36 +0000

Respect / process sample flag in zipkin/xb3 header when present

There is a sample header (and in compressed mode, flag) that indicates if the trace should be sampled (emitted). If present and set to 0, we should respect it and not emit traces originating from this origin. Also should provide the means of setting this for outbound traces.

Support X-B3 (Zipkin) style http headers

There is no standard for http headers for distributed tracing, but the closest thing is X-B3 style headers . These are used by several products, such as Zipkin, http4s or istio. It would be good if cedi-trace supported these, at least the three that are identical: trace-id, parent-id, span-id. This would give cedi-trace interoperability with other products.

Examples of money headers vs. x-b3 headers:

X-MoneyTrace: trace-id=de305d54-75b4-431b-adb2-eb6b9e546013;parent-id=3285573610483682037;span-id=3285573610483682037

X-B3-TraceId: 463ac35c9f6413ad48485a3953bb6124
X-B3-ParentSpanId: 0020000000000001
X-B3-SpanId: a2fb4a1d1a96d312

Integrating with tagless final

What is the recommended way to use TraceT with a service built using tagless final?

I think it can work, if the interpreters of your algebras are all based on TraceT. However, I'd like to use typeclass constraints for the interpreters too.

Any tips?

Span timing should be measured with System.nanoTime

The current timing implementation uses Instant.now, and the difference between them, to measure the processing time of a span.

This is problematic for a few reasons, Instant is:

  • not guaranteed to be monotonic
  • not in any way guaranteed to be accurate
  • generally does not expose leap seconds
  • can be modified by NTP, etc.
  • it also currently only has millisecond accuracy, but this is the least of its issues

I think that for reliable timing, System.nanoTime should be used instead.

As this is not in any way related to the current "human" time, it has to be stored in addition to the current time (I note also that both values are stored in the Comcast Money implementation).

I have a working version of this, if you'd like a PR.

Add dtrace-http4s and dtrace-akka-http modules

Add modules to support injecting (on the client side) and extracting (on the server side) http headers to propagate traces over http (via either / both b3 and money formatted headers). This will support / is related to #19

StackOverflow occurs when using parallel methods with TraceT

Trying to replicate an issue we came up with this example

scala> (1 to 100000).toVector.parTraverse(_ => TraceIO.unit).toIO.unsafeRunSync
java.lang.StackOverflowError
  at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:447)
  at java.lang.StringBuilder.append(StringBuilder.java:136)
  at java.lang.StringBuilder.append(StringBuilder.java:131)
  at com.ccadllc.cedi.dtrace.TraceSystem$Timer$RealTime.<init>(TraceSystem.scala:146)
  at com.ccadllc.cedi.dtrace.TraceSystem$Timer$RealTime.copy(TraceSystem.scala:145)
  at com.ccadllc.cedi.dtrace.TraceSystem$Timer$RealTime.translate(TraceSystem.scala:148)
  at com.ccadllc.cedi.dtrace.package$.translate(dtrace.scala:257)
  at com.ccadllc.cedi.dtrace.TraceTNonEmptyParallelInstance$NonEmptyParallelTraceT$$anon$10.$anonfun$apply$2(TraceT.scala:803)
  at com.ccadllc.cedi.dtrace.TraceTParallelInstance$ParallelTraceT$$anon$5.$anonfun$map$2(TraceT.scala:732)
  at com.ccadllc.cedi.dtrace.TraceTParallelInstance$ParallelTraceT$$anon$5.$anonfun$ap$1(TraceT.scala:736)
  at com.ccadllc.cedi.dtrace.TraceTParallelInstance$ParallelTraceT$$anon$5.$anonfun$map$2(TraceT.scala:732)
  at com.ccadllc.cedi.dtrace.TraceTParallelInstance$ParallelTraceT$$anon$5.$anonfun$ap$1(TraceT.scala:736)
  at com.ccadllc.cedi.dtrace.TraceTParallelInstance$ParallelTraceT$$anon$5.$anonfun$map$2(TraceT.scala:732)
  at com.ccadllc.cedi.dtrace.TraceTParallelInstance$ParallelTraceT$$anon$5.$anonfun$ap$1(TraceT.scala:736)

^ these last two lines keep repeataing

Looks strange considering that toIO just appends one span to the whole computation and never emits it (as we're using NoOp emitter)
Also, works fine with traverse on scales like tens of millions without any issues and the same works fine with just IO both for traverse or parTraverse

Not sure if there's implementation detail one should be aware of or there's a bug, but would appreciate any help 😅

NoClassDefFoundError: com/ccadllc/cedi/dtrace/LoggingFactory$

Looks like LoggingFactory should be in com/ccadllc/cedi/dtrace/logging. Fix in #59.

root[ERROR] java.lang.NoClassDefFoundError: com/ccadllc/cedi/dtrace/LoggingFactory$
root[ERROR] 	at com.ccadllc.cedi.dtrace.logging.LoggingConfig$.$anonfun$initialize$1(LoggingConfig.scala:33)
root[ERROR] 	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
root[ERROR] 	at cats.effect.internals.IORunLoop$.cats$effect$internals$IORunLoop$$loop(IORunLoop.scala:87)
root[ERROR] 	at cats.effect.internals.IORunLoop$.start(IORunLoop.scala:34)
root[ERROR] 	at cats.effect.internals.IOBracket$.$anonfun$apply$1(IOBracket.scala:44)
root[ERROR] 	at cats.effect.internals.IOBracket$.$anonfun$apply$1$adapted(IOBracket.scala:34)
root[ERROR] 	at cats.effect.internals.IORunLoop$RestartCallback.start(IORunLoop.scala:337)
root[ERROR] 	at cats.effect.internals.IORunLoop$.cats$effect$internals$IORunLoop$$loop(IORunLoop.scala:119)
root[ERROR] 	at cats.effect.internals.IORunLoop$RestartCallback.signal(IORunLoop.scala:351)
root[ERROR] 	at cats.effect.internals.IORunLoop$RestartCallback.apply(IORunLoop.scala:372)
root[ERROR] 	at cats.effect.internals.IORunLoop$RestartCallback.apply(IORunLoop.scala:312)
root[ERROR] 	at cats.effect.internals.IOShift$Tick.run(IOShift.scala:36)
root[ERROR] 	at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
root[ERROR] 	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
root[ERROR] 	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
root[ERROR] 	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
root[ERROR] 	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
root[ERROR] Caused by: java.lang.ClassNotFoundException: com.ccadllc.cedi.dtrace.LoggingFactory$
root[ERROR] 	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
root[ERROR] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
root[ERROR] 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
root[ERROR] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
root[ERROR] 	... 17 more

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.