08 May 2025
07:50 AM
- last edited on
09 May 2025
04:38 PM
by
AgataWlodarczyk
Hello Team,
We have enabled the bind variable for one of our tenants, and we are seeing the values of the bind variables in Dynatrace. However, I want to know where these values of bind variables are stored in Dynatrace.
I am trying to find it in logs/spans, but have not been able to. Is there any way to use DQL to fetch the values of bind variables for each query in logs?
Thank you so much.
Solved! Go to Solution.
08 May 2025 11:03 PM
The bind variable values are stored as part of the spans, specifically in the db.query.parameters field. You can find the complete description of how database client spans are stored in Grail at https://docs.dynatrace.com/docs/discover-dynatrace/references/semantic-dictionary/model/trace#databa....
I hope that helps.
09 May 2025 06:40 AM
HelloMarco,
Thanks for your message, however I am not able to view this db.query.paramaters in the spans. Below is the snapshots showing the names of the columns that I am currently seeing in the Dynatrace.
As you can see, I am not able to view the db.query.parameters in the list of columns.
trace.id | span.id | dt.entity.host | dt.entity.host_group | dt.entity.service | dt.entity.process_group | dt.entity.process_group_instance | dt.host_group.id | host.name | db.system | http.server_name | aggregation.count | aggregation.duration_max | aggregation.duration_min | aggregation.duration_samples | aggregation.duration_sum | aggregation.exception_count | aggregation.parallel_execution | code.call_stack | code.function | code.namespace | db.affected_item_count | db.namespace | db.operation.name | db.query.text | db.result.duration_sum | db.result.exception_count | db.result.execution_count | dt.agent.module.id | dt.agent.module.type | dt.agent.module.version | dt.agent.module.version_short | dt.ingest.size | dt.openpipeline.pipelines | dt.openpipeline.source | dt.retain.size | dt.system.monitoring_source | duration | end_time | java.main.class | process.executable.name | process.executable.path | process.pid | sampling.threshold | server.address | server.port | server.resolved_ips | servlet.context.name | servlet.context.path | span.is_subroutine | span.kind | span.name | span.parent_id | span.timing.cpu | span.timing.cpu_self | start_time | subtrace.id | supportability.alr_sampling_ratio | supportability.atm_sampling_ratio | thread.id | thread.name | weblogic.cluster.name | weblogic.domain.name | weblogic.home | weblogic.server.name |
09 May 2025 04:37 PM
If you are using DQL, then it may be necessary to use the fieldsAdd command to ensure the column is there. You may also wish to add a filter to only list spans that actually have data in this field.
A simple example query might look like this:
fetch spans
| filter isNotNull(db.query.parameters)
| fieldsAdd db.query.parameters
If no spans come up, then it might be time to engage support for additional investigation
15 May 2025 01:02 PM
Thanks for the query. I ran the same query but did not find any column named db.query.paramaeters. We are going to raise this as support ticket with Dynatrace.
Thanks once again.