observe
This repo includes core libraries for implementing observability in Go applications.
Observability is comprised of the following pillars:
- Logging
- Metrics
- Tracing
- Reporting (Events)
log
This package can be used for implementing structured logging in Go applications.
It supports four different logging levels and JSON
logging format.
Logs are used for auditing purposes (sometimes for debugging with limited capabilities).
Since log data can have any arbitrary shape and size, they cannot be used for real-time computational purposes.
Logs are also hard to track across different and distributed processes.
metrics
This package can be used for implementing metrics in Go applications.
It supports OpenMetrics format and uses Prometheus API.
Metrics are regular time-series data with low and fixed cardinality.
Metrics are used for defining SLIs (service-level indicators), SLOs (service-level objectives), and automated alerting.
Metrics are very good at taking the distribution of data into account.
Metrics cannot be used with high-cardinality data.
trace
This package can be used for implementing tracing in Go applications.
It supports OpenTracing format and uses Jaeger.
Traces are used for debugging and tracking requests across different processes and services.
They can also be used for identifying performance bottlenecks.
Due to their very data-heavy nature, traces in real-world applications need to be sampled.
Insights extracted from traces cannot be aggregated due to the fact that they are sampled.
In other words, information captured by one trace do not tell anything about how this trace is compared against other traces and what is the distribution of data.
report
The package can be used for implementing error and event reporting in Go applications.
It uses Rollbar API.
Events are also irregular time-series data and can have arbitrary number of metadata.
They occur in temporal order, but the interval between occurrences are inconsistent and sporadic.
Reporting is used for alerting on important or critical events such as errors, crashes, etc.