Source code - function / file that executes mssql queries?

I want to monitor the queries executed on a grafana dashboard. I am new to this and not aware of where / which function in the source code the query is executed and results retrieved. I must enter the function name in the monitoring system for getting back query latencies. Can I get some help with this ?
I’m using ms sql as the data source.