Instrumentation for https://opentelemetry.io
Find a file
Simon Cruanes 5180be31bc
feat(collector): move GC metrics logic to the collector
this helps avoiding reentrancy issue, where the collector allocates,
triggers the GC metrics alarm, which tries to push new metrics in the
middle of a batch (currently leading to a potential deadlock).
2022-04-11 13:09:13 -04:00
.github/workflows chore: build opentelemetry-cohttp-lwt in CI 2022-03-25 11:59:48 +00:00
src feat(collector): move GC metrics logic to the collector 2022-04-11 13:09:13 -04:00
tests refactor emit1 2022-03-28 09:36:21 -04:00
vendor fuck vendoring atomic 2022-03-23 15:33:03 -04:00
.gitignore doc, etc. 2022-03-18 14:17:56 -04:00
.gitmodules fuck vendoring atomic 2022-03-23 15:33:03 -04:00
dune initial commit 2022-03-16 15:58:08 -04:00
dune-project wip: cohttp integration 2022-03-24 17:38:46 +00:00
emit1.sh feat: parse W3C traceparent header 2022-03-24 17:22:45 +00:00
Makefile initial commit 2022-03-16 15:58:08 -04:00
opentelemetry-client-ocurl.opam chore: put lower bound on mtime 2022-03-22 11:10:44 -04:00
opentelemetry-cohttp-lwt.opam wip: cohttp integration 2022-03-24 17:38:46 +00:00
opentelemetry-lwt.opam add odoc as a doc dep 2022-03-18 12:12:51 -04:00
opentelemetry.opam add odoc as a doc dep 2022-03-18 12:12:51 -04:00
README.md ci badge 2022-03-18 14:20:32 -04:00

Opentelemetry build

This project provides an API for instrumenting server software using opentelemetry, as well as connectors to talk to opentelemetry software such as jaeger.

Features

  • basic traces
  • basic metrics
  • basic logs
  • nice API
  • interface with lwt
  • sync collector relying on ocurl
    • batching, perf, etc.
  • async collector relying on ocurl-multi
  • interface with logs (carry context around)

Use

For now, instrument manually:

module T = Opentelemetry
let (let@) f x = f x

let foo x =
  let@ (tr,sp) = T.Trace.with_ 
      ~service_name:"myservice" "foo" ~attrs:["hello", `String "world"] in
  (* … *)

  let gc = Gc.stat() in
  T.Metrics.(
    emit [
      gauge ~name:"foo.gc.major_heap_words" [int gc.Gc.heap_words];
      sum ~name:"foo.gc.minor_allocated" [float gc.Gc.minor_words];
    ]);

  (* … *)

License

MIT

Semantic Conventions

Not supported yet.