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

Add support for additional context to the metrics for query execution time #4662

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

dgarros
Copy link
Collaborator

@dgarros dgarros commented Oct 18, 2024

This PR extend the QUERY_EXECUTION metric to support 2 additional (optional) dimensions.
Because each query may have different information to report, the name of these dimensions is very generic (context1 & context2)

As an example,
The query node_constraints_uniqueness has been updated to leverage this new capability to report the kind of the node as well. Having this information in prometheus is really important to understand how the node_constraints_uniqueness query is performing based on the information we have in the schema

@github-actions github-actions bot added the group/backend Issue related to the backend (API Server, Git Agent) label Oct 18, 2024
@github-actions github-actions bot added type/documentation Improvements or additions to documentation group/frontend Issue related to the frontend (React) group/ci Issue related to the CI pipeline labels Oct 25, 2024
@dgarros dgarros changed the base branch from develop to release-1.0 October 25, 2024 07:07
@dgarros dgarros marked this pull request as ready for review October 25, 2024 07:36
@dgarros dgarros requested a review from a team October 25, 2024 08:24
backend/infrahub/core/query/__init__.py Outdated Show resolved Hide resolved
for idx, (key, value) in enumerate(context.items())
if idx <= 1
}
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Will context contain more that two keys and if so does it matter if they are ordered or not?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it shouldn't have more than 2 keys and the order doesn't matter as long as it's consistent

@github-actions github-actions bot removed type/documentation Improvements or additions to documentation group/frontend Issue related to the frontend (React) group/ci Issue related to the CI pipeline labels Oct 25, 2024
@dgarros dgarros merged commit cc53b44 into release-1.0 Oct 25, 2024
31 checks passed
@dgarros dgarros deleted the dga-20241018-metric-context branch October 25, 2024 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/backend Issue related to the backend (API Server, Git Agent)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants