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

exporter/signalfx: Correctly convert dimensions on metadata updates #2552

Merged
merged 1 commit into from
Mar 5, 2021

Conversation

asuresh4
Copy link
Member

@asuresh4 asuresh4 commented Mar 4, 2021

Description: Correctly convert dimension values while making metadata updates. Currently, the exporter invokes sanitizeDataPointDimensions on all translated datapoints which cleans up non-alphanumeric dimension keys. This is not being done for dimensions in metadata updates. This PR ensures that dimensions are correctly translated and sanitized even in metadata updates.

Testing: Added tests.

@asuresh4 asuresh4 requested a review from a team March 4, 2021 01:14
@codecov
Copy link

codecov bot commented Mar 4, 2021

Codecov Report

Merging #2552 (9235619) into main (d8ed6a8) will increase coverage by 0.02%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2552      +/-   ##
==========================================
+ Coverage   91.32%   91.34%   +0.02%     
==========================================
  Files         429      429              
  Lines       21456    21457       +1     
==========================================
+ Hits        19594    19600       +6     
+ Misses       1394     1392       -2     
+ Partials      468      465       -3     
Flag Coverage Δ
integration 69.18% <ø> (ø)
unit 90.24% <88.88%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...xporter/signalfxexporter/translation/translator.go 95.88% <ø> (ø)
exporter/signalfxexporter/dimensions/metadata.go 68.18% <66.66%> (-2.04%) ⬇️
exporter/signalfxexporter/dimensions/dimclient.go 80.28% <100.00%> (ø)
exporter/signalfxexporter/exporter.go 97.26% <100.00%> (ø)
exporter/signalfxexporter/translation/converter.go 95.26% <100.00%> (+0.10%) ⬆️
exporter/signalfxexporter/dimensions/requests.go 92.15% <0.00%> (+9.80%) ⬆️

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 d8ed6a8...9235619. Read the comment docs.

@@ -116,7 +108,7 @@ func getPropertiesAndTags(kmu metadata.MetadataUpdate) (map[string]*string, map[
func (dc *DimensionClient) PushMetadata(metadata []*metadata.MetadataUpdate) error {
var errs []error
for _, m := range metadata {
dimensionUpdate := getDimensionUpdateFromMetadata(*m, dc.metricTranslator)
dimensionUpdate := getDimensionUpdateFromMetadata(*m, dc.metricsConverter)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this really not tested with a mock client or backend?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is, there are tests in exporter_test but codev does not account for tests outside the package

@asuresh4 asuresh4 force-pushed the sfxexporter-fix branch 2 times, most recently from e8ea51c to 8dd99ff Compare March 5, 2021 16:26
@bogdandrutu
Copy link
Member

Please rebase

@bogdandrutu bogdandrutu merged commit ef9e993 into open-telemetry:main Mar 5, 2021
This was referenced Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants