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 Index metrics to python sdk #33034

Merged
merged 4 commits into from
Nov 10, 2023
Merged

Add Index metrics to python sdk #33034

merged 4 commits into from
Nov 10, 2023

Conversation

bambriz
Copy link
Member

@bambriz bambriz commented Nov 8, 2023

This PR adds Index Metrics to Python SDK.

You can capture index metrics by passing in the populate_index_metrics keyword in query items.
query_items = container.query_items(query="Select * from c", populate_index_metrics=True)

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

This PR adds Index Metrics to Python SDK
@azure-sdk
Copy link
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

azure-cosmos

Copy link
Member

@simorenoh simorenoh left a comment

Choose a reason for hiding this comment

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

small suggestions but great stuff nonetheless, thank you Bryan! 👍

let's make sure to include the CHANGELOG like you said as well

@simorenoh
Copy link
Member

also side random question, but from what I saw we send "x-ms-cosmos-populateindexmetrics" and the service returns "x-ms-cosmos-index-utilization" - is that right? there's no other additional headers that get returned on this right?

@bambriz
Copy link
Member Author

bambriz commented Nov 8, 2023

also side random question, but from what I saw we send "x-ms-cosmos-populateindexmetrics" and the service returns "x-ms-cosmos-index-utilization" - is that right? there's no other additional headers that get returned on this right?

That is correct.

@bambriz
Copy link
Member Author

bambriz commented Nov 8, 2023

/azp run python - cosmos - tests

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Removed the param reference so that we can use it as a keyword
@bambriz
Copy link
Member Author

bambriz commented Nov 8, 2023

/azp run python - cosmos - tests

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@simorenoh simorenoh left a comment

Choose a reason for hiding this comment

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

LGTM thanks Bryan!

Copy link
Member

@kushagraThapar kushagraThapar left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @bambriz !

sdk/cosmos/azure-cosmos/CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Kushagra Thapar <kushuthapar@gmail.com>
@bambriz bambriz merged commit 53d0058 into Azure:main Nov 10, 2023
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants