Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: optimize SQL based database instrumentation #955

Merged
merged 7 commits into from
Dec 10, 2024

Conversation

Angith
Copy link
Contributor

@Angith Angith commented Nov 26, 2024

This PR consists of the following changes

  1. removed the usage of regular expressions which imposes performance overhead on SQL span creation.
  2. optimized the creation of SQL span tags by decoupling tag generation from query execution. Before, all span tags—including connection details, which are constants—were generated during query execution. This change moves the creation of these constant tags to the connection setup phase, allowing them to be reused across multiple queries executed through the same connection instance.
  3. Span creation is now handled by a single object, enabling easier extension and the incorporation of more data in the future.
  4. A Tags interface has been introduced to streamline the process of adding tags to spans, ensuring efficient tag management. This refactor also aims to improve code structure, enabling cleaner design and facilitating future expansion.

…om the query (#931)

* refactor: optimized logic for identifying if the database is Redis from the query
* fix: fixed not identifying the database from the query with redis command having multiple words
* refactor: optimize SQL instrumentation
@Angith Angith self-assigned this Nov 26, 2024
@Angith Angith requested a review from a team as a code owner November 26, 2024 12:59
@Angith Angith added the tekton_ci Add this label to start running Tekton pipelines label Nov 27, 2024
@Angith Angith removed the tekton_ci Add this label to start running Tekton pipelines label Dec 9, 2024
… generated sql_wrappers.go using the template
@Angith Angith added the tekton_ci Add this label to start running Tekton pipelines label Dec 9, 2024
Copy link
Member

@nithinputhenveettil nithinputhenveettil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

:shipit:

Copy link

sonarcloud bot commented Dec 10, 2024

@Angith Angith merged commit 0ecf613 into main Dec 10, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement tekton_ci Add this label to start running Tekton pipelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants