-
Notifications
You must be signed in to change notification settings - Fork 646
Closed
Labels
A-metricsArea: issues related to metricsArea: issues related to metricsA-traceArea: issues related to tracingArea: issues related to tracinghelp wantedGood for taking. Extra help will be provided by maintainers/approversGood for taking. Extra help will be provided by maintainers/approvers
Milestone
Description
We have an additional set of public APIs to create KeyValue struct apart from KeyValue::new(). These APIs don't offer anything additional in terms of feature or performance. They simply offer an alternative way to create KeyValue struct by creating the Key first and then the Value instead of having them created together.
I think we could remove these APIs just to keep our public API surface smaller. I'm opening this issue to check if anyone has any opinions on this.
opentelemetry-rust/opentelemetry/src/common.rs
Lines 36 to 73 in 66f29b8
| pub fn bool<T: Into<bool>>(self, value: T) -> KeyValue { | |
| KeyValue { | |
| key: self, | |
| value: Value::Bool(value.into()), | |
| } | |
| } | |
| /// Create a `KeyValue` pair for `i64` values. | |
| pub fn i64(self, value: i64) -> KeyValue { | |
| KeyValue { | |
| key: self, | |
| value: Value::I64(value), | |
| } | |
| } | |
| /// Create a `KeyValue` pair for `f64` values. | |
| pub fn f64(self, value: f64) -> KeyValue { | |
| KeyValue { | |
| key: self, | |
| value: Value::F64(value), | |
| } | |
| } | |
| /// Create a `KeyValue` pair for string-like values. | |
| pub fn string(self, value: impl Into<StringValue>) -> KeyValue { | |
| KeyValue { | |
| key: self, | |
| value: Value::String(value.into()), | |
| } | |
| } | |
| /// Create a `KeyValue` pair for arrays. | |
| pub fn array<T: Into<Array>>(self, value: T) -> KeyValue { | |
| KeyValue { | |
| key: self, | |
| value: Value::Array(value.into()), | |
| } | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-metricsArea: issues related to metricsArea: issues related to metricsA-traceArea: issues related to tracingArea: issues related to tracinghelp wantedGood for taking. Extra help will be provided by maintainers/approversGood for taking. Extra help will be provided by maintainers/approvers