Skip to content

Commit

Permalink
fix: wrote the new catch-all rule test incorrectly
Browse files Browse the repository at this point in the history
  • Loading branch information
dgoffredo committed Feb 9, 2022
1 parent 068544a commit 184d485
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/sample_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ TEST_CASE("rules sampler") {
SECTION("falls back to catch-all rule if sample_rate is configured and no other rule matches") {
TracerOptions tracer_options;
tracer_options.service = "test.service";
tracer_options.sample_rate = 0.2;
tracer_options.sample_rate = 0.5;
tracer_options.sampling_rules = R"([
{"name": "unmatched.name", "service": "unmatched.service", "sample_rate": 0.1}
])";
Expand All @@ -154,7 +154,7 @@ TEST_CASE("rules sampler") {

auto& metrics = mwriter->traces[0][0]->metrics;
REQUIRE(metrics.find("_dd.rule_psr") != metrics.end());
REQUIRE(metrics.find("_dd.limit_psr") != metrics.end());
REQUIRE(metrics["_dd.rule_psr"] == 0.5);
REQUIRE(metrics.find("_dd.agent_psr") == metrics.end());
}

Expand Down

0 comments on commit 184d485

Please sign in to comment.