You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "andylokandy (via GitHub)" <gi...@apache.org> on 2025/01/08 12:20:05 UTC
[PR] feat(layer/otelmetrics): add OtelMetricsLayer [opendal]
andylokandy opened a new pull request, #5524:
URL: https://github.com/apache/opendal/pull/5524
# Which issue does this PR close?
# What changes are included in this PR?
- add `layer::OtelMetricsLayer` to report metrics via opentelemetry
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(layer/otelmetrics): add OtelMetricsLayer [opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo merged PR #5524:
URL: https://github.com/apache/opendal/pull/5524
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(layer/otelmetrics): add OtelMetricsLayer [opendal]
Posted by "andylokandy (via GitHub)" <gi...@apache.org>.
andylokandy commented on code in PR #5524:
URL: https://github.com/apache/opendal/pull/5524#discussion_r1907106699
##########
core/src/layers/otelmetrics.rs:
##########
@@ -0,0 +1,202 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use std::sync::Arc;
+use std::sync::LazyLock;
+use std::time::Duration;
+
+use opentelemetry::global;
+use opentelemetry::metrics::Counter;
+use opentelemetry::metrics::Histogram;
+use opentelemetry::KeyValue;
+
+use crate::layers::observe;
+use crate::raw::*;
+use crate::*;
+
+/// OpenTelemetry metrics for OpenDAL operations
+#[derive(Debug)]
+struct Metrics {
+ /// Duration of operations
+ duration_seconds: Histogram<f64>,
+ /// Size of operations
+ bytes: Histogram<u64>,
+ /// Number of operation errors
+ errors: Counter<u64>,
+}
+
+static METRICS: LazyLock<Metrics> = LazyLock::new(|| {
Review Comment:
I'm not sure whether this should be moved into the `OtelMetricsLayer`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(layer/otelmetrics): add OtelMetricsLayer [opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #5524:
URL: https://github.com/apache/opendal/pull/5524#discussion_r1907153033
##########
core/Cargo.toml:
##########
@@ -374,7 +376,7 @@ mime_guess = { version = "2.0.5", optional = true }
# for layers-fastrace
fastrace = { version = "0.7.1", optional = true }
# for layers-opentelemetry
-opentelemetry = { version = "0.26", optional = true }
+opentelemetry = { version = "0.27", optional = true }
Review Comment:
Is it urgent to merge this PR? If not, we can simply upgrade to the latest version and wait for the next release.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(layer/otelmetrics): add OtelMetricsLayer [opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #5524:
URL: https://github.com/apache/opendal/pull/5524#discussion_r1907105466
##########
core/Cargo.toml:
##########
@@ -374,7 +376,7 @@ mime_guess = { version = "2.0.5", optional = true }
# for layers-fastrace
fastrace = { version = "0.7.1", optional = true }
# for layers-opentelemetry
-opentelemetry = { version = "0.26", optional = true }
+opentelemetry = { version = "0.27", optional = true }
Review Comment:
Hi, which version of opendal do you prefer to use?
It's better to stick with `0.26` if possible to remain within opendal 0.51.1. Otherwise, we might need to switch to opendal 0.52.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(layer/otelmetrics): add OtelMetricsLayer [opendal]
Posted by "andylokandy (via GitHub)" <gi...@apache.org>.
andylokandy commented on code in PR #5524:
URL: https://github.com/apache/opendal/pull/5524#discussion_r1907112181
##########
core/Cargo.toml:
##########
@@ -374,7 +376,7 @@ mime_guess = { version = "2.0.5", optional = true }
# for layers-fastrace
fastrace = { version = "0.7.1", optional = true }
# for layers-opentelemetry
-opentelemetry = { version = "0.26", optional = true }
+opentelemetry = { version = "0.27", optional = true }
Review Comment:
I'd like to upgrade to the latest otel but if you have any concern about it I could lower the otel requirement in this PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org