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

Change NewSplitDriver paramater and initialization #1798

Merged
merged 25 commits into from Apr 23, 2021

Conversation

bryan-aguilar
Copy link
Contributor

This PR updates the way that NewSplitDriver is initialized and the arguments that it takes. As discussed in the SIG meeting on 2021-04-01 the program should not panic if a user fails to initialize all drivers in the config. NewSplitDriver now accepts a set of options which moves it to be in line with the rest of the code base. A noopDriver is internally created for uninitialized fields.

Resolves #1583

bryan-aguilar and others added 10 commits April 6, 2021 13:36
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
@codecov
Copy link

codecov bot commented Apr 12, 2021

Codecov Report

Merging #1798 (d6a784d) into main (02d8bdd) will increase coverage by 0.0%.
The diff coverage is 100.0%.

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #1798   +/-   ##
=====================================
  Coverage   78.6%   78.6%           
=====================================
  Files        137     137           
  Lines       7288    7298   +10     
=====================================
+ Hits        5729    5739   +10     
  Misses      1315    1315           
  Partials     244     244           
Impacted Files Coverage Δ
exporters/otlp/options.go 100.0% <100.0%> (ø)
exporters/otlp/protocoldriver.go 100.0% <100.0%> (ø)

@bryan-aguilar
Copy link
Contributor Author

@MrAlias @Aneurysm9

CHANGELOG.md Outdated Show resolved Hide resolved
exporters/otlp/options.go Outdated Show resolved Hide resolved

recordCount := 5
assert.NoError(t, driver.ExportMetrics(ctx, stubCheckpointSet{recordCount}, metricsdk.StatelessExportKindSelector()))
assert.NoError(t, driver.ExportTraces(ctx, nil))
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this makes no actual difference in the code, but could we change these nils to actual snapshots like the test above?
This is just to make sure future iterations of this can't shortcut nil or 0 len inputs and still pass but fail with real data.

Copy link
Contributor

Choose a reason for hiding this comment

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

It would make sense to just abstract this part of the repeated code into a separate function that can be called and will ensure this uniform call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes a lot of sense. I will work on refining the test cases, was trying to get the core change out for review. Do you want me to change this to a draft PR @MrAlias ?

Copy link
Contributor

Choose a reason for hiding this comment

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

@bryan-aguilar if you think the changes needed will be greater than just the two tests here doing in another PR sounds reasonable, but if not including the changes here seems valid.

exporters/otlp/protocoldriver.go Outdated Show resolved Hide resolved
exporters/otlp/protocoldriver.go Outdated Show resolved Hide resolved
exporters/otlp/protocoldriver.go Outdated Show resolved Hide resolved
exporters/otlp/protocoldriver.go Outdated Show resolved Hide resolved
exporters/otlp/options.go Outdated Show resolved Hide resolved
exporters/otlp/options.go Outdated Show resolved Hide resolved
exporters/otlp/options.go Outdated Show resolved Hide resolved

recordCount := 5
assert.NoError(t, driver.ExportMetrics(ctx, stubCheckpointSet{recordCount}, metricsdk.StatelessExportKindSelector()))
assert.NoError(t, driver.ExportTraces(ctx, nil))
Copy link
Contributor

Choose a reason for hiding this comment

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

It would make sense to just abstract this part of the repeated code into a separate function that can be called and will ensure this uniform call.

bryan-aguilar and others added 4 commits April 19, 2021 08:23
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
bryan-aguilar and others added 3 commits April 19, 2021 08:23
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
exporters/otlp/options.go Outdated Show resolved Hide resolved
exporters/otlp/options.go Outdated Show resolved Hide resolved
@MrAlias MrAlias added pkg:exporter:otlp Related to the OTLP exporter package release:1.0.0-rc.1 labels Apr 20, 2021
@MrAlias MrAlias added this to In progress in OpenTelemetry Go RC via automation Apr 20, 2021
@MrAlias MrAlias added this to the RC1 milestone Apr 20, 2021
OpenTelemetry Go RC automation moved this from In progress to Reviewer approved Apr 22, 2021
Copy link
Contributor

@MrAlias MrAlias left a comment

Choose a reason for hiding this comment

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

🥇

CHANGELOG.md Outdated Show resolved Hide resolved
@Aneurysm9 Aneurysm9 merged commit 0f4e454 into open-telemetry:main Apr 23, 2021
OpenTelemetry Go RC automation moved this from Reviewer approved to Done Apr 23, 2021
@Aneurysm9 Aneurysm9 mentioned this pull request Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:exporter:otlp Related to the OTLP exporter package
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

OTLP exporter only for traces
4 participants