# \[apm/apmsql/pq\]\[GoLang\] Does NOT support parameterized SQL statement

**URL:** <https://discuss.elastic.co/t/apm-apmsql-pq-golang-does-not-support-parameterized-sql-statement/203931>\
**Category:** APM\
**Tags:** go\
**Created:** [October 16, 2019, 9:07pm UTC](https://discuss.elastic.co/t/apm-apmsql-pq-golang-does-not-support-parameterized-sql-statement/203931 "2019-10-16T21:07:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeckyOH](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeckyoh/32/55668_2.png) [@JeckyOH](https://discuss.elastic.co/u/JeckyOH)\
**Post date:** [October 16, 2019, 9:07pm UTC](https://discuss.elastic.co/t/apm-apmsql-pq-golang-does-not-support-parameterized-sql-statement/203931/1 "2019-10-16T21:07:33Z")

</div>

Hey Guys,  
I'm using Elastic APM in GoLang to trace requests for my application. It is awesome that SQL Statements are present in tracing dashboards in Kibana.  
But I found that `apm/module/apmsql` does NOT provide raw statements for parameterized SQL statement.

For example, `SELECT * from the_table where colum_1= $1 and colume_2 = $2`.  
Seems the `func (c *conn) QueryContext` function in `apm/module/apmsql` package only feed what's in "query" arguments, which can be a parameterized statement, to "startStmtSpan" function.

**APM Agent language and version** :  
GoLang 1.5.0

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [October 17, 2019, 12:56am UTC](https://discuss.elastic.co/t/apm-apmsql-pq-golang-does-not-support-parameterized-sql-statement/203931/2 "2019-10-17T00:56:36Z")

</div>

Hi @JeckyOH, welcome to the forum!

> For example, `SELECT * from the_table where colum_1= $1 and colume_2 = $2` .  
> Seems the `func (c *conn) QueryContext` function in `apm/module/apmsql` package only feed what's in "query" arguments, which can be a parameterized statement, to "startStmtSpan" function.

Do you mean that you're expecting to see the query parameters? The agents intentionally do not capture the parameters, as they may contain sensitive information. Why do you want to capture the parameters in APM?

---

<div class="post-metadata">

**Author:** ![JeckyOH](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeckyoh/32/55668_2.png) [@JeckyOH](https://discuss.elastic.co/u/JeckyOH)\
**Post date:** [October 17, 2019, 2:13pm UTC](https://discuss.elastic.co/t/apm-apmsql-pq-golang-does-not-support-parameterized-sql-statement/203931/3 "2019-10-17T14:13:39Z")

</div>

Well, I'm assuming it can show either the entire query or query+parameters. It will be easy for troubleshooting when latency is high. so, no one has such requirements? I understand parameters may contain sensitive data, but maybe let user choose it?

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [October 18, 2019, 10:28am UTC](https://discuss.elastic.co/t/apm-apmsql-pq-golang-does-not-support-parameterized-sql-statement/203931/4 "2019-10-18T10:28:23Z")

</div>

> Well, I'm assuming it can show either the entire query or query+parameters. It will be easy for troubleshooting when latency is high. so, no one has such requirements? I understand parameters may contain sensitive data, but maybe let user choose it?

As far as I know, nobody has asked for it so far. That doesn't mean nobody else has the same requirement, they just may not have asked 🙂

It sounds like a reasonable idea to have configuration for this, similar to how we have configuration for capturing HTTP request bodies and HTTP headers. Could you please create a feature request issue?

> **[Build software better, together](https://github.com/elastic/apm/issues/new?template=Feature_request.md)**
>
> GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 8, 2019, 6:28am UTC](https://discuss.elastic.co/t/apm-apmsql-pq-golang-does-not-support-parameterized-sql-statement/203931/5 "2019-11-08T06:28:32Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
