This repository was archived by the owner on Jul 31, 2023. It is now read-only.
Allow custom view.Meters to export metrics for other Resources#1212
Merged
rghetia merged 3 commits intocensus-instrumentation:masterfrom Jun 8, 2020
Merged
Conversation
…ensus-instrumentation#1210) Time is already recorded on the client side and stored in the currently unused recordReq.t field. Avoiding these repeated calls to time.Now while the worker is blocked can significantly reduce worker contention.
|
We need a minor fix for stackdriver though. |
Contributor
Author
|
I'm wondering if we can leverage https://github.com/census-instrumentation/opencensus-go/blob/master/resource/resource.go#L146 |
Contributor
Author
|
Alternatively, we could do the conversion on the recording side for Stackdriver in Knative, and retire the use of |
rghetia
reviewed
Jun 5, 2020
| go defaultWorker.start() | ||
| } | ||
|
|
||
| // byTag implements sort.Interface for *metricdata.TimeSeries by Labels. |
rghetia
approved these changes
Jun 5, 2020
0fedf7a to
30ad700
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Working with #1196, I discovered that
metricexport.Readercollects metrics from all registered Producers, but doesn't provide a way to distinguish between different Meters. (WithRegisterExporter, I can hand off a different exporter for each Meter and curry the Resource that way.)This fills in the existing
metricdata.Resourcefield when available, which looks like it should already work with Stackdriver. Prometheus seems to ignore the Resource field; I can send a PR for that if desired.