Skip to content

Commit 5b77f57

Browse files
committed
document span_matcher.h
1 parent 913b07c commit 5b77f57

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/datadog/span_matcher.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
#pragma once
22

3+
// This component provides a `struct`, `SpanMatcher`, that is used as a base
4+
// class for `TraceSamplerConfig::Rule`, `SpanSamplerConfig::Rule`, and related
5+
// types. A `SpanMatcher` is a pattern that a given span either matches or
6+
// doesn't, depending on that span's service, operation name, resource name, and
7+
// tags. The member function `SpanMatcher::match` returns whether a specified
8+
// span matches the pattern.
9+
//
10+
// `SpanMatcher` is composed of glob patterns. See `glob.h`.
11+
312
#include <string>
413
#include <unordered_map>
514

@@ -15,6 +24,8 @@ struct SpanMatcher {
1524
std::string service = "*";
1625
std::string name = "*";
1726
std::string resource = "*";
27+
// For each (key, value), the tag's key must be present and match literally
28+
// (no globbing), while the tag's value must match the glob pattern.
1829
std::unordered_map<std::string, std::string> tags;
1930

2031
bool match(const SpanData&) const;

0 commit comments

Comments
 (0)