OpenTelemetry.jl
An unofficial implementation of OpenTelemetry in Julia.
Get Started
Logs
using OpenTelemetry
using Term # optional, for better display
using Logging
@info "Hello, World!"
@warn "from"
@error "OpenTelemetry.jl!"
![](https://github.com/oolong-dev/OpenTelemetry.jl/raw/master/docs/src/assets/log_info.png)
![](https://github.com/oolong-dev/OpenTelemetry.jl/raw/master/docs/src/assets/log_warn.png)
![](https://github.com/oolong-dev/OpenTelemetry.jl/raw/master/docs/src/assets/log_error.png)
Traces
with_span("Hello, World!") do
with_span("from") do
@info "OpenTelemetry.jl!"
end
end
![](https://github.com/oolong-dev/OpenTelemetry.jl/raw/master/docs/src/assets/span_info.png)
![](https://github.com/oolong-dev/OpenTelemetry.jl/raw/master/docs/src/assets/span_inner.png)
![](https://github.com/oolong-dev/OpenTelemetry.jl/raw/master/docs/src/assets/span_outer.png)
Metrics
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()
![](https://github.com/oolong-dev/OpenTelemetry.jl/raw/master/docs/src/assets/metrics.png)
Tutorial
It's recommended to walk through these tutorials one-by-one.
- View Metrics in Prometheus
- View Metrics in Prometheus through Open Telemetry Collector
- View Traces in Jaeger
- Send Logs to Loki via OpenTelemetry Collector
- A Typical Example with HTTP.jl
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. | |
OpenTelemetrySDK | Based on the specification, application owners use SDK constructors; plugin authors use SDK plugin interfaces | |
OpenTelemetryProto | See the OTLP specification. Note the major and minor version is kept the same with the original opentelemetry-proto version. | |
OpenTelemetryExporterOtlpProtoGrpc | Provide an AbstractExporter in OTLP through gRPC. (WARNING!!! This package is not updated to the latest version yet since gRPCClient.jl doesn't support ProtoBuf.jl@v1 yet.) | |
OpenTelemetryExporterOtlpProtoHttp | Provide exporters in OTLP through HTTP. | |
OpenTelemetryExporterPrometheus | Provide a meter to allow pulling metrics from Prometheus | |
OpenTelemetry | Reexport all above. For demonstration and test only. Application users should import OpenTelemetrySDK in combination with necessary plugins or instrumentations explicitly. |