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

feat: Add Attempt, Operation and GFE Metrics #1302

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

lszinv
Copy link
Contributor

@lszinv lszinv commented Jan 24, 2025

Implementation of the MetricTracer and SpannerMetricFactory, a specific instance of the MetricFactory that populates the factory with metadata specific to the Python Spanner Client.

The Implemented metrics:

Metric Name Description
Attempt Latency latency of an RPC attempt.
Attempt Count The count of RPC attempts
Operation Latency The total end-to-end latency across all request attempts, including retries.
Operation Count The count of operations
GFE Latency The latency of GFE
GFE Header missing count The count of RPCs where GFE header is missing

@lszinv lszinv requested review from a team as code owners January 24, 2025 07:40
@product-auto-label product-auto-label bot added the size: l Pull request size is large. label Jan 24, 2025
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/python-spanner API. label Jan 24, 2025
@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 27, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 27, 2025
@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 29, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 29, 2025
@rahul2393 rahul2393 self-assigned this Jan 29, 2025
Copy link
Contributor

@rahul2393 rahul2393 left a comment

Choose a reason for hiding this comment

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

As per offline discussion waiting for unit test to mock RPC failure and validate attempt_count>1

@rahul2393
Copy link
Contributor

rahul2393 commented Jan 29, 2025

@lszinv Build is failing

INFO: pip is looking at multiple versions of google-cloud-spanner[tracing] to determine which version is compatible with other requirements. This could take a while.
ERROR: Ignored the following versions that require a different python version: 0.44b0 Requires-Python >=3.8; 0.45b0 Requires-Python >=3.8; 0.46b0 Requires-Python >=3.8; 0.47b0 Requires-Python >=3.8; 0.48b0 Requires-Python >=3.8; 0.49b0 Requires-Python >=3.8; 0.49b1 Requires-Python >=3.8; 0.49b2 Requires-Python >=3.8; 0.50b0 Requires-Python >=3.8; 1.23.0 Requires-Python >=3.8; 1.24.0 Requires-Python >=3.8; 1.25.0 Requires-Python >=3.8; 1.26.0 Requires-Python >=3.8; 1.27.0 Requires-Python >=3.8; 1.28.0 Requires-Python >=3.8; 1.28.1 Requires-Python >=3.8; 1.28.2 Requires-Python >=3.8; 1.29.0 Requires-Python >=3.8; 5.0.0 Requires-Python >=3.8; 5.0.1 Requires-Python >=3.8; 5.1.0 Requires-Python >=3.9
ERROR: Could not find a version that satisfies the requirement mmh3>=5.0.1 (from google-cloud-spanner[tracing]) (from versions: 2.0, 2.2, 2.3, 2.3.1, 2.4, 2.5, 2.5.1, 3.0.0, 3.1.0, 4.0.0, 4.0.1, 4.1.0)
ERROR: No matching distribution found for mmh3>=5.0.1
nox > Session unit-3.7(protobuf_implementation='python') failed.

@lszinv lszinv force-pushed the lsz/GSO-16/Operation_GFE_metrics branch from 66f7a30 to 2dd3a0e Compare January 30, 2025 03:39
@lszinv lszinv requested a review from a team as a code owner January 30, 2025 03:39
@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. and removed size: l Pull request size is large. labels Jan 30, 2025
@lszinv
Copy link
Contributor Author

lszinv commented Jan 30, 2025

  • Rebased onto up-to-date main
  • updated the minimum version to address build failure
  • Added unit test to verify attempt count metrics increasing on failure
  • Verified that Periodic Exporter is defaulted to export at 1 minute intervals, but explicitly set the interval too to guard against future changes to the default value.

@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 30, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 30, 2025
@lszinv
Copy link
Contributor Author

lszinv commented Jan 31, 2025

Investigating the 3.7 test failure.

@lszinv
Copy link
Contributor Author

lszinv commented Jan 31, 2025

Ignore the last commit. Will be pushing a new one to fix the test without disabling it.

@lszinv lszinv force-pushed the lsz/GSO-16/Operation_GFE_metrics branch from 2789dc0 to c07edca Compare January 31, 2025 05:55
@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 3, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 3, 2025
@lszinv
Copy link
Contributor Author

lszinv commented Feb 4, 2025

Apologies, forgot to run the mockserver tests with the last change. I've fixed the test failures.

@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 4, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 4, 2025
@rahul2393 rahul2393 changed the title Feat: Add Attempt, Operation and GFE Metrics feat: Add Attempt, Operation and GFE Metrics Feb 5, 2025
@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 7, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/python-spanner API. size: xl Pull request size is extra large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants