这是indexloc提供的服务,不要输入任何密码
Skip to content

Delegate createReadStream #1611

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

Draft
wants to merge 440 commits into
base: main
Choose a base branch
from

Conversation

danieljbruce
Copy link
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

Description

Please provide a detailed description for the change.
As much as possible, please try to keep changes separate by purpose. For example, try not to make a one-line bug fix in a feature request, or add an irrelevant README change to a bug fix.

Impact

What's the impact of this change?

Testing

Have you added unit and integration tests if necessary?
Were any tests changed? Are any breaking changes necessary?

Additional Information

Any additional details that we should be aware of?

Checklist

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease
  • Appropriate docs were updated
  • Appropriate comments were added, particularly in complex areas or places that require background
  • No new warnings or issues will be generated from this change

Fixes #issue_number_goes_here 🦕

with metricsCollectorData structure
Pass in latency buckets
different metric types are under metrics not scope metrics
…into 359913994-exporter-PR

# Conflicts:
#	package.json
#	src/client-side-metrics/client-side-metrics-attributes.ts
#	src/client-side-metrics/metrics-handler.ts
#	test/metrics-collector/typical-method-call.txt
danieljbruce and others added 27 commits April 16, 2025 15:47
# Conflicts:
#	src/client-side-metrics/operation-metrics-collector.ts
#	test/metrics-collector/metrics-collector.ts
…into 359913994-third-PR-CSM

# Conflicts:
#	protos/protos.d.ts
#	src/client-side-metrics/operation-metrics-collector.ts
#	test/metrics-collector/metrics-collector.ts
Have to change the static variable on the mock instead
Fixes the linter errors
…into 359913994-third-PR-CSM

# Conflicts:
#	src/client-side-metrics/operation-metrics-collector.ts
#	test/metrics-collector/metrics-collector.ts
The bigtable singleton makes it really confusing to read the code. Instead, let’s have a unique bigtable client for each test and mock it out each time as necessary so that we know the exact state of the client in each test.
…etrics design (#1605)

* added metrics controller at the client level

* renamed class

* did some clean up around handler creation

* fixed accidental deletion

* use options instead of auth

* fixed typo

* don't pass project on each call

* call getProjectId when setting up config manager

* pulled out project id from metrics model

* Fix: Resolve CSM branch compilation and auth issues

This commit addresses compilation errors in the `csm_sanche` branch
and ensures that authentication credentials can be passed to the
`CloudMonitoringExporter`.

The `csm_sanche` branch aimed to remove global singletons for client-side
metrics. This change continues that effort by:

- Fixing type errors and import issues in `ClientSideMetricsConfigManager`,
  `GCPMetricsHandler`, and `CloudMonitoringExporter`.
- Modifying `CloudMonitoringExporter` and `GCPMetricsHandler` to accept
  an `options` object in their constructors. This object is passed down
  to the `MetricServiceClient`, allowing credentials to be provided.
- Updating test files to align with these changes.
- Adding new unit tests for `ClientSideMetricsConfigManager.getGcpHandlerForProject`
  to verify:
    - Correct instantiation of `GCPMetricsHandler`.
    - Propagation of the `options` object (for credentials).
    - Caching behavior of `GCPMetricsHandler` instances per project ID.

These changes ensure that the client-side metrics functionality
compiles correctly and that the exporter can be properly authenticated
for sending metrics to Google Cloud Monitoring.

* run the linter

* Various changes to clarify types

* Parameter should be in this position

* Pass in project Id first

* Name of the project

* Go back to fetching OTEL instruments for each call

* expect project id in the metrics collector

* Make small change moving config manager

Fix the tests because the mock has moved too

* Debug current test of interest

* Thread the projectId through the OTEL instruments

again

* Run the linter

* Use metrics enabled to conditionally use metrics c

Turn on metrics enabled
Eliminate unnecessary parameter pass thrus

* Don’t store options

* Remove set options

* Separate object for creating metrics collector

Also adjust mocking for the system test.

* remove the console logs

* Only create one exporter per test

* Remove console trace

* Add fn to get the handler from the exporter

* Add a test making sure the exporter gets the opts

* Provide the proper mock for the metric service cli

client

* Each handler has a different instrument stack now

So these tests need to change

* cosmetic changes

Add the check for the projectId again?

* Fix compiler error for projectId

* Address most of the comments Jules added

* Remove unnecessary comments

* Address header check

* Remove unused imports

* Removed automatically added comments

* Pass in the projectId at constructor time

* Fix the tests so they pass

* Fix the manager tests

* Move the instrument stack cache

* Eliminate some proxyquire mocks

* More changes required to bring

handlers to the client

* Resolve the remaining compile time errors

* Fix the tests for createReadStream

* Fix Should export a value ready for sending to the

* Fix test due to metrics handler contract

* Remove only

* Add header

* Change fake bigtable mock

* Eliminate the assertion checks inside handler

* Fix the projectId test

* Remove onlys

* Fix the hundred metrics handlers test

* Add a test for 100 clients

* Add retries to metric service client

* Add a timeout to the hundred handlers

* Remove console logs

* Better test for many clients

* No set console log

* Eliminate hundred metrics handlers test

* Fix issues with system tests due to new design

* Remove onlys

* separate variable for handlers

---------

Co-authored-by: Daniel Sanche <d.sanche14@gmail.com>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
…into 359913994-third-PR-CSM

# Conflicts:
#	system-test/service-path.ts
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: bigtable Issues related to the googleapis/nodejs-bigtable API. labels Jun 2, 2025
Base automatically changed from 359913994-third-PR-CSM to main June 25, 2025 20:32
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 googleapis/nodejs-bigtable API. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant