File tree Expand file tree Collapse file tree 4 files changed +9
-4
lines changed
Expand file tree Collapse file tree 4 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,12 @@ All notable changes to this project will be documented in this file.
44The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
55and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
66
7- ## [ 0.11.0] - 2021-06-08
7+ ## [ 0.11.1] - 2021-06-08
8+ ### Fixed
9+ - Encode Info metric labels.
810
11+ ## [ 0.11.0] - 2021-06-08
12+ ### Added
913- Add support for OpenMetrics Info metrics (see [ PR 18] ).
1014
1115[ PR 18 ] : https://github.com/mxinden/rust-open-metrics-client/pull/18
Original file line number Diff line number Diff line change 11[package ]
22name = " open-metrics-client"
3- version = " 0.11.0 "
3+ version = " 0.11.1 "
44authors = [" Max Inden <mail@max-inden.de>" ]
55edition = " 2018"
66description = " Open Metrics client library allowing users to natively instrument applications."
Original file line number Diff line number Diff line change @@ -551,6 +551,7 @@ where
551551{
552552 fn encode ( & self , mut encoder : Encoder ) -> Result < ( ) , std:: io:: Error > {
553553 encoder
554+ . with_label_set ( & self . 0 )
554555 . encode_suffix ( "info" ) ?
555556 . no_bucket ( ) ?
556557 . encode_value ( 1u32 ) ?
@@ -674,7 +675,7 @@ mod tests {
674675
675676 let expected = "# HELP my_info_metric My info metric.\n " . to_owned ( )
676677 + "# TYPE my_info_metric info\n "
677- + "my_info_metric_info 1\n "
678+ + "my_info_metric_info{os= \" GNU/linux \" } 1\n "
678679 + "# EOF\n " ;
679680 assert_eq ! ( expected, String :: from_utf8( encoded. clone( ) ) . unwrap( ) ) ;
680681
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ use crate::metrics::{MetricType, TypedMetric};
1212///
1313/// let _info = Info::new(vec![("os", "GNU/linux")]);
1414/// ```
15- pub struct Info < S > ( S ) ;
15+ pub struct Info < S > ( pub ( crate ) S ) ;
1616
1717impl < S > Info < S > {
1818 pub fn new ( label_set : S ) -> Self {
You can’t perform that action at this time.
0 commit comments