Skip to content

Commit

Permalink
Merge branch 'main' into DisablePromCppTest
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomsonTan authored Apr 30, 2022
2 parents 30c0e16 + c8bd431 commit 09326db
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 12 deletions.
7 changes: 7 additions & 0 deletions .github/.codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,10 @@ comment:
# to coverage report file paths.
fixes:
- "/home/runner/::"

ignore:
- "docs/**/*"
- "docker/**/*"
- "examples/**/*"
- "**/test/**/*"
- "**.md"
Original file line number Diff line number Diff line change
Expand Up @@ -761,10 +761,10 @@ class Span : public opentelemetry::trace::Span
const opentelemetry::trace::StartSpanOptions &options,
Span *parent = nullptr) noexcept
: opentelemetry::trace::Span(),
start_time_(std::chrono::system_clock::now()),
owner_(owner),
parent_(parent),
context_(CreateContext()),
start_time_(std::chrono::system_clock::now())
context_(CreateContext())
{
name_ = name;
UNREFERENCED_PARAMETER(options);
Expand Down
2 changes: 1 addition & 1 deletion sdk/include/opentelemetry/sdk/metrics/view/view.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class View
public:
View(const std::string &name,
const std::string &description = "",
AggregationType aggregation_type = AggregationType::kDrop,
AggregationType aggregation_type = AggregationType::kDefault,
std::unique_ptr<opentelemetry::sdk::metrics::AttributesProcessor> attributes_processor =
std::unique_ptr<opentelemetry::sdk::metrics::AttributesProcessor>(
new opentelemetry::sdk::metrics::DefaultAttributesProcessor()))
Expand Down
2 changes: 1 addition & 1 deletion sdk/include/opentelemetry/sdk/metrics/view/view_registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class ViewRegistry
// return default view if none found;
if (!found)
{
static View view("");
static View view("otel-default-view");
if (!callback(view))
{
return false;
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/metrics/meter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace nostd = opentelemetry::nostd;
Meter::Meter(std::shared_ptr<MeterContext> meter_context,
std::unique_ptr<sdk::instrumentationlibrary::InstrumentationLibrary>
instrumentation_library) noexcept
: meter_context_{meter_context}, instrumentation_library_{std::move(instrumentation_library)}
: instrumentation_library_{std::move(instrumentation_library)}, meter_context_{meter_context}
{}

nostd::shared_ptr<metrics::Counter<long>> Meter::CreateLongCounter(nostd::string_view name,
Expand Down
16 changes: 9 additions & 7 deletions sdk/test/metrics/view_registry_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ TEST(ViewRegistry, FindViewsEmptyRegistry)
InstrumentationLibrary::Create("default", "1.0.0", "https://opentelemetry.io/schemas/1.7.0");
int count = 0;
ViewRegistry registry;
auto status = registry.FindViews(default_instrument_descriptor,
*default_instrumentation_lib.get(), [&count](const View &view) {
count++;
EXPECT_EQ(view.GetName(), "");
EXPECT_EQ(view.GetDescription(), "");
return true;
});
auto status =
registry.FindViews(default_instrument_descriptor, *default_instrumentation_lib.get(),
[&count](const View &view) {
count++;
EXPECT_EQ(view.GetName(), "otel-default-view");
EXPECT_EQ(view.GetDescription(), "");
EXPECT_EQ(view.GetAggregationType(), AggregationType::kDefault);
return true;
});
EXPECT_EQ(count, 1);
EXPECT_EQ(status, true);
}
Expand Down

0 comments on commit 09326db

Please sign in to comment.