Add OpenTelemetry integration and code refactoring#66
Conversation
… in MPIC components
…thod calls across multiple files
There was a problem hiding this comment.
Pull request overview
Adds OpenTelemetry-based tracing/metrics hooks across the MPIC coordinator and checker components to improve observability, plus minor refactors/formatting and a small telemetry helper module to centralize meter/tracer access.
Changes:
- Introduce
get_meter/get_tracerhelpers and export them fromopen_mpic_core. - Add tracing spans and metrics (counters + histograms) to DCV, CAA, and coordinator execution paths.
- Refactor/rewrap several method calls and blocks while integrating telemetry.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/open_mpic_core/mpic_dcv_checker/mpic_dcv_checker.py | Adds spans + request/duration metrics around DCV validation paths. |
| src/open_mpic_core/mpic_coordinator/mpic_coordinator.py | Adds spans + coordinator/perspective outcome metrics around orchestration and remote calls. |
| src/open_mpic_core/mpic_caa_checker/mpic_caa_checker.py | Adds spans + request/duration metrics around CAA lookup/check logic. |
| src/open_mpic_core/common_util/telemetry.py | New helper module to return global OTEL meter/tracer (no-op if unconfigured). |
| src/open_mpic_core/init.py | Re-exports telemetry helpers from the package root. |
| pyproject.toml | Adds opentelemetry-api dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ures in CAA checker
…r reporting Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Pull request overview
Adds OpenTelemetry API-based helpers and instruments MPIC core components (coordinator, DCV checker, CAA checker) with tracing spans and basic request/duration metrics to improve observability, plus minor refactoring/formatting and a targeted unit test for CAA span error recording.
Changes:
- Introduce
get_meter/get_tracerhelpers (no-op safe when no SDK is configured) and export them fromopen_mpic_core. - Add OTEL tracing spans + counters/histograms across coordinator/DCV/CAA flows, including exception recording.
- Add a unit test asserting span exception/status behavior for CAA lookup failures; add
opentelemetry-apidependency.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/open_mpic_core/common_util/telemetry.py |
New helper module for fetching OTEL Meter/Tracer from global providers. |
src/open_mpic_core/__init__.py |
Re-exports telemetry helpers for use across the library. |
src/open_mpic_core/mpic_dcv_checker/mpic_dcv_checker.py |
Adds spans and request/duration metrics around DCV operations (overall + DNS/HTTP). |
src/open_mpic_core/mpic_caa_checker/mpic_caa_checker.py |
Adds spans and request/duration metrics around CAA checks and DNS lookup. |
src/open_mpic_core/mpic_coordinator/mpic_coordinator.py |
Adds spans and metrics for coordinator lifecycle and remote perspective calls/responses. |
tests/unit/open_mpic_core/test_mpic_caa_checker.py |
Adds test coverage for span error recording on CAA DNS lookup failure. |
pyproject.toml |
Adds opentelemetry-api as a runtime dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…in CAA and DCV checkers Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Pull request overview
Adds OpenTelemetry-based tracing/metrics instrumentation to core MPIC components to improve observability, plus minor refactors to restructure call formatting and timing measurement.
Changes:
- Introduce
get_meter/get_tracerhelper utilities and export them fromopen_mpic_core. - Instrument MPIC Coordinator, DCV Checker, and CAA Checker with OTel spans and metrics (counters + histograms).
- Add a unit test asserting CAA lookup failures record exceptions and set span error status.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/open_mpic_core/test_mpic_caa_checker.py | Adds a unit test validating span exception/status behavior on CAA lookup failures. |
| src/open_mpic_core/mpic_dcv_checker/mpic_dcv_checker.py | Adds OTel tracer/meter initialization and records request counts + duration histograms for DCV checks. |
| src/open_mpic_core/mpic_coordinator/mpic_coordinator.py | Adds OTel spans plus coordinator/request/remote-error/perspective-response metrics. |
| src/open_mpic_core/mpic_caa_checker/mpic_caa_checker.py | Adds OTel spans, request counter, and duration histograms for CAA checks and DNS lookup timing. |
| src/open_mpic_core/common_util/telemetry.py | New helper module providing get_meter / get_tracer accessors. |
| src/open_mpic_core/init.py | Re-exports get_meter / get_tracer from the public package API. |
| pyproject.toml | Adds opentelemetry-api runtime dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ceptions and setting error statuses for DNS and HTTP lookup failures
There was a problem hiding this comment.
Pull request overview
Adds OpenTelemetry-based tracing and metrics instrumentation to core MPIC components (coordinator, DCV checker, CAA checker) via shared helper accessors, and extends unit tests to validate span error/exception recording behavior.
Changes:
- Introduce
get_meter/get_tracerhelpers and export them fromopen_mpic_core. - Add counters/histograms and spans to MPIC Coordinator, DCV checker, and CAA checker (including exception recording and span error status).
- Add/extend unit tests covering span creation and exception/status behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/open_mpic_core/common_util/telemetry.py |
New OpenTelemetry accessors for meters/tracers (API-only dependency). |
src/open_mpic_core/__init__.py |
Re-export telemetry helpers for internal consumers. |
src/open_mpic_core/mpic_coordinator/mpic_coordinator.py |
Add coordinator-level spans + request/response/error metrics; record exceptions on span errors. |
src/open_mpic_core/mpic_dcv_checker/mpic_dcv_checker.py |
Add DCV request span + per-protocol spans and duration metrics; record exceptions/status on failures. |
src/open_mpic_core/mpic_caa_checker/mpic_caa_checker.py |
Add CAA check + DNS lookup spans and duration/request metrics; record exceptions/status on lookup failures. |
tests/unit/open_mpic_core/test_mpic_coordinator.py |
Add span-related tests for coordinator and remote-call failure. |
tests/unit/open_mpic_core/test_mpic_dcv_checker.py |
Add tests asserting exception recording/status on DNS/HTTP validation failures. |
tests/unit/open_mpic_core/test_mpic_caa_checker.py |
Add test asserting exception recording/status on CAA lookup failure. |
pyproject.toml |
Add opentelemetry-api dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ty and maintainability
There was a problem hiding this comment.
Pull request overview
Adds first-class OpenTelemetry (OTel) tracing + metrics hooks across core MPIC components to improve observability, plus some refactoring/formatting adjustments to accommodate the new instrumentation.
Changes:
- Introduce
get_meter/get_tracerhelpers (no-op safe when no SDK is configured) and export them fromopen_mpic_core. - Add spans, exception recording, span error status, and basic counters/histograms for MPIC coordinator, DCV checker, and CAA checker.
- Extend unit tests to validate span creation and exception/status recording behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/open_mpic_core/common_util/telemetry.py |
New OTel accessor helpers wrapping global providers (no-op safe). |
src/open_mpic_core/__init__.py |
Re-export telemetry helpers for package-level access. |
src/open_mpic_core/mpic_dcv_checker/mpic_dcv_checker.py |
Add spans + metrics for DCV checks and HTTP/DNS sub-operations, including exception recording. |
src/open_mpic_core/mpic_caa_checker/mpic_caa_checker.py |
Add spans + metrics around CAA checks and DNS lookup timing, including exception recording. |
src/open_mpic_core/mpic_coordinator/mpic_coordinator.py |
Add coordinator + remote-call spans/metrics and counters for perspective outcomes/errors. |
tests/unit/open_mpic_core/test_mpic_dcv_checker.py |
Add tests ensuring DNS/HTTP lookup errors record exceptions and set span error status. |
tests/unit/open_mpic_core/test_mpic_caa_checker.py |
Add tests ensuring DNS lookup failures record exceptions and set span error status. |
tests/unit/open_mpic_core/test_mpic_coordinator.py |
Add tests ensuring coordinator span starts and remote failures record exceptions/status. |
pyproject.toml |
Add pinned runtime dependency on opentelemetry-api. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR introduces OpenTelemetry-based tracing/metrics helpers and instruments key MPIC components (DCV checker, CAA checker, and coordinator) to emit spans and basic request/latency metrics, alongside minor refactors to improve readability and resilience.
Changes:
- Add
get_meter/get_tracerhelpers (re-exported fromopen_mpic_core) and addopentelemetry-apias a dependency. - Instrument DCV checker, CAA checker, and MPIC coordinator with spans, exception recording, and counters/histograms for request counts and durations.
- Extend unit tests to validate span creation and error-status/exception recording behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/open_mpic_core/test_mpic_dcv_checker.py | Adds span error-recording assertions for DNS/HTTP lookup failures. |
| tests/unit/open_mpic_core/test_mpic_coordinator.py | Adds span-start and remote-failure span error-recording tests. |
| tests/unit/open_mpic_core/test_mpic_caa_checker.py | Adds span error-recording assertions for DNS lookup failures. |
| src/open_mpic_core/mpic_dcv_checker/mpic_dcv_checker.py | Adds tracer/meter instrumentation, spans around check + DNS/HTTP validations, and duration/request metrics. |
| src/open_mpic_core/mpic_coordinator/mpic_coordinator.py | Adds coordinator/remote-call spans, request/duration counters, and defensive handling for unexpected gather() results. |
| src/open_mpic_core/mpic_caa_checker/mpic_caa_checker.py | Adds spans/metrics for CAA checks and DNS lookup timing with exception recording on failures. |
| src/open_mpic_core/common_util/telemetry.py | New helper module providing versioned OpenTelemetry meter/tracer accessors. |
| src/open_mpic_core/init.py | Re-exports get_meter / get_tracer from common_util.telemetry. |
| pyproject.toml | Adds pinned runtime dependency on opentelemetry-api. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This looks good to me. |
Introduce OpenTelemetry helpers for metrics and tracing in MPIC components, enhancing observability. Refactor code for improved readability by adjusting line breaks in method calls across multiple files.