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

Commit

Permalink
Rename ExportMetricsProtoSync to ExportMetricsProto (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdandrutu committed Aug 29, 2019
1 parent 93f882d commit 97b79b6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion equivalence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ func TestEquivalenceStatsVsMetricsUploads(t *testing.T) {
})

// Export the proto Metrics to the Stackdriver backend.
se.ExportMetricsProtoSync(context.Background(), nil, nil, metricPbs)
se.ExportMetricsProto(context.Background(), nil, nil, metricPbs)
se.Flush()

var stackdriverTimeSeriesFromMetrics []*monitoringpb.CreateTimeSeriesRequest
Expand Down
4 changes: 2 additions & 2 deletions metrics_proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ var percentileLabelKey = &metricspb.LabelKey{
var globalResource = &resource.Resource{Type: "global"}
var domains = []string{"googleapis.com", "kubernetes.io", "istio.io"}

// ExportMetricsProtoSync exports OpenCensus Metrics Proto to Stackdriver Monitoring synchronously,
// ExportMetricsProto exports OpenCensus Metrics Proto to Stackdriver Monitoring synchronously,
// without de-duping or adding proto metrics to the bundler.
func (se *statsExporter) ExportMetricsProtoSync(ctx context.Context, node *commonpb.Node, rsc *resourcepb.Resource, metrics []*metricspb.Metric) error {
func (se *statsExporter) ExportMetricsProto(ctx context.Context, node *commonpb.Node, rsc *resourcepb.Resource, metrics []*metricspb.Metric) error {
if len(metrics) == 0 {
return errNilMetricOrMetricDescriptor
}
Expand Down
13 changes: 3 additions & 10 deletions stackdriver.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,17 +347,10 @@ func (e *Exporter) ExportView(vd *view.Data) {
e.statsExporter.ExportView(vd)
}

// ExportMetricsProto exports OpenCensus Metrics Proto to Stackdriver Monitoring.
func (e *Exporter) ExportMetricsProto(ctx context.Context, node *commonpb.Node, rsc *resourcepb.Resource, metrics []*metricspb.Metric) error {
return e.statsExporter.ExportMetricsProtoSync(ctx, node, rsc, metrics)
}

// ExportMetricsProtoSync exports OpenCensus Metrics Proto to Stackdriver Monitoring synchronously,
// ExportMetricsProto exports OpenCensus Metrics Proto to Stackdriver Monitoring synchronously,
// without de-duping or adding proto metrics to the bundler.
//
// Deprecated: experimental API for internal use at OpenTelemetry-Service only.
func (e *Exporter) ExportMetricsProtoSync(ctx context.Context, node *commonpb.Node, rsc *resourcepb.Resource, metrics []*metricspb.Metric) error {
return e.statsExporter.ExportMetricsProtoSync(ctx, node, rsc, metrics)
func (e *Exporter) ExportMetricsProto(ctx context.Context, node *commonpb.Node, rsc *resourcepb.Resource, metrics []*metricspb.Metric) error {
return e.statsExporter.ExportMetricsProto(ctx, node, rsc, metrics)
}

// ExportMetrics exports OpenCensus Metrics to Stackdriver Monitoring
Expand Down

0 comments on commit 97b79b6

Please sign in to comment.