matomo-org / matomo-org/plugin-AnonymousPiwikUsageMeasurement

Track SQL queries that use prepared statements

Open
#11 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
PHP
Stars
4
Forks
12
Avg merge
2d 8h
Merged PRs (30d)
4

Description

If profiling of SQL queries is enabled we could also track SQL queries and average time it took to execute them. The information is written to `log_profiling` under circumstances anyway. We'd just need a way to figure out which ones were already tracked and to make sure to not send queries that contain any private information (only queries that use bind parameters). We could check if there's a use of `?` but still it could be the case that it is a mix of bound parameters and concatenated values...

It is not important but it would be kinda nice to see which queries are executed how often, how fast were they executed and especially to see a history of it.

Of course ideally there are monitoring tools used for such cases

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing `log_profiling` path mentioned in the issue and inspect how profiling information is currently written. Determine how prepared statements and bind parameters can be identified without sending private values. Done means safely recording query frequency, execution time, and history only for qualifying queries, with tests covering the privacy constraint.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, sql
Domain
databases, observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.