apm-agent-python icon indicating copy to clipboard operation
apm-agent-python copied to clipboard

Add instrumentation for AWS Redshift databases

Open RonanFelipe opened this issue 2 years ago • 2 comments

I followed the basic steps described on the documentation to connect my Flask application. My application connects with a MySql database and with Redshift database. On Kibana web page, when analyzing the data I can see the query statement for the MySql querys, but I can't see the Redshift query statement. On my application, both database connection are made with SQLAlchemy. So is just a question, does it work with Redshift? Maybe I have to check some of my settings, read some advanced topics.

I tried to create a span (@elasticapm.capture_span()) on the Redshift method that execute the query to be more specific and visualize what was happening, but still on kibana it show my Redshift span but no query statement.

**Environment **

  • OS: Ubuntu 22.04
  • Python version: 3.11
  • Framework and version: Flask 2.2
  • APM Server version:
  • Agent version: 6.16.2

RonanFelipe avatar Jun 23 '23 21:06 RonanFelipe

We don't instrument SQLAlchemy directly; rather, we instrument the underlying database libraries. It appears we don't have an instrumentation for Redshift -- are you seeing a span for the Redshift queries at all? Or only when you use @elasticapm.capture_span()?

capture_span by itself definitely won't get you the query information -- that's specific to our database instrumentations. I think the answer here is to add an instrumentation for Redshift.

basepi avatar Jun 26 '23 17:06 basepi

are you seeing a span for the Redshift queries at all?

No, I was not. Then I created a span in the method that make the query execute() to see If I could get anything, I named it 'redshift connection'. After this I could see the span but no query information.

RonanFelipe avatar Jun 26 '23 18:06 RonanFelipe