Skip to content

Commit de3d5a5

Browse files
Merge pull request #267171 from heyams/heya/update-docs-for-3.5-ga
Update sampling overrides
2 parents 30e0873 + 6867d15 commit de3d5a5

5 files changed

+97
-106
lines changed

articles/azure-monitor/app/java-standalone-sampling-overrides.md

Lines changed: 64 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.reviewer: mmcc
1111
# Sampling overrides (preview) - Azure Monitor Application Insights for Java
1212

1313
> [!NOTE]
14-
> The sampling overrides feature is in preview, starting from 3.0.3.
14+
> The sampling overrides feature is in GA, starting from 3.5.0.
1515
1616
Sampling overrides allow you to override the [default sampling percentage](./java-standalone-config.md#sampling),
1717
for example:
@@ -43,26 +43,22 @@ To begin, create a configuration file named *applicationinsights.json*. Save it
4343
"connectionString": "...",
4444
"sampling": {
4545
"percentage": 10
46-
},
47-
"preview": {
48-
"sampling": {
49-
"overrides": [
50-
{
51-
"telemetryType": "request",
52-
"attributes": [
53-
...
54-
],
55-
"percentage": 0
56-
},
57-
{
58-
"telemetryType": "request",
59-
"attributes": [
60-
...
61-
],
62-
"percentage": 100
63-
}
64-
]
65-
}
46+
"overrides": [
47+
{
48+
"telemetryType": "request",
49+
"attributes": [
50+
...
51+
],
52+
"percentage": 0
53+
},
54+
{
55+
"telemetryType": "request",
56+
"attributes": [
57+
...
58+
],
59+
"percentage": 100
60+
}
61+
]
6662
}
6763
}
6864
```
@@ -100,22 +96,20 @@ This example also suppresses collecting any downstream spans (dependencies) that
10096
```json
10197
{
10298
"connectionString": "...",
103-
"preview": {
104-
"sampling": {
105-
"overrides": [
106-
{
107-
"telemetryType": "request",
108-
"attributes": [
109-
{
110-
"key": "http.url",
111-
"value": "https?://[^/]+/health-check",
112-
"matchType": "regexp"
113-
}
114-
],
115-
"percentage": 0
116-
}
117-
]
118-
}
99+
"sampling": {
100+
"overrides": [
101+
{
102+
"telemetryType": "request",
103+
"attributes": [
104+
{
105+
"key": "url.path",
106+
"value": "/health-check",
107+
"matchType": "strict"
108+
}
109+
],
110+
"percentage": 0
111+
}
112+
]
119113
}
120114
}
121115
```
@@ -127,27 +121,25 @@ This example suppresses collecting telemetry for all `GET my-noisy-key` redis ca
127121
```json
128122
{
129123
"connectionString": "...",
130-
"preview": {
131-
"sampling": {
132-
"overrides": [
133-
{
134-
"telemetryType": "dependency",
135-
"attributes": [
136-
{
137-
"key": "db.system",
138-
"value": "redis",
139-
"matchType": "strict"
140-
},
141-
{
142-
"key": "db.statement",
143-
"value": "GET my-noisy-key",
144-
"matchType": "strict"
145-
}
146-
],
147-
"percentage": 0
148-
}
149-
]
150-
}
124+
"sampling": {
125+
"overrides": [
126+
{
127+
"telemetryType": "dependency",
128+
"attributes": [
129+
{
130+
"key": "db.system",
131+
"value": "redis",
132+
"matchType": "strict"
133+
},
134+
{
135+
"key": "db.statement",
136+
"value": "GET my-noisy-key",
137+
"matchType": "strict"
138+
}
139+
],
140+
"percentage": 0
141+
}
142+
]
151143
}
152144
}
153145
```
@@ -166,22 +158,20 @@ those are also collected for all '/login' requests.
166158
"sampling": {
167159
"percentage": 10
168160
},
169-
"preview": {
170-
"sampling": {
171-
"overrides": [
172-
{
173-
"telemetryType": "request",
174-
"attributes": [
175-
{
176-
"key": "http.url",
177-
"value": "https?://[^/]+/login",
178-
"matchType": "regexp"
179-
}
180-
],
181-
"percentage": 100
182-
}
183-
]
184-
}
161+
"sampling": {
162+
"overrides": [
163+
{
164+
"telemetryType": "request",
165+
"attributes": [
166+
{
167+
"key": "url.path",
168+
"value": "/login",
169+
"matchType": "strict"
170+
}
171+
],
172+
"percentage": 100
173+
}
174+
]
185175
}
186176
}
187177
```

articles/azure-monitor/app/java-standalone-telemetry-processors-examples.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ This section shows how to include spans for an attribute processor. The processo
2222
A match requires the span name to be equal to `spanA` or `spanB`.
2323

2424
These spans match the include properties, and the processor actions are applied:
25-
* Span1 Name: 'spanA' Attributes: {env: dev, test_request: 123, credit_card: 1234}
26-
* Span2 Name: 'spanB' Attributes: {env: dev, test_request: false}
27-
* Span3 Name: 'spanA' Attributes: {env: 1, test_request: dev, credit_card: 1234}
25+
* `Span1` Name: 'spanA' Attributes: {env: dev, test_request: 123, credit_card: 1234}
26+
* `Span2` Name: 'spanB' Attributes: {env: dev, test_request: false}
27+
* `Span3` Name: 'spanA' Attributes: {env: 1, test_request: dev, credit_card: 1234}
2828

2929
This span doesn't match the include properties, and the processor actions aren't applied:
3030
* Span4 Name: 'spanC' Attributes: {env: dev, test_request: false}
@@ -62,9 +62,9 @@ This section demonstrates how to exclude spans for an attribute processor. This
6262
A match requires the span name to be equal to `spanA` or `spanB`.
6363

6464
The following spans match the exclude properties, and the processor actions aren't applied:
65-
* Span1 Name: 'spanA' Attributes: {env: dev, test_request: 123, credit_card: 1234}
66-
* Span2 Name: 'spanB' Attributes: {env: dev, test_request: false}
67-
* Span3 Name: 'spanA' Attributes: {env: 1, test_request: dev, credit_card: 1234}
65+
* `Span1` Name: 'spanA' Attributes: {env: dev, test_request: 123, credit_card: 1234}
66+
* `Span2` Name: 'spanB' Attributes: {env: dev, test_request: false}
67+
* `Span3` Name: 'spanA' Attributes: {env: 1, test_request: dev, credit_card: 1234}
6868

6969
This span doesn't match the exclude properties, and the processor actions are applied:
7070
* Span4 Name: 'spanC' Attributes: {env: dev, test_request: false}
@@ -104,11 +104,11 @@ A match requires the following conditions to be met:
104104
* The span must have an attribute that has key `test_request`.
105105

106106
The following spans match the exclude properties, and the processor actions aren't applied.
107-
* Span1 Name: 'spanB' Attributes: {env: dev, test_request: 123, credit_card: 1234}
108-
* Span2 Name: 'spanA' Attributes: {env: dev, test_request: false}
107+
* `Span1` Name: 'spanB' Attributes: {env: dev, test_request: 123, credit_card: 1234}
108+
* `Span2` Name: 'spanA' Attributes: {env: dev, test_request: false}
109109

110110
The following span doesn't match the exclude properties, and the processor actions are applied:
111-
* Span3 Name: 'spanB' Attributes: {env: 1, test_request: dev, credit_card: 1234}
111+
* `Span3` Name: 'spanB' Attributes: {env: 1, test_request: dev, credit_card: 1234}
112112
* Span4 Name: 'spanC' Attributes: {env: dev, dev_request: false}
113113

114114

@@ -155,11 +155,11 @@ properties indicate which spans should be processed. The exclude properties filt
155155

156156
In the following configuration, these spans match the properties, and processor actions are applied:
157157

158-
* Span1 Name: 'spanB' Attributes: {env: production, test_request: 123, credit_card: 1234, redact_trace: "false"}
159-
* Span2 Name: 'spanA' Attributes: {env: staging, test_request: false, redact_trace: true}
158+
* `Span1` Name: 'spanB' Attributes: {env: production, test_request: 123, credit_card: 1234, redact_trace: "false"}
159+
* `Span2` Name: 'spanA' Attributes: {env: staging, test_request: false, redact_trace: true}
160160

161161
These spans don't match the include properties, and processor actions aren't applied:
162-
* Span3 Name: 'spanB' Attributes: {env: production, test_request: true, credit_card: 1234, redact_trace: false}
162+
* `Span3` Name: 'spanB' Attributes: {env: production, test_request: true, credit_card: 1234, redact_trace: false}
163163
* Span4 Name: 'spanC' Attributes: {env: dev, test_request: false}
164164

165165
```json
@@ -329,12 +329,12 @@ The following sample shows how to hash existing attribute values.
329329
### Extract
330330

331331
The following sample shows how to use a regular expression (regex) to create new attributes based on the value of another attribute.
332-
For example, given `http.url = http://example.com/path?queryParam1=value1,queryParam2=value2`, the following attributes are inserted:
332+
For example, given `url.path = /path?queryParam1=value1,queryParam2=value2`, the following attributes are inserted:
333333
* httpProtocol: `http`
334334
* httpDomain: `example.com`
335335
* httpPath: `path`
336336
* httpQueryParams: `queryParam1=value1,queryParam2=value2`
337-
* http.url: *no* change
337+
* url.path: *no* change
338338

339339
```json
340340
{
@@ -345,7 +345,7 @@ For example, given `http.url = http://example.com/path?queryParam1=value1,queryP
345345
"type": "attribute",
346346
"actions": [
347347
{
348-
"key": "http.url",
348+
"key": "url.path",
349349
"pattern": "^(?<httpProtocol>.*):\\/\\/(?<httpDomain>.*)\\/(?<httpPath>.*)(\\?|\\&)(?<httpQueryParams>.*)",
350350
"action": "extract"
351351
}
@@ -358,7 +358,7 @@ For example, given `http.url = http://example.com/path?queryParam1=value1,queryP
358358

359359
### Mask
360360

361-
For example, given `http.url = https://example.com/user/12345622` is updated to `http.url = https://example.com/user/****` using either of the below configurations.
361+
For example, given `url.path = https://example.com/user/12345622` is updated to `url.path = https://example.com/user/****` using either of the below configurations.
362362

363363

364364
First configuration example:
@@ -372,7 +372,7 @@ First configuration example:
372372
"type": "attribute",
373373
"actions": [
374374
{
375-
"key": "http.url",
375+
"key": "url.path",
376376
"pattern": "user\\/\\d+",
377377
"replace": "user\\/****",
378378
"action": "mask"
@@ -396,7 +396,7 @@ Second configuration example with regular expression group name:
396396
"type": "attribute",
397397
"actions": [
398398
{
399-
"key": "http.url",
399+
"key": "url.path",
400400
"pattern": "^(?<userGroupName>[a-zA-Z.:\/]+)\d+",
401401
"replace": "${userGroupName}**",
402402
"action": "mask"
@@ -407,9 +407,9 @@ Second configuration example with regular expression group name:
407407
}
408408
}
409409
```
410-
### Non-string typed attributes samples
410+
### Nonstring typed attributes samples
411411

412-
Starting 3.4.19 GA, telemetry processors support non-string typed attributes:
412+
Starting 3.4.19 GA, telemetry processors support nonstring typed attributes:
413413
`boolean`, `double`, `long`, `boolean-array`, `double-array`, `long-array`, and `string-array`.
414414

415415
When `attributes.type` is not provided in the json, it's default to `string`.
@@ -461,7 +461,7 @@ The following sample inserts the new attribute `{"newAttributeKeyStrict": "newAt
461461

462462
```
463463

464-
Additionally, non-string typed attributes support `regexp`.
464+
Additionally, nonstring typed attributes support `regexp`.
465465

466466
The following sample inserts the new attribute `{"newAttributeKeyRegexp": "newAttributeValueRegexp"}` into spans and logs where the attribute `longRegexpAttributeKey` matches the value from `400` to `499`.
467467

articles/azure-monitor/app/java-standalone-telemetry-processors.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -397,11 +397,11 @@ This section lists some common span attributes that telemetry processors can use
397397

398398
| Attribute | Type | Description |
399399
|---|---|---|
400-
| `http.method` | string | HTTP request method.|
401-
| `http.url` | string | Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. The fragment isn't usually transmitted over HTTP. But if the fragment is known, it should be included.|
402-
| `http.status_code` | number | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).|
403-
| `http.flavor` | string | Type of HTTP protocol. |
404-
| `http.user_agent` | string | Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. |
400+
| `http.request.method` (used to be `http.method`) | string | HTTP request method.|
401+
| `url.full` (client span) or `url.path` (server span) (used to be `http.url`) | string | Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. The fragment isn't usually transmitted over HTTP. But if the fragment is known, it should be included.|
402+
| `http.response.status_code` (used to be `http.status_code`) | number | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).|
403+
| `network.protocol.version` (used to be `http.flavor`) | string | Type of HTTP protocol. |
404+
| `user_agent.original` (used to be `http.user_agent`) | string | Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. |
405405

406406
### JDBC spans
407407

articles/azure-monitor/app/java-standalone-upgrade-from-2x.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ The telemetry processors perform the following actions (in order):
8585
which means it applies to all telemetry that has attributes
8686
(currently `requests` and `dependencies`, but soon also `traces`).
8787

88-
It matches any telemetry that has attributes named `http.method` and `http.url`.
88+
It matches any telemetry that has attributes named `http.request.method` and `url.path`.
8989

90-
Then it extracts the path portion of the `http.url` attribute into a new attribute named `tempName`.
90+
Then it extracts `url.path` attribute into a new attribute named `tempName`.
9191

9292
2. The second telemetry processor is a span processor (has type `span`),
9393
which means it applies to `requests` and `dependencies`.
@@ -111,13 +111,13 @@ The telemetry processors perform the following actions (in order):
111111
"include": {
112112
"matchType": "strict",
113113
"attributes": [
114-
{ "key": "http.method" },
115-
{ "key": "http.url" }
114+
{ "key": "http.request.method" },
115+
{ "key": "url.path" }
116116
]
117117
},
118118
"actions": [
119119
{
120-
"key": "http.url",
120+
"key": "url.path",
121121
"pattern": "https?://[^/]+(?<tempPath>/[^?]*)",
122122
"action": "extract"
123123
}
@@ -132,7 +132,7 @@ The telemetry processors perform the following actions (in order):
132132
]
133133
},
134134
"name": {
135-
"fromAttributes": [ "http.method", "tempPath" ],
135+
"fromAttributes": [ "http.request.method", "tempPath" ],
136136
"separator": " "
137137
}
138138
},

articles/azure-monitor/app/opentelemetry-enable.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Download the [applicationinsights-agent-3.5.0.jar](https://github.com/microsoft/
8383
> [!WARNING]
8484
>
8585
> If you are upgrading from an earlier 3.x version, you may be impacted by changing defaults or slight differences in the data we collect. For more information, see the migration section in the release notes.
86+
> [3.5.0](https://github.com/microsoft/ApplicationInsights-Java/releases/tag/3.5.0),
8687
> [3.4.0](https://github.com/microsoft/ApplicationInsights-Java/releases/tag/3.4.0),
8788
> [3.3.0](https://github.com/microsoft/ApplicationInsights-Java/releases/tag/3.3.0),
8889
> [3.2.0](https://github.com/microsoft/ApplicationInsights-Java/releases/tag/3.2.0), and

0 commit comments

Comments
 (0)