Make `metrics` private to `telemetry` (#59)

Only the `DstLabels` and `Serve` types in `metrics` are used outside of
`telemetry`.

This change narrows visibility so that `metrics` is not referenced
outside of `telemetry`.
This commit is contained in:
Oliver Gould 2018-08-10 11:41:36 -07:00 committed by GitHub
parent 005d4f19c6
commit 37d6e56f3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 9 additions and 9 deletions

View File

@ -24,7 +24,7 @@ use control::{
remote_stream::Remote, remote_stream::Remote,
}; };
use dns::{self, IpAddrListFuture}; use dns::{self, IpAddrListFuture};
use telemetry::metrics::DstLabels; use telemetry::DstLabels;
use transport::{tls, DnsNameAndPort}; use transport::{tls, DnsNameAndPort};
use conditional::Conditional; use conditional::Conditional;

View File

@ -1,6 +1,6 @@
use std::net::SocketAddr; use std::net::SocketAddr;
use telemetry::metrics::DstLabels; use telemetry::DstLabels;
use super::{Metadata, ProtocolHint}; use super::{Metadata, ProtocolHint};
use tls; use tls;
use conditional::Conditional; use conditional::Conditional;

View File

@ -41,7 +41,7 @@ use tower_discover::{Change, Discover};
use tower_service::Service; use tower_service::Service;
use dns; use dns;
use telemetry::metrics::DstLabels; use telemetry::DstLabels;
use transport::{DnsNameAndPort, HostAndPort}; use transport::{DnsNameAndPort, HostAndPort};
pub mod background; pub mod background;

View File

@ -2,7 +2,7 @@ use http;
use std::sync::{Arc, atomic::AtomicUsize}; use std::sync::{Arc, atomic::AtomicUsize};
use ctx; use ctx;
use telemetry::metrics::DstLabels; use telemetry::DstLabels;
use std::sync::atomic::Ordering; use std::sync::atomic::Ordering;
use transport::tls; use transport::tls;
use conditional::Conditional; use conditional::Conditional;

View File

@ -88,7 +88,7 @@ pub mod test_util {
use ctx; use ctx;
use control::destination; use control::destination;
use telemetry::metrics::DstLabels; use telemetry::DstLabels;
use tls; use tls;
use conditional::Conditional; use conditional::Conditional;

View File

@ -6,7 +6,7 @@ use std::{
}; };
use ctx; use ctx;
use control::destination; use control::destination;
use telemetry::metrics::DstLabels; use telemetry::DstLabels;
use transport::tls; use transport::tls;
use conditional::Conditional; use conditional::Conditional;

View File

@ -19,8 +19,7 @@ macro_rules! metrics {
mod errno; mod errno;
pub mod event; pub mod event;
// TODO this shouldn't need to be public. mod metrics;
pub mod metrics;
mod process; mod process;
pub mod sensor; pub mod sensor;
pub mod tap; pub mod tap;
@ -28,13 +27,14 @@ pub mod tls_config_reload;
use self::errno::Errno; use self::errno::Errno;
pub use self::event::Event; pub use self::event::Event;
pub use self::metrics::{DstLabels, Serve as ServeMetrics};
pub use self::sensor::Sensors; pub use self::sensor::Sensors;
pub fn new( pub fn new(
process: &Arc<ctx::Process>, process: &Arc<ctx::Process>,
metrics_retain_idle: Duration, metrics_retain_idle: Duration,
taps: &Arc<Mutex<tap::Taps>>, taps: &Arc<Mutex<tap::Taps>>,
) -> (Sensors, tls_config_reload::Sensor, metrics::Serve) { ) -> (Sensors, tls_config_reload::Sensor, ServeMetrics) {
let (tls_config_sensor, tls_config_fmt) = tls_config_reload::new(); let (tls_config_sensor, tls_config_fmt) = tls_config_reload::new();
let (metrics_record, metrics_serve) = metrics::new(process, metrics_retain_idle, tls_config_fmt); let (metrics_record, metrics_serve) = metrics::new(process, metrics_retain_idle, tls_config_fmt);
let s = Sensors::new(metrics_record, taps); let s = Sensors::new(metrics_record, taps);