Skip to content

Commit

Permalink
remove unecessary changeds
Browse files Browse the repository at this point in the history
  • Loading branch information
huyan0 committed Aug 31, 2020
1 parent 8fc4b26 commit af53bb1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 1 addition & 3 deletions exporter/prometheusremotewriteexporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,7 @@ func (prwe *prwExporter) handleScalarMetric(tsMap map[string]*prompb.TimeSeries,
return fmt.Errorf("nil data point field in metric %v", metric.GetMetricDescriptor().Name)
}
for _, pt := range metric.DoubleDataPoints {
if pt == nil {
continue
}

// create parameters for addSample
name := getPromMetricName(metric.GetMetricDescriptor(), prwe.namespace)
labels := createLabelSet(pt.GetLabels(), nameStr, name)
Expand Down
8 changes: 3 additions & 5 deletions exporter/prometheusremotewriteexporter/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ import (
"go.opentelemetry.io/collector/internal/dataold/testdataold"
)

// TODO: add bucket and histogram test cases for Test_pushMetrics

// Test_handleScalarMetric checks whether data points within a single scalar metric can be added to a map of
// TimeSeries correctly.
// Test cases are two data point belonging to the same TimeSeries, two data point belonging different TimeSeries,
Expand Down Expand Up @@ -82,9 +80,9 @@ func Test_handleScalarMetric(t *testing.T) {
map[string]*prompb.TimeSeries{},
},
{
"invalid_metric_type",
"invalid_type_array",
&otlp.Metric{
MetricDescriptor: getDescriptor("invalid_nil_array", histogramComb, validCombinations),
MetricDescriptor: getDescriptor("invalid_type_array", histogramComb, validCombinations),
Int64DataPoints: nil,
DoubleDataPoints: nil,
HistogramDataPoints: nil,
Expand Down Expand Up @@ -541,7 +539,7 @@ func Test_pushMetrics(t *testing.T) {
name string
md *pdata.Metrics
reqTestFunc func(t *testing.T, r *http.Request, expected int)
expectedTimeSeries int
expectedTimeSeries int
httpResponseCode int
numDroppedTimeSeries int
returnErr bool
Expand Down
1 change: 1 addition & 0 deletions exporter/prometheusremotewriteexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func createMetricsExporter(_ context.Context, _ component.ExporterCreateParams,
exporterhelper.WithRetry(prwCfg.RetrySettings),
exporterhelper.WithShutdown(prwe.shutdown),
)

return prwexp, err
}

Expand Down

0 comments on commit af53bb1

Please sign in to comment.