Open Q&A
If there's no good subforum for your question - ask it here!
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DB Query Parameter as Request Attributes

izza
Visitor

Hi Dynatrace Community,

I'm trying to create Request Attributes from `db.query.parameters` span attribute, but the values are not being captured. Looking for guidance on the correct attribute key syntax.

 

What I have tried so far:
Under Settings → Server-side service monitoring → Request Attributes → Data source → Span attribute, I have tried the following attribute key formats, but all return nothing/empty:

- `db.query.parameters[@6]`
- `db.query.parameters[6]`
- `db.query.parameters.@6`

 

Any help or guidance is appreciated. Thank you!

1 REPLY 1

sujit_k_singh
Champion

Hi @izza 

According to Dynatrace documentation, db.query.parameters is stored as a key-value map (not a simple array).The correct syntax for accessing span attribute map values in Request Attributes should be:

  • db.query.parameters.6 — using dot notation with the string index (no brackets, no @)

However, there's an important caveat: db.query.parameters is classified as a sensitive span field in Dynatrace.

Sensitive spans fields — Dynatrace Docs

This means:

  1. Data privacy settings may be masking/blocking the values — check Settings → Server-side service monitoring → Deep monitoring → Database → "Capture SQL bind values" is enabled
  2. The attribute may not be exposed to the Request Attributes feature depending on your privacy configuration

If you run the following DQL and get 0 results, it means the values aren't being captured at all, the privacy settings above need to be enabled first before any syntax will work:

fetch spans
| filter isNotNull(db.query.parameters)
| fields db.query.parameters

 

sujit_k_singh_0-1784722534915.png

 

Dynatrace Professional Certified

Featured Posts