-
Notifications
You must be signed in to change notification settings - Fork 9
Add OpenTelemetry integration and code refactoring #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
fd51859
Add OpenTelemetry telemetry helpers and integrate metrics and tracing…
ahanafy ebdda11
Refactor code for improved readability by adjusting line breaks in me…
ahanafy cdf8fb7
Record exception in CAA lookup error handling for improved tracing
ahanafy 86d3c82
Add exception recording and error status handling for DNS lookup fail…
ahanafy b767675
Refactor OpenTelemetry status handling to use Status wrapper for erro…
ahanafy 9bfa962
Update OpenTelemetry API version and improve telemetry data handling …
ahanafy 75dda7e
Enhance error handling in DCV checker and coordinator by recording ex…
ahanafy 8a0e4dd
Refactor call to remote perspective function in test to improve clari…
ahanafy b684e12
Simplify logging of RemoteCheckException by removing trace ID from wa…
ahanafy e3b284f
Add Alan Hanafy to the list of contributors in README.md
ahanafy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| """OpenTelemetry accessor helpers for open-mpic-core. | ||
|
|
||
| Depends only on ``opentelemetry-api``. When no SDK provider is registered the | ||
| returned Meter/Tracer objects are silent no-ops — the library is safe to use | ||
| without any OTEL configuration. | ||
|
|
||
| Container services configure real providers at startup (before any requests are | ||
| processed), after which every ``get_meter`` / ``get_tracer`` call in the core | ||
| routes through those providers automatically. | ||
| """ | ||
|
|
||
| from open_mpic_core.__about__ import __version__ | ||
| from opentelemetry import metrics, trace | ||
|
|
||
| _INSTRUMENTATION_VERSION: str = __version__ | ||
|
|
||
|
|
||
| def get_meter(name: str) -> metrics.Meter: | ||
| """Return a :class:`~opentelemetry.metrics.Meter` scoped to *name*. | ||
|
|
||
| Resolves through the global ``MeterProvider``; returns a no-op Meter when | ||
| no SDK provider has been registered. | ||
| """ | ||
| return metrics.get_meter(name, version=_INSTRUMENTATION_VERSION) | ||
|
|
||
|
|
||
| def get_tracer(name: str) -> trace.Tracer: | ||
| """Return a :class:`~opentelemetry.trace.Tracer` scoped to *name*. | ||
|
|
||
| Resolves through the global ``TracerProvider``; returns a no-op Tracer when | ||
| no SDK provider has been registered. | ||
| """ | ||
| return trace.get_tracer(name, instrumenting_library_version=_INSTRUMENTATION_VERSION) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.