/OpenTelemetry.jl

An unofficial implementation of OpenTelemetry in Julia.

Primary LanguageJuliaApache License 2.0Apache-2.0

OpenTelemetry.jl

doc CI codecov ColPrac: Contributor's Guide on Collaborative Practices for Community Packages

An unofficial implementation of OpenTelemetry in Julia.

Get Started

Traces

using OpenTelemetry

with_span("Hello") do
    with_span("World") do
        println("Hello world from OpenTelemetry.jl!")
    end
end

asciicast

Metrics

using OpenTelemetry

m = Meter("demo_metrics");
c = Counter{Int}("fruit_counter", m);

c(; name = "apple", color = "red")
c(2; name = "lemon", color = "yellow")
c(1; name = "lemon", color = "yellow")
c(2; name = "apple", color = "green")
c(5; name = "apple", color = "red")
c(4; name = "lemon", color = "yellow")

r = MetricReader();
r()

asciicast

Logging

using OpenTelemetry
using Logging
using LoggingExtras

with_logger(TransformerLogger(OtelLogTransformer(), global_logger())) do
    @info "World!"
end

asciicast

Tutorial

(WIP)

Tips for Developers

(WIP)

  • Understand the Architecture of OpenTelemetry.jl
  • How to Add Instrumentation to a Third-party Package?
  • How to Extend OpenTelemetrySDK?
  • Conventions and Best Practices to Instrument Your Application

FAQ

Some frequently asked questions are maintained here. If you can't find the answer to your question there, please create an issue. Your feedback is VERY IMPORTANT to the quality of this package❤.

Packages

Package Description Latest Version
OpenTelemetryAPI Common data structures and interfaces. Instrumentations should rely on it only. version
OpenTelemetrySDK Based on the specification, application owners use SDK constructors; plugin authors use SDK plugin interfaces version
OpenTelemetryProto See the OTLP specification version
OpenTelemetryExporterOtlpProtoGrpc Provide an AbstractExporter in OTLP through gRPC version
OpenTelemetryExporterPrometheus Provide an AbstractExporter to allow pulling metrics from Prometheus version
OpenTelemetry Reexport all above. For demonstration and test only. Application users should import OpenTelemetrySDK and necessary plugins or instrumentations explicitly. version
OpenTelemetryInstrumentationBase Add basic metrics under the Base module in Julia runtime.
OpenTelemetryInstrumentationDownloads Add metrics and inject context info in Downloads.jl.
OpenTelemetryInstrumentationDistributed Add metrics and inject context info in Distributed.jl.
OpenTelemetryInstrumentationHTTP Add metrics and inject context info in HTTP.jl.
OpenTelemetryInstrumentationGenie Add metrics and inject context info in Genie.jl.
OpenTelemetryUber Reexport all above. For demonstration and test only. Application users should import OpenTelemetrySDK and necessary plugins or instrumentations explicitly.

Benchmarks

Check out the benchmark results of some essential operations with Julia@v1.6, Julia@v1.7.