Skip to content

Commit 776accd

Browse files
authored
Remove unneeded metrictest types (#2864)
* Remove unneeded metrictest types * Add changes to changelog * Revert removal of NewDescriptor
1 parent d342bde commit 776accd

File tree

4 files changed

+22
-98
lines changed

4 files changed

+22
-98
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
4242
- The `MergeIterator.Label` method in the `go.opentelemetry.io/otel/attribute` package is deprecated.
4343
Use the equivalent `MergeIterator.Attribute` method instead. (#2790)
4444

45+
### Removed
46+
47+
- Removed the `Batch` type from the `go.opentelemetry.io/otel/sdk/metric/metrictest` package. (#2864)
48+
- Removed the `Measurement` type from the `go.opentelemetry.io/otel/sdk/metric/metrictest` package. (#2864)
49+
4550
## [0.29.0] - 2022-04-11
4651

4752
### Added

sdk/metric/metrictest/alignment_test.go

-42
This file was deleted.

sdk/metric/metrictest/exporter.go

+17
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ import (
2020

2121
"go.opentelemetry.io/otel/attribute"
2222
"go.opentelemetry.io/otel/metric"
23+
"go.opentelemetry.io/otel/metric/instrument"
2324
"go.opentelemetry.io/otel/sdk/instrumentation"
2425
controller "go.opentelemetry.io/otel/sdk/metric/controller/basic"
2526
"go.opentelemetry.io/otel/sdk/metric/export"
2627
"go.opentelemetry.io/otel/sdk/metric/export/aggregation"
2728
"go.opentelemetry.io/otel/sdk/metric/number"
2829
processor "go.opentelemetry.io/otel/sdk/metric/processor/basic"
30+
"go.opentelemetry.io/otel/sdk/metric/sdkapi"
2931
selector "go.opentelemetry.io/otel/sdk/metric/selector/simple"
3032
)
3133

@@ -62,6 +64,14 @@ func NewTestMeterProvider(opts ...Option) (metric.MeterProvider, *Exporter) {
6264
return c, exp
6365
}
6466

67+
// Library is the same as "sdk/instrumentation".Library but there is
68+
// a package cycle to use it so it is redeclared here.
69+
type Library struct {
70+
InstrumentationName string
71+
InstrumentationVersion string
72+
SchemaURL string
73+
}
74+
6575
// ExportRecord represents one collected datapoint from the Exporter.
6676
type ExportRecord struct {
6777
InstrumentName string
@@ -178,3 +188,10 @@ func subSet(attributesA, attributesB []attribute.KeyValue) bool {
178188
}
179189
return true
180190
}
191+
192+
// NewDescriptor is a test helper for constructing test metric
193+
// descriptors using standard options.
194+
func NewDescriptor(name string, ikind sdkapi.InstrumentKind, nkind number.Kind, opts ...instrument.Option) sdkapi.Descriptor {
195+
cfg := instrument.NewConfig(opts...)
196+
return sdkapi.NewDescriptor(name, ikind, nkind, cfg.Description(), cfg.Unit())
197+
}

sdk/metric/metrictest/meter.go

-56
This file was deleted.

0 commit comments

Comments
 (0)