-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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(unstable): add metrics to otel #27143
base: main
Are you sure you want to change the base?
Conversation
Co-Authored-By: Luca Casonato <[email protected]>
|
||
impl MetricProcessor { | ||
fn new(exporter: MetricExporter) -> Self { | ||
let (tx, mut rx) = tokio::sync::mpsc::channel(2048); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reasoning why buffer of this size was chosen?
fn force_flush(&self) -> Result<(), anyhow::Error> { | ||
let (tx, rx) = tokio::sync::oneshot::channel(); | ||
self.tx.try_send(MetricProcessorMessage::Flush(tx))?; | ||
deno_core::futures::executor::block_on(rx)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using block_on
is usually trouble, but I don't see any other way here...
let x = v8::ValueView::new(scope, string); | ||
match x.data() { | ||
v8::ValueViewData::OneByte(bytes) => { | ||
String::from_utf8_lossy(bytes).into_owned() | ||
} | ||
v8::ValueViewData::TwoByte(bytes) => String::from_utf16_lossy(bytes), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to do it instead of v8::String::to_rust_string_lossy()
?
spans.on_end(temporary_span.0); | ||
} | ||
|
||
pub struct TemporaryMetricsExport { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some docstrings here about the purpose of these structs and enums?
histogram | ||
.data_points | ||
.last_mut() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it guaranteed there's gonna be at least one element?
Refs: #26852
Initial support for exporting metrics.