@@ -80,7 +80,7 @@ class FilteringAttributesProcessor : public AttributesProcessor
8080 MetricAttributes result;
8181 attributes.ForEachKeyValue (
8282 [&](nostd::string_view key, opentelemetry::common::AttributeValue value) noexcept {
83- if (allowed_attribute_keys_.find (key. data ( )) != allowed_attribute_keys_.end ())
83+ if (allowed_attribute_keys_.find (std::string (key )) != allowed_attribute_keys_.end ())
8484 {
8585 result.SetAttribute (key, value);
8686 return true ;
@@ -94,7 +94,7 @@ class FilteringAttributesProcessor : public AttributesProcessor
9494
9595 bool isPresent (nostd::string_view key) const noexcept override
9696 {
97- return (allowed_attribute_keys_.find (key. data ( )) != allowed_attribute_keys_.end ());
97+ return (allowed_attribute_keys_.find (std::string (key )) != allowed_attribute_keys_.end ());
9898 }
9999
100100private:
@@ -106,7 +106,7 @@ class FilteringAttributesProcessor : public AttributesProcessor
106106 * present in the exclude list
107107 */
108108
109- class FilteringExcludeAttributesProcessor : AttributesProcessor
109+ class FilteringExcludeAttributesProcessor : public AttributesProcessor
110110{
111111public:
112112 FilteringExcludeAttributesProcessor (std::unordered_map<std::string, bool > &&exclude_list = {})
@@ -124,7 +124,7 @@ class FilteringExcludeAttributesProcessor : AttributesProcessor
124124 MetricAttributes result;
125125 attributes.ForEachKeyValue (
126126 [&](nostd::string_view key, opentelemetry::common::AttributeValue value) noexcept {
127- if (exclude_list_.find (key. data ( )) == exclude_list_.end ())
127+ if (exclude_list_.find (std::string (key )) == exclude_list_.end ())
128128 {
129129 result.SetAttribute (key, value);
130130 return true ;
@@ -138,7 +138,7 @@ class FilteringExcludeAttributesProcessor : AttributesProcessor
138138
139139 bool isPresent (nostd::string_view key) const noexcept override
140140 {
141- return (exclude_list_.find (key. data ( )) == exclude_list_.end ());
141+ return (exclude_list_.find (std::string (key )) == exclude_list_.end ());
142142 }
143143
144144private:
0 commit comments