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

Freakynoblegas/reject invalid queue size exporterhelper #4799

Merged
merged 2 commits into from
Feb 8, 2022
Merged

Freakynoblegas/reject invalid queue size exporterhelper #4799

merged 2 commits into from
Feb 8, 2022

Conversation

FreakyNobleGas
Copy link
Contributor

Description:

  • Added Validation method to QueueSettings struct in ExporterHelper which checks for zero or negative values.
  • Updated OTLP exporter config to validate QueueSettings struct.

Link to tracking Issue: 4584

Testing:

  • Added test for QueueSetting's Validate function in queue_retry_test.go

Documentation:

  • Added comments with code as appropriate. I am unsure if I should update changelog.

@FreakyNobleGas FreakyNobleGas requested review from a team and Aneurysm9 February 3, 2022 17:06
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 3, 2022

CLA Signed

The committers are authorized under a signed CLA.

Comment on lines 67 to 73
if qCfg.QueueSize < 0 {
return fmt.Errorf("queue size can't be negative")
}

if qCfg.Enabled && qCfg.QueueSize == 0 {
return fmt.Errorf("a 0 size queue will drop all the data")
}
Copy link
Member

Choose a reason for hiding this comment

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

I think if not enabled I think we should just return.

exporter/otlpexporter/config.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Feb 4, 2022

Codecov Report

Merging #4799 (bef72fb) into main (32301d9) will decrease coverage by 0.00%.
The diff coverage is 72.72%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4799      +/-   ##
==========================================
- Coverage   90.68%   90.68%   -0.01%     
==========================================
  Files         179      179              
  Lines       10545    10577      +32     
==========================================
+ Hits         9563     9592      +29     
- Misses        763      765       +2     
- Partials      219      220       +1     
Impacted Files Coverage Δ
exporter/otlpexporter/config.go 40.00% <0.00%> (-60.00%) ⬇️
exporter/exporterhelper/queued_retry_inmemory.go 95.58% <100.00%> (+0.58%) ⬆️
model/pdata/metrics.go 98.33% <0.00%> (-0.36%) ⬇️
model/pdata/generated_log.go 96.65% <0.00%> (ø)
model/pdata/generated_trace.go 96.89% <0.00%> (ø)
model/pdata/generated_common.go 100.00% <0.00%> (ø)
model/pdata/generated_resource.go 100.00% <0.00%> (ø)
component/componenttest/nop_exporter.go 100.00% <0.00%> (ø)
component/componenttest/nop_receiver.go 100.00% <0.00%> (ø)
component/componenttest/nop_extension.go 100.00% <0.00%> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 32301d9...bef72fb. Read the comment docs.

@bogdandrutu
Copy link
Member

Please add a changelog entry.

@bogdandrutu bogdandrutu added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Feb 7, 2022
@bogdandrutu bogdandrutu merged commit 48c402d into open-telemetry:main Feb 8, 2022
@FreakyNobleGas FreakyNobleGas deleted the freakynoblegas/reject-invalid-queue-size-exporterhelper branch February 8, 2022 01:49
@jpkrohling jpkrohling added this to the v0.45.0 milestone Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants