-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update opentelemetry dependencies #487
Conversation
b1a99d1
to
73fb994
Compare
} | ||
return e, nil | ||
} | ||
|
||
// InstallNewPipeline instantiates a NewExportPipeline and registers it globally. | ||
func InstallNewPipeline(opts []Option, popts ...controller.Option) (*controller.Controller, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved InstallNewPipeline and NewExportPipeline to cloudmonitoring.go, and deprecated it, since that is what upstream otel-go did with their equivalent functions.
|
||
monitoring "cloud.google.com/go/monitoring/apiv3/v2" | ||
"golang.org/x/oauth2/google" | ||
) | ||
|
||
const ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, remove interval-related options, since exporters don't configure the interval anymore.
me, err := newMetricExporter(&o) | ||
// NewRawExporter creates a new Exporter thats implements metric.Exporter. | ||
// Deprecated: Use New() instead. | ||
func NewRawExporter(opts ...Option) (metric.Exporter, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NewRawExporter is renamed to New to match OTLP exporters' patterns.
var tss []*monitoringpb.TimeSeries | ||
errs := []error{} | ||
switch a := m.Data.(type) { | ||
case metricdata.Gauge[int64]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a lot of this code is repeated, but unfortunately it is hard to simplify because of the use of generics. We have a metric descriptor cache we want to use globally (so metricExporter can't be a generic type), but functions on types are not allowed to have generic arguments, so gaugeToTimeSeries (and others) can't be functions on metricExporter to be generic.
We can revisit it later to try and simplify if we want
}) | ||
if aggError != nil { | ||
t.Errorf("%v", aggError) | ||
out := me.recordToMpb(inputMetrics, inputAttributes, inputLibrary) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now directly invoked with metricdata, rather than through the otel API path. MeterProvider does not provide a ForEach function anymore (instead has the exporter/reader interfaces), so we can't easily do that anymore. Same for the utf8 version of this test below.
d0e9b8f
to
11cfd29
Compare
This includes updating to the newly rewritten metrics API + SDK.
It also updates to go 1.18, since the new API+SDK use generics