MCPcopy Create free account
hub / github.com/base/base / parse_otel_resource_attribute

Function parse_otel_resource_attribute

crates/execution/cli/src/standard_node.rs:965–974  ·  view source on GitHub ↗
(key: &str)

Source from the content-addressed store, hash-verified

963}
964
965fn parse_otel_resource_attribute(key: &str) -> Option<String> {
966 env::var("OTEL_RESOURCE_ATTRIBUTES").ok().and_then(|attrs| {
967 attrs.split(',').find_map(|part| {
968 let (attr_key, attr_value) = part.split_once('=')?;
969 (attr_key.trim() == key)
970 .then(|| attr_value.trim().to_string())
971 .filter(|v| !v.is_empty())
972 })
973 })
974}
975
976/// Opcode and precompile names the metering inspector can parse.
977///

Callers 1

Calls 3

okMethod · 0.80
splitMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected