# Elastic.Apm.StackExchange.Redis Instrumentation Does Not Report Keys

**URL:** <https://discuss.elastic.co/t/elastic-apm-stackexchange-redis-instrumentation-does-not-report-keys/267693>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [March 18, 2021, 3:30pm UTC](https://discuss.elastic.co/t/elastic-apm-stackexchange-redis-instrumentation-does-not-report-keys/267693 "2021-03-18T15:30:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brandon\_Liles](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_liles/32/71903_2.png) [@Brandon\_Liles](https://discuss.elastic.co/u/Brandon_Liles)\
**Post date:** [March 18, 2021, 3:30pm UTC](https://discuss.elastic.co/t/elastic-apm-stackexchange-redis-instrumentation-does-not-report-keys/267693/1 "2021-03-18T15:30:26Z")

</div>

**Kibana version** :  
7.9.2

**Elasticsearch version** :  
7.9.2

**APM Server version** :  
7.9.2

**APM Agent language and version** :  
dotnet 1.8.1

**Browser version** :  
Edge 89

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**:  
nuget

**Fresh install or upgraded from other version?**  
fresh

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:  
When instrumenting Redis queries, I expected to see the Key in the trace, but it is not present. Do I need to do some extra work to make this visible, or should I make an enhancement request on the github project?

**Steps to reproduce** :

1. Add Elastic.Apm.StackExchange.Redis to a project using Redis/ElasticAPM
2. Observe Redis calls in Kibana
3. Redis calls are logged but do not contain the Key, limiting usefulness

---

<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:** [April 8, 2021, 11:30am UTC](https://discuss.elastic.co/t/elastic-apm-stackexchange-redis-instrumentation-does-not-report-keys/267693/2 "2021-04-08T11:30:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [April 30, 2021, 6:31am UTC](https://discuss.elastic.co/t/elastic-apm-stackexchange-redis-instrumentation-does-not-report-keys/267693/3 "2021-04-30T06:31:57Z")

</div>

Hi @Brandon_Liles,

The StackExchange.Redis instrumentation is implemented using the [library's profiling session feature](https://stackexchange.github.io/StackExchange.Redis/Profiling_v2.html). This feature is geared more towards profiling rather than instrumentation and as a result does not expose details of the redis message, unfortunately, but it's the best integration available at the moment, though there is [an open issue discussing the addition of more data to a profiled command](https://github.com/StackExchange/StackExchange.Redis/issues/1448).

We are looking at .NET auto instrumentation using the profiling interfaces of the (Core) CLR, which could allow the APM agent to capture more detail in cases such as this. Nothing concrete to share on this yet.

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [April 30, 2021, 6:32am UTC](https://discuss.elastic.co/t/elastic-apm-stackexchange-redis-instrumentation-does-not-report-keys/267693/4 "2021-04-30T06:32:46Z")

</div>



---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [August 11, 2021, 2:06am UTC](https://discuss.elastic.co/t/elastic-apm-stackexchange-redis-instrumentation-does-not-report-keys/267693/5 "2021-08-11T02:06:37Z")

</div>

@Brandon_Liles An update that I thought you'd be interested in. I've opened a PR that will try to capture both the command and key in the statement field, if available

> <https://github.com/elastic/apm-agent-dotnet/pull/1374>
>
> This commit updates the StackExchange.Redis instrumentation to attempt to
> get t…he redis message command and key for captured DB statements through
> reflection, falling back to command in the event reflected properties are not
> available.
> 
> Closes #1364

---

<div class="post-metadata">

**Author:** ![Brandon\_Liles](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_liles/32/71903_2.png) [@Brandon\_Liles](https://discuss.elastic.co/u/Brandon_Liles)\
**Post date:** [August 11, 2021, 12:15pm UTC](https://discuss.elastic.co/t/elastic-apm-stackexchange-redis-instrumentation-does-not-report-keys/267693/6 "2021-08-11T12:15:03Z")

</div>

That's awesome! Thanks for the update.

---

<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 4, 2022, 8:26am UTC](https://discuss.elastic.co/t/elastic-apm-stackexchange-redis-instrumentation-does-not-report-keys/267693/7 "2022-11-04T08:26:50Z")

</div>


