fix: publish batch flow control metrics #2749
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently we have 2 otel instances that publishes built in metrics:
external OTEL: set on the tracer and collects metrics per request. Currently all the metrics on the external OTEL are published to BigtableTable schema.
internal OTEL: set on the channel provider and collects metrics periodically. Currently all the metrics on the internal OTEL are published to BigtableClient schema. (This was added because channel level metrics don't have information about bigtable resource ids, so the bigtable resource ids need to be hard coded when creating the OTEL, and CustomMetricsProvider doesn't have a way to create the OTEL instance with bigtable resource ids.)
The new batch flow control metrics are collected per request. The metrics also publish to BigtableClient schema. This means the current plumbing doesn't work anymore. This PR fixes the plumbing:
Also fix the metric labels in the outstanding_rpc metric.