👋
Originally posted in DockYard/flame_on#48
Similar to the issue above, what if eflambe starts and stops tracing on telemetry events?
Since telemetry:execute and telemetry:span run in the caller process, we have access to the current pid, and we can use the new trace module with very minimal effort for flamegraphs. Flamecharts (which is what FlameOn is doing, and I guess eflambe as well?) would require extra effort. With trace we might also be able to cross process boundary and start tracing the processes that the current process "calls".
The API could be just a telemetry event for which to start tracing, and an optional event for when to stop tracing.
ref = make_ref()
# or something like :eflambe.trace_once([:phoenix, :endpoint, :start])
:telemetry.attach("trace-phx-on", [:phoenix, :endpoint, :start], &:eflambe.start_tracing/4, sample: 0.01, ref: ref)
:telemetry.detach("trace-phx-on")
:eflambe.svg(:eflambe.report(ref))
Context:
👋
Originally posted in DockYard/flame_on#48
Similar to the issue above, what if
eflambestarts and stops tracing ontelemetryevents?Since
telemetry:executeandtelemetry:spanrun in the caller process, we have access to the current pid, and we can use the new trace module with very minimal effort for flamegraphs. Flamecharts (which is what FlameOn is doing, and I guesseflambeas well?) would require extra effort. Withtracewe might also be able to cross process boundary and start tracing the processes that the current process "calls".The API could be just a telemetry event for which to start tracing, and an optional event for when to stop tracing.
Context: