Skip to content
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

doc: display feature flag on rust docs #9

Merged
merged 1 commit into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![cfg_attr(docsrs, feature(doc_cfg))]

mod utils;

pub mod metrics;
Expand Down
7 changes: 7 additions & 0 deletions src/registry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,33 @@ pub mod noop;

/// Prometheus metrics components.
#[cfg(feature = "prometheus")]
#[cfg_attr(docsrs, doc(cfg(feature = "prometheus")))]
pub mod prometheus;

#[cfg(feature = "prometheus-client")]
#[cfg_attr(docsrs, doc(cfg(feature = "prometheus-client")))]
pub use prometheus_client_0_23 as prometheus_client;

/// Prometheus metrics components.
#[cfg(feature = "prometheus-client_0_23")]
#[cfg_attr(docsrs, doc(cfg(feature = "prometheus-client_0_23")))]
pub mod prometheus_client_0_23;

/// Prometheus metrics components.
#[cfg(feature = "prometheus-client_0_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "prometheus-client_0_22")))]
pub mod prometheus_client_0_22;

#[cfg(feature = "opentelemetry")]
#[cfg_attr(docsrs, doc(cfg(feature = "opentelemetry")))]
pub use opentelemetry_0_27 as opentelemetry;

/// OpenTelemetry metrics components.
#[cfg(feature = "opentelemetry_0_27")]
#[cfg_attr(docsrs, doc(cfg(feature = "opentelemetry_0_27")))]
pub mod opentelemetry_0_27;

/// OpenTelemetry metrics components.
#[cfg(feature = "opentelemetry_0_26")]
#[cfg_attr(docsrs, doc(cfg(feature = "opentelemetry_0_26")))]
pub mod opentelemetry_0_26;
Loading