Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
metrics: implement metrics converter
Browse files Browse the repository at this point in the history
* Glued up the various methods and helpers to finally
expose ExportMetric which will be used to export
OpenCensus metrics to Stackdriver Monitoring.

* Updated the statsExporter for reuse and added a protoMetricsBundler,
renamed e.bundler to e.viewDataBundler
The bundler for uploading and converting view.Data has been
renamed to "viewDataBundler" and one for uploading and converting
metricspb.Metric has been added and named "protoMetricsBundler".
This ensures background processing and batching of work instead
of always making a network call on ExportMetric.

* Added stats vs protoMetrics equivalence tests
For parity of methods and to ensure that the already
working stats Stackdriver upload produces the exact same
metric descriptors and time series as the new proto upload,
added equivalence tests as well as separated out the code
with specialized and more testable helper functions.
Created a full "Stackdriver" backend which receives data
exported both by the view.ExportView interface which takes
in view.Data and converts them directly to:
* monitoringpb.CreateMetricDescriptorRequest
* monitoringpb.CreateTimeSeriesRequest
and then compares the results from metric.ExportMetric
which takes in metricspb.Metric from OpenCensus-Proto
and converts them to the above mentioned requests.
The newly added equivalence test found discrepancies in:
* The way MetricDescriptors were created by the Metrics exporter,
which was incorrect but should be based off the Metric's Name
* When creating LastValue aggregation based points, the Metric
exporter was including StartTime in each point but for any
.GAUGE value, only the EndTime matters
This test also ensure parity and fidelity preservation whether
from view.Data or metricspb.Metric exporting, hence equivalence.

Fixes #64
  • Loading branch information
odeke-em committed Jan 17, 2019
1 parent 2812444 commit 7913da1
Show file tree
Hide file tree
Showing 5 changed files with 860 additions and 33 deletions.

0 comments on commit 7913da1

Please sign in to comment.