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

Refactor the Prometheus remote write exporter to use OTLP v0.5.0 #1708

Merged
merged 2 commits into from
Sep 1, 2020

Conversation

huyan0
Copy link
Member

@huyan0 huyan0 commented Sep 1, 2020

This PR removes dependency on dataold and the old v0.4.0 OTLP definitions. It refactors code for metric conversion to convert from OTLP v0.5.0.

Changes in this PR includes:

  • Replace references:
    • dataold.MetricsData -> data.MetricsData
    • pdatautil.OldInternal -> pdatautil.Internal
    • testdataold -> testdata (prefix was changed GenerateMetricData -> GenerateMetrics)
  • Change helper methods to take in a pointer to a metric rather than a metric descriptor
  • Create helper methods to get the type string from the metric
  • Create helper methods for IntDataPoint, DoubleDataPoint, IntHistogramDataPoint , and DoubleHistogramDataPoint
  • Replace OTLPv0.4.0 metrics with v0.5.0 metrics as inputs for unit tests. This accounted for a lot of the changes

Linked Issue: resolves #1681
Related PR: #1643

cc: @bogdandrutu @jmacd @alolita @huyan0

@huyan0 huyan0 changed the title Refactor the Prometheus remote writ exporter to use OTLP v0.5.0 Refactor the Prometheus remote write exporter to use OTLP v0.5.0 Sep 1, 2020
@codecov
Copy link

codecov bot commented Sep 1, 2020

Codecov Report

Merging #1708 into master will decrease coverage by 0.07%.
The diff coverage is 99.40%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1708      +/-   ##
==========================================
- Coverage   92.39%   92.32%   -0.08%     
==========================================
  Files         264      264              
  Lines       19960    20049      +89     
==========================================
+ Hits        18442    18510      +68     
- Misses       1089     1110      +21     
  Partials      429      429              
Impacted Files Coverage Δ
exporter/prometheusremotewriteexporter/helper.go 99.02% <99.21%> (-0.98%) ⬇️
exporter/prometheusremotewriteexporter/exporter.go 92.80% <100.00%> (-3.15%) ⬇️
internal/dataold/testdataold/metric.go 80.56% <0.00%> (-3.06%) ⬇️
consumer/pdatautil/pdatautil.go 84.09% <0.00%> (-2.28%) ⬇️

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 274fb4e...d007b81. Read the comment docs.

@bogdandrutu bogdandrutu merged commit 7096777 into open-telemetry:master Sep 1, 2020
Troels51 pushed a commit to Troels51/opentelemetry-collector that referenced this pull request Jul 5, 2024
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.

Change Prometheus remote write exporter to use the new internal metrics structs
2 participants