Skip to content

Commit

Permalink
refactor: export metrics exporters in mod level (#804)
Browse files Browse the repository at this point in the history
To avoid conflict on multiple features enabled.

Signed-off-by: MrCroxx <[email protected]>
  • Loading branch information
MrCroxx authored Nov 27, 2024
1 parent 2cac366 commit 7e0b714
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/export_metrics_prometheus_hyper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use std::{future::Future, net::SocketAddr, pin::Pin};

use anyhow::Ok;
use foyer::{Cache, CacheBuilder, PrometheusMetricsRegistry};
use foyer::{prometheus::PrometheusMetricsRegistry, Cache, CacheBuilder};
use http_body_util::Full;
use hyper::{
body::{Bytes, Incoming},
Expand Down
6 changes: 3 additions & 3 deletions foyer-bench/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ use bytesize::ByteSize;
use clap::{builder::PossibleValuesParser, ArgGroup, Parser};
use exporter::PrometheusExporter;
use foyer::{
Compression, DirectFileDeviceOptions, DirectFsDeviceOptions, Engine, FifoConfig, FifoPicker, HybridCache,
HybridCacheBuilder, InvalidRatioPicker, LargeEngineOptions, LfuConfig, LruConfig, PrometheusMetricsRegistry,
RateLimitPicker, RecoverMode, RuntimeOptions, S3FifoConfig, SmallEngineOptions, TokioRuntimeOptions,
prometheus::PrometheusMetricsRegistry, Compression, DirectFileDeviceOptions, DirectFsDeviceOptions, Engine,
FifoConfig, FifoPicker, HybridCache, HybridCacheBuilder, InvalidRatioPicker, LargeEngineOptions, LfuConfig,
LruConfig, RateLimitPicker, RecoverMode, RuntimeOptions, S3FifoConfig, SmallEngineOptions, TokioRuntimeOptions,
TracingOptions,
};
use futures::future::join_all;
Expand Down
8 changes: 6 additions & 2 deletions foyer/src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@
// limitations under the License.

#[cfg(feature = "opentelemetry")]
pub use crate::common::metrics::registry::opentelemetry::OpenTelemetryMetricsRegistry;
pub use crate::common::metrics::registry::opentelemetry;
#[cfg(feature = "opentelemetry_0_26")]
pub use crate::common::metrics::registry::opentelemetry_0_26;
#[cfg(feature = "opentelemetry_0_27")]
pub use crate::common::metrics::registry::opentelemetry_0_27;
#[cfg(feature = "prometheus")]
pub use crate::common::metrics::registry::prometheus::PrometheusMetricsRegistry;
pub use crate::common::metrics::registry::prometheus;
pub use crate::{
common::{
buf::{BufExt, BufMutExt},
Expand Down

0 comments on commit 7e0b714

Please sign in to comment.