Skip to content

Conversation

@igorbernstein2
Copy link

@igorbernstein2 igorbernstein2 commented Aug 22, 2019

It adds stats to logical operations for things like:

  • how long did logically method call take across all of its retry attempts
  • whats the distribution of rows read per operation
  • whats the distribution of the number of entries in a bulk mutation

This should allow users to better debug the performance of the client. Allowing to debug scenarios like high perceived latency on the client side, but no latency visible on the serverside due to retries.

This also adds a more user friendly way to enable data collection by exposing a method on the settings class.

Main changes:

  • Follow grpc's example and create Rpc*Constant files to configure opencensus stat views
  • Mark the constants as internal and expose them via a static method on the settings
  • Create callables for unary chains and special callables for ReadRows & MutateRows
  • Push metric & tracing instrumentation to the leaf callables

@igorbernstein2 igorbernstein2 added do not merge Indicates a pull request not ready for merge, due to either quality or timing. api: bigtable Issues related to the Bigtable API. labels Aug 22, 2019
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 22, 2019
@igorbernstein2 igorbernstein2 changed the title WIP: Bigtable: instrument client with Opencensus metrics Bigtable: instrument client with Opencensus metrics Aug 27, 2019
@igorbernstein2 igorbernstein2 marked this pull request as ready for review August 27, 2019 00:12
@igorbernstein2 igorbernstein2 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 27, 2019
# Conflicts:
#	google-cloud-clients/google-cloud-bigtable/pom.xml
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 27, 2019
@igorbernstein2 igorbernstein2 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 27, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 27, 2019
@igorbernstein2 igorbernstein2 added kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels Aug 27, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 27, 2019
* clean up code
@codecov
Copy link

codecov bot commented Aug 27, 2019

Codecov Report

Merging #6143 into master will increase coverage by 0.3%.
The diff coverage is 67.81%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master    #6143     +/-   ##
===========================================
+ Coverage     47.23%   47.53%   +0.3%     
- Complexity    27458    27470     +12     
===========================================
  Files          2526     2534      +8     
  Lines        274535   274918    +383     
  Branches      30579    31408    +829     
===========================================
+ Hits         129668   130674   +1006     
- Misses       134446   134611    +165     
+ Partials      10421     9633    -788
Impacted Files Coverage Δ Complexity Δ
...le/cloud/bigtable/data/v2/models/BulkMutation.java 97.29% <0%> (-2.71%) 9 <0> (ø)
...igtable/data/v2/stub/metrics/RpcViewConstants.java 0% <0%> (ø) 0 <0> (?)
...e/cloud/bigtable/data/v2/BigtableDataSettings.java 32.14% <0%> (-1.2%) 4 <0> (ø)
.../cloud/bigtable/data/v2/stub/metrics/RpcViews.java 0% <0%> (ø) 0 <0> (?)
...le/data/v2/stub/metrics/MeasuredUnaryCallable.java 100% <100%> (ø) 2 <2> (?)
...data/v2/stub/metrics/MeasuredReadRowsCallable.java 100% <100%> (ø) 2 <2> (?)
...ta/v2/stub/metrics/MeasuredMutateRowsCallable.java 100% <100%> (ø) 2 <2> (?)
...ud/bigtable/data/v2/stub/EnhancedBigtableStub.java 95.45% <100%> (+0.6%) 21 <3> (-1) ⬇️
.../v2/stub/metrics/MeasuredMutateRowsCallableV2.java 25% <25%> (ø) 1 <1> (?)
...ogle/cloud/bigtable/data/v2/stub/metrics/Util.java 60% <60%> (ø) 5 <5> (?)
... and 194 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eb526b4...48a2acb. Read the comment docs.

@igorbernstein2 igorbernstein2 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 29, 2019
of mutations per BulkMutation.


By default, the functionality is disabled. To enable, you need to add a couple of
Copy link
Contributor

Choose a reason for hiding this comment

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

I would reword: "To enable, please follow the instructions below:"

Copy link
Author

Choose a reason for hiding this comment

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

changed the wording, PTAL

libraryDependencies += "io.opencensus" % "opencensus-exporter-stats-stackdriver" % "0.23.0"
```

Then at the start of your application configure the exporter and enable the Bigtable stats views:
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove "then"

Copy link
Author

Choose a reason for hiding this comment

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

done

}

/**
* Enables Opencensus metric aggregations.
Copy link
Contributor

Choose a reason for hiding this comment

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

minor - change all occurrences of "Opencensus" to "OpenCensus"

Copy link
Author

Choose a reason for hiding this comment

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

done

* }</pre>
*/
@BetaApi("Opencensus stats integration is currently unstable and may change in the future")
public static void enableOpencensusStats() {
Copy link
Contributor

Choose a reason for hiding this comment

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

OpenCensus

Copy link
Author

Choose a reason for hiding this comment

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

done

* <li>Add tracing & metrics.
* </ul>
*/
@Deprecated
Copy link
Contributor

Choose a reason for hiding this comment

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

point to new method?

Copy link
Author

Choose a reason for hiding this comment

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

done

import javax.annotation.Nonnull;

/**
* @deprecated Please use {@link MeasuredMutateRowsCallableV2}.
Copy link
Contributor

Choose a reason for hiding this comment

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

please add an internal use only comment as well

Copy link
Author

Choose a reason for hiding this comment

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

done

@kolea2 kolea2 added kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Aug 29, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 29, 2019
@igorbernstein2 igorbernstein2 added kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Aug 29, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigtable Issues related to the Bigtable API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants