Skip to content

Commit cfcc93c

Browse files
authored
Merge branch 'main' into dmehala/telemetry/part-2-move-telemetry-exporter
2 parents b493cee + 431aa21 commit cfcc93c

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
- run:
111111
name: Install dependencies
112112
command: |
113-
choco install -y cmake --installargs 'ADD_CMAKE_TO_PATH=System'
113+
choco install -y cmake --version=3.31.6 --installargs 'ADD_CMAKE_TO_PATH=System'
114114
choco install -y ninja
115115
- run:
116116
name: Building

.github/workflows/codeql-analysis.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ jobs:
2525
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2626

2727
- name: Initialize CodeQL
28-
uses: github/codeql-action/init@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
28+
uses: github/codeql-action/init@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
2929
with:
3030
languages: ${{ matrix.language }}
3131

32+
- name: Install dependencies
33+
run: bin/install-cmake
34+
3235
- name: Build dd-trace-cpp
33-
run: |
34-
bin/install-cmake
35-
bin/cmake-build
36+
run: bin/cmake-build --preset=ci-codeql
3637

3738
- name: Perform CodeQL Analysis
38-
uses: github/codeql-action/analyze@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
39+
uses: github/codeql-action/analyze@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13

CMakePresets.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212
"DD_TRACE_STATIC_CRT": "1",
1313
"DD_TRACE_BUILD_TESTING": "1"
1414
}
15+
},
16+
{
17+
"name": "ci-codeql",
18+
"displayName": "CI CodeQL",
19+
"cacheVariables": {
20+
"CMAKE_POLICY_VERSION_MINIMUM": "3.5"
21+
}
1522
}
1623
]
1724
}

src/datadog/trace_sampler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ SamplingDecision TraceSampler::decide(const SpanData& span) {
5555
decision.limiter_max_per_second = limiter_max_per_second_;
5656
decision.configured_rate = rule.rate;
5757
const std::uint64_t threshold = max_id_from_rate(rule.rate);
58-
if (knuth_hash(span.trace_id.low) < threshold) {
58+
if (knuth_hash(span.trace_id.low) <= threshold) {
5959
const auto result = limiter_.allow();
6060
if (result.allowed) {
6161
decision.priority = int(SamplingPriority::USER_KEEP);
@@ -90,7 +90,7 @@ SamplingDecision TraceSampler::decide(const SpanData& span) {
9090
}
9191

9292
const std::uint64_t threshold = max_id_from_rate(*decision.configured_rate);
93-
if (knuth_hash(span.trace_id.low) < threshold) {
93+
if (knuth_hash(span.trace_id.low) <= threshold) {
9494
decision.priority = int(SamplingPriority::AUTO_KEEP);
9595
} else {
9696
decision.priority = int(SamplingPriority::AUTO_DROP);

0 commit comments

Comments
 (0)