-
Notifications
You must be signed in to change notification settings - Fork 791
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apache Geode instrumentation should store normalized queries as db.st…
…atement (#1455) * Apache Geode instrumentation should store normalized queries as db.statement * spotless
- Loading branch information
Mateusz Rzeszutek
committed
Oct 26, 2020
1 parent
3db872e
commit 01f4086
Showing
4 changed files
with
97 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
.../src/main/java/io/opentelemetry/javaagent/instrumentation/geode/GeodeQueryNormalizer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.javaagent.instrumentation.geode; | ||
|
||
import io.opentelemetry.javaagent.instrumentation.api.db.normalizer.ParseException; | ||
import io.opentelemetry.javaagent.instrumentation.api.db.normalizer.SqlNormalizer; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public final class GeodeQueryNormalizer { | ||
private static final Logger log = LoggerFactory.getLogger(GeodeQueryNormalizer.class); | ||
|
||
public static String normalize(String query) { | ||
if (query == null) { | ||
return null; | ||
} | ||
try { | ||
return SqlNormalizer.normalize(query); | ||
} catch (ParseException e) { | ||
log.debug("Could not normalize Geode query", e); | ||
return null; | ||
} | ||
} | ||
|
||
private GeodeQueryNormalizer() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters