Query performance tracking may expose sensitive data in reported statements. Consequently, Dynatrace provides an optional mechanism that allows masking of selected attributes. Details are available in Dynatrace Documentation.
The configurations below shows you how to hide data, specifically for the purpose of query performance tracking.
The first option is to create a processing rule under Settings -> Log Monitoring -> Processing
by filling Processor definition
e.g.
USING(INOUT content) | FIELDS_ADD(content: REPLACE_PATTERN(content, "(\"'\"):p1 (LD):p2 (\"'\"):p3", "${p1}${p2|sha1}${p3}"))
.
The same can be achieved by extension modification, which involves additional logProcessingRules
section.
logProcessingRules:
- ruleName: TopN statements masking
query: event.group="query_performance"
enabled: true
ProcessorDefinition:
rule: |
USING(INOUT content) | FIELDS_ADD(content: REPLACE_PATTERN(content, "(\"'\"):p1 (LD):p2 (\"'\"):p3", "${p1}${p2|sha1}${p3}"))
RuleTesting:
sampleLog: |
{
"event.group": "query_performance",
"content": "/*dt:ownQuery*/SELECT DECODE(name, 'sessions', value) AS sessions_limit, DECODE(name, 'processes', value) AS processes_limit FROM v$parameter WHERE name IN('sessions', 'processes')"
}
Please adjust the above rule to match your environment, if needed.