Skip to content
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

Bump OpenTelemetry dependency to v0.9.0 #73

Merged
merged 5 commits into from Aug 4, 2020

Conversation

glozow
Copy link
Contributor

@glozow glozow commented Jul 24, 2020

Ulterior Motive: I need this for stackdriver-sandbox instrumentation :). I need v0.9.0 for what I'm doing but it isn't compatible with the metrics exporter.

Most of this is picked up from #57, I merely rebased and squashed, left marvinkite as the author. There was some discussion on exporter kinds so I changed it to CumulativeExporter, but not 100% sure as this is above my head...

@google-cla
Copy link

google-cla bot commented Jul 24, 2020

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@glozow
Copy link
Contributor Author

glozow commented Jul 24, 2020

Oh no, I forgot to take into account the CLA requirement...

@google-cla
Copy link

google-cla bot commented Jul 24, 2020

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@glozow glozow marked this pull request as draft July 24, 2020 16:58
@google-cla
Copy link

google-cla bot commented Jul 24, 2020

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla
Copy link

google-cla bot commented Jul 24, 2020

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@glozow glozow marked this pull request as ready for review July 24, 2020 17:28
@glozow glozow added this to In progress in Cloud Ops Sandbox Scrum Jul 24, 2020
@marvinkite
Copy link
Contributor

@googlebot I consent.

@google-cla
Copy link

google-cla bot commented Jul 24, 2020

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

Copy link
Contributor

@james-bebbington james-bebbington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a fix to ensure export type is correctly specified as Cumulative (see comments below). Also, it would be great if you could validate this works by following the example in the example/metric package as I'm not 100% confident.

Ideally, we would have an integration test that verifies we are exporting this data correctly. FYI @mabdi3 - will you be adding a test case that checks the values emitted are correct?

i.e.

  • counter.Add(1)
  • export (DELTA = 1, CUMULATIVE = 1, validate exported value is 1)
  • counter.Add(1)
  • export (DELTA = 1, CUMULATIVE = 2, validate exported value is 2)

exporter/metric/cloudmonitoring.go Outdated Show resolved Hide resolved
@@ -186,7 +187,7 @@ func (me *metricExporter) ExportMetrics(ctx context.Context, cps export.Checkpoi
// if the descriptor is not registered in Cloud Monitoring yet.
func (me *metricExporter) exportMetricDescriptor(ctx context.Context, cps export.CheckpointSet) error {
mds := make(map[key]*googlemetricpb.MetricDescriptor)
aggError := cps.ForEach(func(r export.Record) error {
aggError := cps.ForEach(export.CumulativeExporter, func(r export.Record) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically we always export Cumulatives, but this is not how the interfaces are intended to be used. The interface design here is a little odd / confusing and I wouldn't be surprised if this changes before GA.

The first argument to ForEach is an ExportSelector. You should pass through me itself here as the exporter already implements this interface, rather than passing in this constant selector (likewise for each of the calls to ForEach below). This will mean the same function mentioned above will be used, rather than us having to specify Cumulative in multiple places here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, it doesn't seem to think metricExporter implements the ExportKindSelector interface:

../../exporter/metric/metric.go:190:26: cannot use *me (type metricExporter) as type "go.opentelemetry.io/otel/sdk/export/metric".ExportKindSelector in argument to cps.ForEach:
	metricExporter does not implement "go.opentelemetry.io/otel/sdk/export/metric".ExportKindSelector (missing ExportKindFor method)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm yea this is a bit weird because we have the Export wrapper. You implemented the ExportKindSelector above (https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/pull/73/files#diff-61301ca921134b70b15b20369de304f1R90) but its for the Exporter type rather than the metricExporter type

This might warrant some more significant refactoring but for now you could just pass the wrapper exporter into the newMetricExporter constructor so that you can use it here.

@google-cla
Copy link

google-cla bot commented Jul 27, 2020

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

1 similar comment
@google-cla
Copy link

google-cla bot commented Jul 27, 2020

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@mabdi3
Copy link
Contributor

mabdi3 commented Jul 27, 2020

Ideally, we would have an integration test that verifies we are exporting this data correctly. FYI @mabdi3 - will you be adding a test case that checks the values emitted are correct?

i.e.

  • counter.Add(1)
  • export (DELTA = 1, CUMULATIVE = 1, validate exported value is 1)
  • counter.Add(1)
  • export (DELTA = 1, CUMULATIVE = 2, validate exported value is 2)

@james-bebbington

No, there weren't really any plans for this. The integrations tests weren't really to test the exporters themselves but that the mock api behind the calls were executing successfully. I'm not very knowledgeable on the exporter logic, so if this is a needed test, we can talk offline about how that might look. Also, if you want, tests can be added whenever. All one must do is make sure to point the client endpoint to our mock api. See here for an example. If you have any questions, I'm happy to chat.

@google-cla
Copy link

google-cla bot commented Jul 27, 2020

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@james-bebbington
Copy link
Contributor

How is this PR going?

@gzhao408 Given that we only export Cumulatives and this part of the SDK is likely to change, I'm happy with leaving this PR as is where you specify CUMULATIVE everywhere for now. However, you will need to rebase and run make precommit.

@marvinkite Looking at the CLA checker, it appears this is failing because you have not associated your Github email address with your commit. The CLA needs to verify that the e-mail address associated with every commit matches an e-mail address that has signed the CLA. Are you okay sharing this e-mail address with us so we can attach it to the commit? (currently it is associated with an anonymous Github email)

@marvinkite
Copy link
Contributor

@james-bebbington I use anonymous email but the CLA contains my GitHub username. I don't wish to share the email in public but I give my consent to use my work without mentioning my name at all so @gzhao408 can squash it without my name.

@james-bebbington
Copy link
Contributor

@james-bebbington I use anonymous email but the CLA contains my GitHub username. I don't wish to share the email in public but I give my consent to use my work without mentioning my name at all so @gzhao408 can squash it without my name.

Ok great. Thankyou

@glozow
Copy link
Contributor Author

glozow commented Jul 31, 2020

@james-bebbington yes sorry, planning on getting back to this and applying the changes you suggested, but ran into a conflict that I wasn't sure how to fix while I was rebasing. We have a sprint ending today but I'll try to get back to this asap. I can also edit the authorship while I do that, thanks @marvinkite.

@james-bebbington
Copy link
Contributor

James Bebbington yes sorry, planning on getting back to this and applying the changes you suggested, but ran into a conflict that I wasn't sure how to fix while I was rebasing. We have a sprint ending today but I'll try to get back to this asap. I can also edit the authorship while I do that, thanks @marvinkite.

All good, just wanted to make sure you weren't blocked

Gloria Zhao added 2 commits August 3, 2020 11:43
original author @marvinkite consented to be removed from authorship
see PR#73 conversation
@glozow
Copy link
Contributor Author

glozow commented Aug 3, 2020

@james-bebbington just pushed an update, it's nothing fancy, but I don't have a very good understanding of the codebase unfortunately :(

Cloud Ops Sandbox Scrum automation moved this from Ready for Review to In progress Aug 4, 2020
Copy link
Contributor

@james-bebbington james-bebbington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor change left.

I also created #78 to track updating this properly in the future.

exporter/metric/metric_test.go Outdated Show resolved Hide resolved
@james-bebbington james-bebbington merged commit 7454a7e into GoogleCloudPlatform:master Aug 4, 2020
Cloud Ops Sandbox Scrum automation moved this from In progress to Done Aug 4, 2020
@nilebox
Copy link
Contributor

nilebox commented Aug 4, 2020

Looks like there are more breaking changes in v0.10.0: #77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants