Skip to content

Conversation

@Sushisource
Copy link
Member

@Sushisource Sushisource commented Aug 18, 2023

What was changed

Allows the starting of the prometheus server after initializing the Core runtime so Tokio will exist.

Why?

Panic bad

Checklist

  1. Closes

  2. How was this tested:
    Added integ test

  3. Any docs updates needed?

@Sushisource Sushisource requested a review from a team as a code owner August 18, 2023 17:55
@Sushisource Sushisource changed the title Make prom server startup lazy to avoid tokio runtime panics Allow attaching metric meters late Aug 18, 2023

/// Some metric meters cannot be initialized until after a tokio runtime has started and after
/// other telemetry has initted (ex: prometheus). They can be attached here.
pub fn attach_late_init_metrics(&mut self, meter: Arc<dyn CoreMeter + 'static>) {
Copy link
Member

Choose a reason for hiding this comment

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

Any reason I shouldn't always use this? It's easier for my code if I don't have some special knowledge of which CoreMeter impl needs late binding and which doesn't.

Copy link
Member Author

Choose a reason for hiding this comment

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

Feel free to always do it

@Sushisource Sushisource merged commit 8625016 into temporalio:master Aug 21, 2023
@Sushisource Sushisource deleted the fix-prom-startup branch August 21, 2023 17:58
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