OpenTelemetry¶
Overview¶
OpenTelemetry¶
OpenTelemetry is a set of APIs, SDKs, tooling and integrations that are designed for the creation and management of telemetry data such as traces, metrics, and logs.
Facts¶
- Bring your own backend. OpenTelemetry provides the specification and collector only.
- KubeCon NA 2021: OpenTelemetry Collector Deployment Patterns
- Support for traces, metrics, logs.
- Prometheus vs. OpenTelemetry metrics
Hot Topics¶
- Observability with OpenTelemetry is a great learning series by Thomas Stringer in 6 parts, covering Introduction, Instrumentation, Exporting, Collector, Propagation, Ecosystem.
- Learn how to instrument an Apache HTTP Server with OpenTelemetry
- OpenTelemetry for Python Developers
- Learn OpenTelemetry tracing using a lightweight microservice project
- Logz.io created a great learning series for OpenTelemetry getting started in various languages:
- How auto-instrumentation can help
CI/CD Observability¶
tracepusher¶
tracepusher is a new Open Source project that provides a Python script to send traces to OpenTelemetry. The script can be run standalone on the command-line or integrated into GitLab CI/CD pipelines. The CI/CD configuration needs to be extended with a preparation job to generate a unique trace ID for the pipeline run, and consecutive before_script
and after_script
default definitions for all jobs to generate span IDs, and emit the trace span to OpenTelemetry with the tracepusher
script, with a post pipeline job that finalizes the trace. You can create a quick demo setup with an OpenTelemetry collector that accepts HTTP messages using this project which docker-compose.
You can then follow my public learning curve implementing tracepusher into the slow pipeline project in this MR. I also created upstream pull requests and issues, including emphasis on the CI-tagged image, jobs that specify a custom image, before_script/after_script override problem workarounds and Jobs with needs do not download dotenv artifacts by default, causing new trace IDs generated.