Skip to content

Commit

Permalink
Do not ignore metric attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
owent committed Sep 21, 2023
1 parent 88e9857 commit a0b322b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,6 @@ class PrometheusExporterUtils
*/
static bool ShouldIgnoreResourceAttribute(const std::string &name);

/**
* Some attributes should be ignored when converting metric attributes to
* prometheus labels.
*
* @param name attribute name
* @return true if the attribute should be ignored, false otherwise.
*/
static bool ShouldIgnoreMetricAttribute(const std::string &name);

static opentelemetry::sdk::metrics::AggregationType getAggregationType(
const opentelemetry::sdk::metrics::PointType &point_type);

Expand Down
18 changes: 0 additions & 18 deletions exporters/prometheus/src/exporter_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,19 +214,6 @@ bool PrometheusExporterUtils::ShouldIgnoreResourceAttribute(const std::string &n
return ignores.end() != ignores.find(name);
}

bool PrometheusExporterUtils::ShouldIgnoreMetricAttribute(const std::string &name)
{
static std::unordered_set<std::string> ignores{
opentelemetry::sdk::resource::SemanticConventions::kServiceName,
opentelemetry::sdk::resource::SemanticConventions::kServiceInstanceId,
opentelemetry::trace::SemanticConventions::kServerAddress,
opentelemetry::trace::SemanticConventions::kServerPort,
opentelemetry::trace::SemanticConventions::kUrlScheme,
kPrometheusJob,
kPrometheusInstance};
return ignores.end() != ignores.find(name);
}

metric_sdk::AggregationType PrometheusExporterUtils::getAggregationType(
const metric_sdk::PointType &point_type)
{
Expand Down Expand Up @@ -390,11 +377,6 @@ void PrometheusExporterUtils::SetMetricBasic(prometheus_client::ClientMetric &me
{
for (auto &label : labels)
{
if (ShouldIgnoreMetricAttribute(label.first))
{
continue;
}

std::string label_name = SanitizeNames(label.first);
if (label_name == kPrometheusInstance)
{
Expand Down

0 comments on commit a0b322b

Please sign in to comment.