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

Prometheus exporter no longer collects metrics after shutdown #4648

Merged
merged 4 commits into from
Oct 25, 2023

Conversation

dashpole
Copy link
Contributor

Fixes #4032.

Before the fix, the test case fails with:

--- FAIL: TestShutdownExporter (0.00s)
    exporter_test.go:859:
        	Error Trace:	/usr/local/google/home/dashpole/go/src/go.opentelemetry.io/opentelemetry-go/exporters/prometheus/exporter_test.go:859
        	Error:      	Received unexpected error:
        	            	collected metric "target_info" { label:{name:"service_name" value:"unknown_service:prometheus.test"} label:{name:"telemetry_sdk_language" value:"go"} label:{name:"telemetry_sdk_name" value:"opentelemetry"} label:{name:"telemetry_sdk_version" value:"1.19.0"} gauge:{value:1}} was collected before with the same name and label values
        	Test:       	TestShutdownExporter
FAIL
FAIL	go.opentelemetry.io/otel/exporters/prometheus	0.055s

@dashpole dashpole added bug Something isn't working pkg:exporter:prometheus Related to the Prometheus exporter package labels Oct 20, 2023
@dashpole dashpole force-pushed the prometheus_restart branch 2 times, most recently from 6593aaf to 2dfd6f1 Compare October 20, 2023 20:12
@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

Merging #4648 (52de753) into main (d18277e) will increase coverage by 0.0%.
The diff coverage is 75.0%.

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #4648   +/-   ##
=====================================
  Coverage   81.3%   81.4%           
=====================================
  Files        225     225           
  Lines      17725   17728    +3     
=====================================
+ Hits       14427   14431    +4     
  Misses      2998    2998           
+ Partials     300     299    -1     
Files Coverage Δ
exporters/prometheus/exporter.go 84.0% <75.0%> (+0.4%) ⬆️

@MadVikingGod MadVikingGod merged commit 7e6da12 into open-telemetry:main Oct 25, 2023
23 of 24 checks passed
@MrAlias MrAlias added this to the v1.20.0 milestone Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:exporter:prometheus Related to the Prometheus exporter package
Development

Successfully merging this pull request may close these issues.

prometheus: Unable to export data after restarting the exporter
4 participants