Skip to content

Commit 881cf15

Browse files
Merge pull request #217318 from trask/sampling-attributes
Sampling attributes
2 parents c4c9050 + 685c935 commit 881cf15

File tree

1 file changed

+11
-21
lines changed

1 file changed

+11
-21
lines changed

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

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -186,28 +186,18 @@ those will also be collected for all '/login' requests.
186186
}
187187
```
188188

189-
## Common span attributes
189+
## Span attributes available for sampling
190190

191-
This section lists some common span attributes that sampling overrides can use.
191+
Span attribute names are based on the OpenTelemetry semantic conventions:
192192

193-
### HTTP spans
193+
* [HTTP](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md)
194+
* [Messaging](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/messaging.md)
195+
* [Database](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/database.md)
196+
* [RPC](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/rpc.md)
194197

195-
| Attribute | Type | Description |
196-
|---|---|---|
197-
| `http.method` | string | HTTP request method.|
198-
| `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.|
199-
| `http.flavor` | string | Type of HTTP protocol. |
200-
| `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. |
198+
To see the exact set of attributes captured by Application Insights Java for your application, set the
199+
[self-diagnostics level to debug](./java-standalone-config.md#self-diagnostics), and look for debug messages starting
200+
with the text "exporting span".
201201

202-
Please note that `http.status_code` cannot be used for sampling decisions because it is not available
203-
at the start of the span.
204-
205-
### JDBC spans
206-
207-
| Attribute | Type | Description |
208-
|---|---|---|
209-
| `db.system` | string | Identifier for the database management system (DBMS) product being used. See [list of identifiers](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/database.md#connection-level-attributes). |
210-
| `db.connection_string` | string | Connection string used to connect to the database. It's recommended to remove embedded credentials.|
211-
| `db.user` | string | Username for accessing the database. |
212-
| `db.name` | string | String used to report the name of the database being accessed. For commands that switch the database, this string should be set to the target database, even if the command fails.|
213-
| `db.statement` | string | Database statement that's being run.|
202+
Note that only attributes set at the start of the span are available for sampling,
203+
so attributes such as `http.status_code` which are captured later on cannot be used for sampling.

0 commit comments

Comments
 (0)