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

converts Resource into a target_info metric on the prometheus exporter #3285

Merged
merged 6 commits into from Oct 19, 2022
Merged

converts Resource into a target_info metric on the prometheus exporter #3285

merged 6 commits into from Oct 19, 2022

Conversation

paivagustavo
Copy link
Member

Implements the required conversion of a metricResource so it can be exported by the prometheus exporter, specs.

The prometheus client lib doesn't have a info metric type, hence the usage of a gauge metric as suggested by the specs.

Fixes #3166, #3271

@codecov
Copy link

codecov bot commented Oct 14, 2022

Codecov Report

Merging #3285 (668093b) into main (05aca23) will increase coverage by 0.0%.
The diff coverage is 91.1%.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #3285   +/-   ##
=====================================
  Coverage   77.8%   77.9%           
=====================================
  Files        164     164           
  Lines      11289   11319   +30     
=====================================
+ Hits        8791    8821   +30     
  Misses      2301    2301           
  Partials     197     197           
Impacted Files Coverage Δ
exporters/prometheus/exporter.go 83.0% <89.6%> (+1.2%) ⬆️
exporters/prometheus/config.go 100.0% <100.0%> (ø)
exporters/jaeger/jaeger.go 90.3% <0.0%> (-0.9%) ⬇️
sdk/trace/batch_span_processor.go 81.9% <0.0%> (+1.7%) ⬆️

exporters/prometheus/exporter.go Outdated Show resolved Hide resolved
exporters/prometheus/exporter.go Outdated Show resolved Hide resolved
exporters/prometheus/testdata/counter.txt Show resolved Hide resolved
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.

A user may register the exporter with multiple exporters or other sources that generate a target info metric. An option to disable the target info metric should be include for the exporter to prevent multiple from being generated.

exporters/prometheus/exporter_test.go Outdated Show resolved Hide resolved
exporters/prometheus/exporter.go Outdated Show resolved Hide resolved
exporters/prometheus/config.go Outdated Show resolved Hide resolved
exporters/prometheus/config.go Outdated Show resolved Hide resolved
exporters/prometheus/exporter.go Outdated Show resolved Hide resolved
exporters/prometheus/confg_test.go Outdated Show resolved Hide resolved
exporters/prometheus/exporter.go Outdated Show resolved Hide resolved
# Conflicts:
#	CHANGELOG.md
#	exporters/prometheus/confg_test.go
#	exporters/prometheus/config.go
@MadVikingGod MadVikingGod merged commit 2d02a2f into open-telemetry:main Oct 19, 2022
@paivagustavo paivagustavo deleted the gustavo/3166/prometheus_exporter_add_target_info branch October 19, 2022 17:06
@MrAlias MrAlias mentioned this pull request Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
4 participants