@@ -48,12 +48,14 @@ To begin, create a configuration file named *applicationinsights.json*. Save it
48
48
"sampling" : {
49
49
"overrides" : [
50
50
{
51
+ "telemetryKind" : " request" ,
51
52
"attributes" : [
52
53
...
53
54
],
54
55
"percentage" : 0
55
56
},
56
57
{
58
+ "telemetryKind" : " request" ,
57
59
"attributes" : [
58
60
...
59
61
],
@@ -65,41 +67,11 @@ To begin, create a configuration file named *applicationinsights.json*. Save it
65
67
}
66
68
```
67
69
68
- > [ !NOTE]
69
- > Starting from 3.4.0-BETA, ` telemetryKind ` of ` request ` , ` dependency ` , ` trace ` (log), or ` exception ` is supported
70
- > (and should be set) on all sampling overrides, e.g.
71
- > ``` json
72
- > {
73
- > "connectionString": "...",
74
- > "sampling": {
75
- > "percentage": 10
76
- > },
77
- > "preview": {
78
- > "sampling": {
79
- > "overrides": [
80
- > {
81
- > "telemetryKind": "request",
82
- > "attributes": [
83
- > ...
84
- > ],
85
- > "percentage": 0
86
- > },
87
- > {
88
- > "telemetryKind": "request",
89
- > "attributes": [
90
- > ...
91
- > ],
92
- > "percentage": 100
93
- > }
94
- > ]
95
- > }
96
- > }
97
- > }
98
- > ```
99
-
100
70
## How it works
101
71
102
- When a span is started, the attributes present on the span at that time are used to check if any of the sampling
72
+ ` telemetryKind ` must be one of ` request ` , ` dependency ` , ` trace ` (log), or ` exception ` .
73
+
74
+ When a span is started, the type of span and the attributes present on it at that time are used to check if any of the sampling
103
75
overrides match.
104
76
105
77
Matches can be either ` strict ` or ` regexp ` . Regular expression matches are performed against the entire attribute value,
@@ -118,31 +90,6 @@ If no sampling overrides match:
118
90
[ top-level sampling configuration] ( ./java-standalone-config.md#sampling ) is used.
119
91
* If this is not the first span in the trace, then the parent sampling decision is used.
120
92
121
- > [!NOTE]
122
- > Starting from 3.4.0-BETA, sampling overrides do not apply to "standalone" telemetry by default. Standalone telemetry
123
- > is any telemetry that is not associated with a request, e.g. startup logs.
124
- > You can make a sampling override apply to standalone telemetry by including the attribute
125
- > `includingStandaloneTelemetry` in the sampling override, e.g.
126
- > ```json
127
- > {
128
- > "connectionString": "...",
129
- > "preview": {
130
- > "sampling": {
131
- > "overrides": [
132
- > {
133
- > "telemetryKind": "dependency",
134
- > "includingStandaloneTelemetry": true,
135
- > "attributes": [
136
- > ...
137
- > ],
138
- > "percentage": 0
139
- > }
140
- > ]
141
- > }
142
- > }
143
- > }
144
- > ```
145
-
146
93
## Example: Suppress collecting telemetry for health checks
147
94
148
95
This will suppress collecting telemetry for all requests to ` /health-checks ` .
@@ -157,6 +104,7 @@ This will also suppress collecting any downstream spans (dependencies) that woul
157
104
"sampling" : {
158
105
"overrides" : [
159
106
{
107
+ "telemetryKind" : " request" ,
160
108
"attributes" : [
161
109
{
162
110
"key" : " http.url" ,
@@ -183,6 +131,7 @@ This will suppress collecting telemetry for all `GET my-noisy-key` redis calls.
183
131
"sampling" : {
184
132
"overrides" : [
185
133
{
134
+ "telemetryKind" : " dependency" ,
186
135
"attributes" : [
187
136
{
188
137
"key" : " db.system" ,
@@ -203,9 +152,6 @@ This will suppress collecting telemetry for all `GET my-noisy-key` redis calls.
203
152
}
204
153
```
205
154
206
- > [ !NOTE]
207
- > Starting from 3.4.0-BETA, ` telemetryKind ` is supported (and recommended) on all sampling overrides, e.g.
208
-
209
155
## Example: Collect 100% of telemetry for an important request type
210
156
211
157
This will collect 100% of telemetry for ` /login ` .
@@ -224,6 +170,7 @@ those will also be collected for all '/login' requests.
224
170
"sampling" : {
225
171
"overrides" : [
226
172
{
173
+ "telemetryKind" : " request" ,
227
174
"attributes" : [
228
175
{
229
176
"key" : " http.url" ,
0 commit comments