Skip to content

Commit

Permalink
impl(GCS+gRPC): format gRPC metric names (#14381)
Browse files Browse the repository at this point in the history
  • Loading branch information
coryan authored Jun 27, 2024
1 parent 902e7be commit a991917
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "absl/types/variant.h"
#include <google/api/monitored_resource.pb.h>
#include <opentelemetry/sdk/resource/semantic_conventions.h>
#include <algorithm>
#include <type_traits>

namespace google {
Expand Down Expand Up @@ -70,8 +71,10 @@ Options MetricsExporterOptions(

return Options{}
.set<otel_internal::ServiceTimeSeriesOption>(true)
.set<otel_internal::MetricNameFormatterOption>(
[](auto s) { return "storage.googleapis.com/" + s; })
.set<otel_internal::MetricNameFormatterOption>([](std::string s) {
std::replace(s.begin(), s.end(), '.', '/');
return "storage.googleapis.com/" + std::move(s);
})
.set<otel_internal::MonitoredResourceOption>(
std::move(monitored_resource));
}
Expand Down

0 comments on commit a991917

Please sign in to comment.