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

Migrate Prometheus to the new MetricsExporter interface #1477

Merged
merged 1 commit into from
Aug 4, 2020

Conversation

bogdandrutu
Copy link
Member

No description provided.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
@codecov
Copy link

codecov bot commented Aug 3, 2020

Codecov Report

Merging #1477 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1477   +/-   ##
=======================================
  Coverage   90.92%   90.92%           
=======================================
  Files         239      239           
  Lines       16706    16709    +3     
=======================================
+ Hits        15190    15193    +3     
  Misses       1085     1085           
  Partials      431      431           
Impacted Files Coverage Δ
exporter/prometheusexporter/factory.go 89.18% <100.00%> (+0.30%) ⬆️
exporter/prometheusexporter/prometheus.go 92.59% <100.00%> (+0.59%) ⬆️
service/defaultcomponents/defaults.go 84.61% <100.00%> (ø)
translator/internaldata/resource_to_oc.go 87.50% <0.00%> (ø)

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 81e3c64...a50b2ea. Read the comment docs.

for _, metric := range merged {
_ = pe.exporter.ExportMetric(ctx, md.Node, md.Resource, metric)
func (pe *prometheusExporter) ConsumeMetrics(ctx context.Context, md pdata.Metrics) error {
ocmds := pdatautil.MetricsToMetricsData(md)
Copy link
Member

Choose a reason for hiding this comment

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

Out of curiousity: what's the long term plan for this? Having to convert the data as the very first step in the "new" metric exporter is pretty confusing.

Copy link
Member Author

Choose a reason for hiding this comment

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

The long term is to change to use the new data directly without oc as intermediate step. Right now focus on changing everything to use the new interfaces so at least we are not everywhere in this transition state and service and config code can be changed to only work with the new interfaces

merge(merged, metric)
}
for _, metric := range merged {
_ = pe.exporter.ExportMetric(ctx, ocmd.Node, ocmd.Resource, metric)
Copy link
Member

Choose a reason for hiding this comment

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

Unrelated to this PR (the old code is the same), but we shouldn't ignore errors.

Copy link
Member Author

Choose a reason for hiding this comment

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

You commented before to not do unrelated changes :)

@bogdandrutu bogdandrutu merged commit bd921af into open-telemetry:master Aug 4, 2020
@bogdandrutu bogdandrutu deleted the metricsold branch August 4, 2020 01:25
bogdandrutu added a commit to bogdandrutu/opentelemetry-collector that referenced this pull request Aug 4, 2020
…ry#1477)

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
MovieStoreGuy pushed a commit to atlassian-forks/opentelemetry-collector that referenced this pull request Nov 11, 2021
…etry#1477)

Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.35.0 to 1.35.2.
- [Release notes](https://github.com/golangci/golangci-lint/releases)
- [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md)
- [Commits](golangci/golangci-lint@v1.35.0...v1.35.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
hughesjj pushed a commit to hughesjj/opentelemetry-collector that referenced this pull request Apr 27, 2023
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.

2 participants