Getting Data In

Time Taken for stored procedures to execute

mshea
New Member

Hi,

I have an application with about 10 stored procedure calls made via Linq. I'd like to track the performance of the stored procedure. There is currently no tracing/logging in place for these calls.

What is the most efficient way to instrument the call so that splunk can report on the avg time taken and show trends in a dashboard as well as send alerts when a threshold has been released.

The two options are, I think are:

1. Start and Finish tracing statements.

       Started processing sproc1
       exec sproc1(param1, param2)
       Finished processing sproc1

2. A single tracing statement with timeTaken when the stored procedure finishes.

i.e. finished executing sproc1 in 1114 ms

Please let me know if you have any thoughts on the best way to accomplish this.

Thanks,

Mike

0 Karma

lguinn2
Legend

I would consider doing this

index=xyz procedure=* ("Started processing" OR "Finished processing")
| transaction procedure startswith="Started processing" endswith="Finished processing" keepevicted=f
| timechart avg(duration) as AvgDuration by procedure span=1h

assuming that "procedure" is the name of the field that contains the names of the stored procedures (sproc1, etc.).

However, if your dataset is very large, the transaction command will consume a lot of memory and may not work well.

0 Karma

bmacias84
Champion

Have you considered using Splunk Stream app. If this is a DB Stream can capture request and response time for the stored procedure by grabbing the information on the wire. Works for TDS, mysql, and Postgress.

0 Karma
Get Updates on the Splunk Community!

Splunk Forwarders and Forced Time Based Load Balancing

Splunk customers use universal forwarders to collect and send data to Splunk. A universal forwarder can send ...

NEW! Log Views in Splunk Observability Dashboards Gives Context From a Single Page

Today, Splunk Observability releases log views, a new feature for users to add their logs data from Splunk Log ...

Last Chance to Submit Your Paper For BSides Splunk - Deadline is August 12th!

Hello everyone! Don't wait to submit - The deadline is August 12th! We have truly missed the community so ...