Skip to content
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

feat(telemetry): add opentelemetry support #346

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

Michael-Preibisch
Copy link

No description provided.

telemetry/src/lib.rs Outdated Show resolved Hide resolved
telemetry/src/lib.rs Outdated Show resolved Hide resolved
telemetry/src/lib.rs Outdated Show resolved Hide resolved
telemetry/src/lib.rs Outdated Show resolved Hide resolved
telemetry/src/lib.rs Outdated Show resolved Hide resolved
telemetry/src/lib.rs Outdated Show resolved Hide resolved
@TheButlah TheButlah changed the title Introduce Opentelemetry feat(telemetry): add opentelemetry support Jan 3, 2025
telemetry/src/lib.rs Outdated Show resolved Hide resolved
telemetry/src/lib.rs Outdated Show resolved Hide resolved
telemetry/src/lib.rs Outdated Show resolved Hide resolved
telemetry/src/lib.rs Outdated Show resolved Hide resolved

impl Drop for TelemetryShutdownHandler {
fn drop(&mut self) {
global::shutdown_tracer_provider();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if we aren't using opentelemetry at all (for example, if we only did with_journald but did not do with_opentelemetry)? Will this panic?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it won't panic. The code is designed to safely handle cases where OpenTelemetry isn't used. If you only configure journald logging, the telemetry system will simply initialize without the OpenTelemetry components. This is achieved through Rust's Option type - when OpenTelemetry isn't configured, those components remain as None values and are safely skipped during initialization. The system will proceed with just the journald logging functionality working as expected.
This flexible design allows users to choose which telemetry features they need without worrying about dependencies on other components. You can start with basic logging and add OpenTelemetry later if needed, or just stick with logging if that's all your application requires.

update-agent/src/main.rs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants