This repository was archived by the owner on Mar 26, 2026. It is now read-only.
Commit c37a451
feat: Add plumbing PR for client side metrics to support the open telemetry instruments (#1569)
* Remove the TODOs
* Add line back
* Add comment
* Add version
* Add version to client side metrics
* linter
* Generate documentation for AttemptInfo interface
* Logger documentation
* Generate more documentation
* Generate documentation
* Make sure test reports correct duration, zone
cluster
* Generate documentation for the dimensions to strin
* Add version to the dimensions
* Fix the client name. The version is going to chan
* Update the expected output file.
* Fox bug, get cluster
* Add fake cluster to tests
* Remove console log
* Generate more documentation
* Require a call to fetch the project when using MT
* use same date provider for all metrics tracers
* In the metrics traceer, don’t fetch the project
for each call
* Remove only
* Add open telemetry api
* Add TestExecuteQuery_EmptyResponse to failures
* TestExecuteQuery_SingleSimpleRow known failures
* Fix syntax in known failures
* Add two tests to the known failures
* TestSampleRowKeys_Retry_WithRetryInfo to known fai
* Change word dimensions to attributes
* Change more docs to use Attributes instead of dim
* attributes
* Test should use attributes as string
* For Windows replace carriage return
* Update documentation with types
* Add metrics collector
* Metrics handler, GCPMetricsHandler and tests add
* Remove only
* Add metrics handlers parameter to Doc
* Don’t require retries to be passed into metrics
collector
* Remove testMeterProvider
* Remove the attributesToString function
* Eliminate unused class
* Generate documentation for the IMetricsHandler
* Generate documentation for GCPMetricsHandler
* Restrict attributes interfaces and solve compile
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
* use undefined instead of null
* Introduce enums for allowable values
* Add more headers
* Remove only
* Use null to pass values around. Not undefined
* Modify test step
* Add metrics
* Don’t provide first response latency
* Remove firstResponseLatency from operation metrics
* Expose interface allowing undefined not null
* Better explanations for design decision inline
* Use attempt start time not operation start time
for firstResponseLatency
* Adjust tests for first response latency
* Remove TODO
* Use the MethodName enum instead of string
* Don’t use enum for streaming operation
* Remove copy/pasted comment
* Rename to OperationMetricsCollector
* Rename the method to getOperationAttributes
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
* Add aggregate views to the GCP metrics handler
* Adjust test based on enum changes
* Update the documentation to be more descriptive
* Add the state machine to the metrics collector
* Use grpc code to report attempt/operation status
* Remove parameters from JS Documentation
* Update interfaces and some metrics
- Introduce attributes interface for each metric.
- First latency should be recorded per operation not per attempt
- Update tests for firstResponseLatency change
* Documentation for all the different interfaces
* use operation start time as the benchmark
* Final operation status shouldn’t be included per a
* Move OnAttemptCompleteInfo
Remove unused imports too
* Provide AttemptOnlyAttributes in the only file
In the only file that it is needed
* Move over the OperationOnlyAttributes
* Adjust the guard so that it is earlier
* Adjust the test output file
Dates don’t get read for rows after the first row anymore.
* Change streaming back to STREAMING/UNARY
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
* Change metrics handler interface to support each metric
* Revert "Change metrics handler interface to support each metric"
This reverts commit 2781561.
* Supply the projectId later in the client side
metrics lifecycle
* Remove the GCPMetricsHandler file
* Change location of the client-side-metrics-attribu
file
* Change common test utilities folder name
* Remove aliases for grpc status
* Should be MethodName type
* Rename variable as it expands beyond latency
* Remove private methods for building attributes
* Replace the logger class with a simple object
* Remove only
* Remove the logger classes
Replace them with a simpler object
* Add stubs
* Revert "Remove the GCPMetricsHandler file"
This reverts commit b6f1302.
* Add exporter and helper function
* Add headers and fixture
* Add milliseconds unit
* Record to a histogram
* Add necessary elements to the GCPMetricsHandler
# Conflicts:
# src/client-side-metrics/gcp-metrics-handler.ts
* Pass an exporter into the GCPMetricsHandler
* Move file to tests
* Remove unused import
* Adapt the fixture to include the projectId
* More exporter code fixes
* Add the fixture. We are going to use it later
* Solved compiler errors. Test almost passes
* Address the failing export test
* Fixed the exporter. It now writes data properly.
* Test should complete when the export doesnt error
* Add the fixture to the shared folder
* Remove two files not in this PR
* delete empty file
* Remove files that are already in the other PR
* Remove the metrics handler fixture
* Use 3 metrics instead of 1
* Replace with proper buckets
* Change the metrics handler fixture
* Stop using stub in exporter
* Use more realistic buckets
* Remove the go request to export
* Modify the fixtures to be more realistic
* Change the mean
* Remove only
* Add the export input fixture
* Reducing export interval makes time complete
* Add the GCPMetricsHandler test
* Add a stub for the otel export
* Test calling export is now working
* Remove old unused code
* Change tests and json structure to work
with metricsCollectorData structure
* Update all the fixtures
* Fix the view creation code
Pass in latency buckets
* Starting test for gcp-metrics-handler
* Put tests in the proper places
* Replace start and end time with more recent values
* Utilize the new metrics handler interface
* Solve compiler errors resulting from metrics handl
* Update the fixture
* rewrite the metric to request method
* Add interfaces to work with type guards
* Correct the compile error problems
different metric types are under metrics not scope metrics
* Fix expected OTEL output test
* Remove TODOs
* Fix test to compare pointwise
* connectivity error count corrections
* Correct the fixtures
* Eliminate tests using the old export input fixture
* Add headers
* run linter
* Modify the gcp-metrics-handler and test the proces
end to end
* Remove only
* Use a fake projectId
* Only call export once
* Ensure test suite completes
* Remove shutdown
* remove async
* Don’t export the data twice
* Increase the timeout
* Use the PushMetricExporter interface
* Removed some interfaces that are not used anymore
* Update JSdoc
* Move fake start time and fake end time
* Remove the TODO
* Update documentation
* Add additional information to the error reported
* Move start time and end time
* Try to use timestamps in order
* Reduce timestamp delay
* Remove only
* Inline addFakeRecentTimestamps
* Move replace timestamps into the only file it
is used
* Fix comment
* Rename the metric types
* Generate documentation for the new classes
* Add documentation for monitored resource
* Generate documentation for the other metrics
* Generate documentation for the constructor
* Get documentation for replaceTimestamps, fixtures
* Reduce the interval time
* Make view list based on latencies
* Add a guard for count
* Invert the for and if
* Pull all attributes out
* Eliminate the need for the type guard
* Eliminate the data points interface
* only
* Revert "Eliminate the need for the type guard"
This reverts commit 791e70d.
* Pull timeseries into one variable
Solve the descriptor issue
* Eliminate an unused import
* Add a comment that explains the usefulness
of each metric attribute category
* Remove the gce instance setting
* Eliminate the gcp cloud provider setting
* run all tests
* Eliminate duplicate project id from monitored
resource
* Change the two metric names
* Extend the timeout so that the exporter has
chance to work
* Use spread syntax
* Changed metric to otel instruments
* Remove optional on Otel instruments
* Rename initialize to getMetrics
* Pin promisify to version 4
* cast to string - compiler errors
* Change the latency buckets
Adjust the test fixtures as well to account for the latency bucket change.
* Updated the resultCallback comment
* Change the test description
* Add a comment explaining what the test is about
* Completed the test for two metrics handlers
* remove only
* Cast as histogram to make compile error go away
* Move the duplicate copies of replaceTimestamps
into one file
* Take steps to eliminate the ExportInput interface
* Add a header
* Remove only
* Eliminate ExportInput and dependencies
* Eliminate constant
* Push conversion to status back to metrics collect
Also add if statement for timeseries.
* Change property names to match MetricServiceClient
expectation
* Solve the app_profile_id issue
* It is actually app_profile not app_profile_id
* Add guards that stop the export call
* Remove only
* Add a new test for ten metrics handlers
* Remove only
* Do not pass data through the Resource object
anymore
* Add a test for writing duplicate points to MH
* Eliminate interface
* Set connectivity error count to 1 (not increment)
* Latency improvement
serverTime and connectivityErrorCount should only be read once.
* Add latency optimizations and update fixtures
* Update fixtures with new latency measurements
The optimization means some code gets skipped therefore lower latency in the tests
* Check for first response latency first
* Break metricsToRequest down into smaller fns
* Refactor the metricToRequest function
* Rename interface
* Rename to getInstruments
---------
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>1 parent c97ebcc commit c37a451
16 files changed
Lines changed: 2564 additions & 98 deletions
File tree
- src
- client-side-metrics
- system-test
- test-common
- test/metrics-collector
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | | - | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
0 commit comments