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

Expose HTTP endpoint SQL queries, queries count and execution time via Prometheus #2828

Closed
tatiana opened this issue May 31, 2024 · 6 comments
Labels
db.perf This issue or pull request improves DB performance
Milestone

Comments

@tatiana
Copy link
Collaborator

tatiana commented May 31, 2024

Context

Since the 0.7.0 release (#1906), Marquez supports pushing metrics to Prometheus.

This task proposes extending the current capability to give visibility to Marquez's SQL queries. Some of the questions we'd like to be answered:

  • What queries is Marquez running?
  • How long does each query take?
  • How many times does a specific query run?

By identifying potential bottlenecks in Marquez queries and the database, this extension could facilitate the provisioning of adequate resources. This, in turn, could lead to improved performance and efficiency of the database and Marquez itself.

Implementation

If possible, we could give visibility of frequency (count) and duration (gauge) for all queries Marquez runs. There is a possibility this could be done close to jdbi: https://metrics.dropwizard.io/4.2.0/manual/jdbi.html

If this is not possible, we could add the instrumentation to specific write and read endpoints, covering at least the SQL queries triggered by the following endpoints:

  • POST api/v1/lineage (*)
  • GET api/v1/namespaces/{namespace} (*)
  • GET api/v1/namespaces
  • GET api/v1/namespaces/{namespace}/jobs/{job}
  • GET api/v1/namespaces/{namespace}/datasets
  • GET api/v1/column-lineage

The most critical are (*)

Copy link

boring-cyborg bot commented May 31, 2024

Thanks for opening your first issue in the Marquez project! Please be sure to follow the issue template!

@wslulciuc wslulciuc modified the milestone: Roadmap Jun 1, 2024
@wslulciuc wslulciuc added db.perf This issue or pull request improves DB performance labels Jun 1, 2024
@tatiana
Copy link
Collaborator Author

tatiana commented Jun 6, 2024

As of Marquez 0.47.0, the /metrics endpoint already exposes the following information:

  • query identifier in the code (it includes the file path / class identifier and the method e.g. marquez/db/JobDao.java:findAll is named marquez_db_JobDao_findAll)
  • query duration
  • query count

Example of the information made available in this endpoint:
Screenshot 2024-06-06 at 14 28 20

Confirm if we need further details.

@tatiana
Copy link
Collaborator Author

tatiana commented Jul 1, 2024

At the moment, we can see the data of interest using the Java method, but we desire this feature to allow us to see it from an HTTP endpoint perspective as well (e.g., POST api/v1/lineage).

@tatiana
Copy link
Collaborator Author

tatiana commented Jul 4, 2024

@mobuchowski 's suggest: add the HTTP verb and the endpoint path
E.g. marquez_api_post_v1Lineage_db_JobDao

We need to investigate if and how this could be accomplished, and if there are better ways

@tatiana tatiana changed the title Expose SQL queries, queries count and execution time via Prometheus Expose HTTP endpoint SQL queries, queries count and execution time via Prometheus Jul 5, 2024
@tatiana
Copy link
Collaborator Author

tatiana commented Jul 17, 2024

@JDarDagran is implementing this in #2850

@tatiana
Copy link
Collaborator Author

tatiana commented Aug 7, 2024

Closed by: #2850

@tatiana tatiana closed this as completed Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
db.perf This issue or pull request improves DB performance
Projects
Status: Done
Development

No branches or pull requests

2 participants