Instrumentation for https://opentelemetry.io
Find a file
2022-03-23 08:49:25 -04:00
.github/workflows update atomic, do not list it as opam dep 2022-03-22 10:01:36 -04:00
src feat: set global attributes on ResourceSpans/ResourceMetrics 2022-03-23 12:26:51 +00:00
tests feat(test): --debug flag 2022-03-23 11:51:21 +00:00
vendor update atomic, do not list it as opam dep 2022-03-22 10:01:36 -04:00
.gitignore doc, etc. 2022-03-18 14:17:56 -04:00
.gitmodules depend on atomic shims, vendor them 2022-03-21 15:20:20 -04:00
dune initial commit 2022-03-16 15:58:08 -04:00
dune-project chore: put lower bound on mtime 2022-03-22 11:10:44 -04:00
emit1.sh add basic test that emits fake data 2022-03-16 16:48:43 -04: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-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.