Skip to content

Commit

Permalink
[exporters/prometheus] Format
Browse files Browse the repository at this point in the history
  • Loading branch information
punya committed Sep 24, 2023
1 parent 80308a7 commit 54b1398
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
1 change: 0 additions & 1 deletion exporters/prometheus/src/collector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "opentelemetry/exporters/prometheus/collector.h"
#include "opentelemetry/sdk/common/global_log_handler.h"


OPENTELEMETRY_BEGIN_NAMESPACE

namespace metric_sdk = sdk::metrics;
Expand Down
13 changes: 5 additions & 8 deletions exporters/prometheus/test/exporter_utils_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
OPENTELEMETRY_BEGIN_NAMESPACE

using exporter::metrics::TranslateToPrometheus;
namespace metric_sdk = sdk::metrics;
namespace metric_api = metrics;
namespace metric_sdk = sdk::metrics;
namespace metric_api = metrics;

template <typename T>
void assert_basic(::prometheus::MetricFamily &metric,
Expand Down Expand Up @@ -104,8 +104,7 @@ TEST(PrometheusExporterUtils, TranslateToPrometheusIntegerCounter)

auto metric1 = translated[0];
std::vector<int> vals = {10};
assert_basic(metric1, "library_name", "description", ::prometheus::MetricType::Counter, 1,
vals);
assert_basic(metric1, "library_name", "description", ::prometheus::MetricType::Counter, 1, vals);
}

TEST(PrometheusExporterUtils, TranslateToPrometheusIntegerLastValue)
Expand All @@ -118,8 +117,7 @@ TEST(PrometheusExporterUtils, TranslateToPrometheusIntegerLastValue)

auto metric1 = translated[0];
std::vector<int> vals = {10};
assert_basic(metric1, "library_name", "description", ::prometheus::MetricType::Gauge, 1,
vals);
assert_basic(metric1, "library_name", "description", ::prometheus::MetricType::Gauge, 1, vals);
}

TEST(PrometheusExporterUtils, TranslateToPrometheusHistogramNormal)
Expand All @@ -132,8 +130,7 @@ TEST(PrometheusExporterUtils, TranslateToPrometheusHistogramNormal)

auto metric = translated[0];
std::vector<double> vals = {3, 900.5, 4};
assert_basic(metric, "library_name", "description", ::prometheus::MetricType::Histogram, 1,
vals);
assert_basic(metric, "library_name", "description", ::prometheus::MetricType::Histogram, 1, vals);
assert_histogram(metric, std::list<double>{10.1, 20.2, 30.2}, {200, 300, 400, 500});
}

Expand Down

0 comments on commit 54b1398

Please sign in to comment.