-
Notifications
You must be signed in to change notification settings - Fork 175
Expand file tree
/
Copy pathsampling_rules.phpt
More file actions
89 lines (83 loc) · 2.36 KB
/
sampling_rules.phpt
File metadata and controls
89 lines (83 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
--TEST--
Priority sampling rules should use the inferred span's service & resource
--ENV--
DD_TRACE_SAMPLING_RULES=[{"sample_rate": 0.7, "service": "foo", "resource": "bar"},{"sample_rate": 0.3, "service": "example.com", "resource": "GET \/test"}]
DD_TRACE_SAMPLING_RULES_FORMAT=regex
DD_TRACE_AUTO_FLUSH_ENABLED=0
DD_TRACE_GENERATE_ROOT_SPAN=0
DD_CODE_ORIGIN_FOR_SPANS_ENABLED=0
DD_SERVICE=foo
DD_TRACE_INFERRED_PROXY_SERVICES_ENABLED=1
HTTP_X_DD_PROXY=aws-apigateway
HTTP_X_DD_PROXY_REQUEST_TIME_MS=100
HTTP_X_DD_PROXY_PATH=/test
HTTP_X_DD_PROXY_HTTPMETHOD=GET
HTTP_X_DD_PROXY_DOMAIN_NAME=example.com
HTTP_X_DD_PROXY_STAGE=aws-prod
METHOD=GET
SERVER_NAME=localhost:8888
SCRIPT_NAME=/foo.php
REQUEST_URI=/foo
DD_TRACE_DEBUG_PRNG_SEED=42
--INI--
pcre.jit=0
--GET--
foo=bar
--FILE--
<?php
$parent = \DDTrace\start_span(0.120);
\DDTrace\close_span();
echo json_encode(dd_trace_serialize_closed_spans(), JSON_PRETTY_PRINT);
?>
--EXPECTF--
[
{
"trace_id": "13930160852258120406",
"span_id": "13930160852258120406",
"parent_id": "11788048577503494824",
"start": 120000000,
"duration": %d,
"name": "web.request",
"resource": "GET \/foo",
"service": "foo",
"type": "web",
"meta": {
"_dd.p.ksr": "0.3",
"http.method": "GET",
"http.status_code": "200",
"http.url": "http:\/\/localhost:8888\/foo",
"runtime-id": "%s"
},
"metrics": {
"php.compilation.total_time_ms": %f,
"php.memory.peak_real_usage_bytes": %d,
"php.memory.peak_usage_bytes": %d,
"process_id": %d
}
},
{
"trace_id": "13930160852258120406",
"span_id": "11788048577503494824",
"start": 100000000,
"duration": %d,
"name": "aws.apigateway",
"resource": "GET \/test",
"service": "example.com",
"type": "web",
"meta": {
"_dd.p.dm": "-3",
"_dd.p.ksr": "0.3",
"_dd.p.tid": "%s",
"component": "aws-apigateway",
"http.method": "GET",
"http.status_code": "200",
"http.url": "example.com\/test",
"stage": "aws-prod"
},
"metrics": {
"_dd.inferred_span": 1,
"_dd.rule_psr": 0.3,
"_sampling_priority_v1": 2
}
}
]