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

Send "Content-Type" Header When Scraping Metrics for Prometheus 3.0 Compatibility #507

Open
eramnes opened this issue Jan 2, 2025 · 1 comment

Comments

@eramnes
Copy link

eramnes commented Jan 2, 2025

Thanks for putting this exporter out, it has been very useful to our organization. We've recently upgraded to Prometheus 3.0 and it appears that there's no Content-Type header set by this exporter when metrics are returned.

Prometheus 3.0 is more strict with the Content-Type header and checking the curl output for the WLS exporter, it appears to not be providing one (sanitized output):

$ curl -vs http://wls-server.example.com:9111/metrics --user monitor
Enter host password for user 'monitor':
*   Trying 192.168.0.20:9111...
* Connected to wls-server.example.com (192.168.0.20) port 9111 (#0)
* Server auth using Basic with user 'monitor'
> GET /metrics HTTP/1.1
> Host: wls-server.example.com:9111
> Authorization: Basic abcdefg1234567
> User-Agent: curl/7.76.1
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Date: Thu, 2 Jan 2025 08:45:44 -0600
< Connection: keep-alive
< Content-Length: 1052
< 
execute_thread_total_count{domain="DEFAULT",server="PIA",app="ThreadPoolRuntime"} 36
hogging_thread_count{domain="DEFAULT",server="PIA",app="ThreadPoolRuntime"} 0
overload_rejected_requests_count{domain="DEFAULT",server="PIA",app="ThreadPoolRuntime"} 0
pending_user_request_count{domain="DEFAULT",server="PIA",app="ThreadPoolRuntime"} 0
standby_thread_count{domain="DEFAULT",server="PIA",app="ThreadPoolRuntime"} 6
stuck_thread_count{domain="DEFAULT",server="PIA",app="ThreadPoolRuntime"} 0
throughput{domain="DEFAULT",server="PIA",app="ThreadPoolRuntime"} 1.999000499750125
jvm_heap_free_current{domain="DEFAULT",server="PIA",name="PIA"} 3867602632
jvm_heap_free_percent{domain="DEFAULT",server="PIA",name="PIA"} 90
jvm_heap_size_current{domain="DEFAULT",server="PIA",name="PIA"} 4294967296
wls_scrape_mbeans_count_total{instance="wls-server"} 10
wls_scrape_duration_seconds{instance="wls-server"} 0.03
wls_scrape_cpu_seconds{instance="wls-server"} 0.00
exporter_version{instance="wls-server",version="0073701 (1 commits since v2.2.2)"} 1
* Connection #0 to host wls-server.example.com left intact

This can be currently worked around by placing

fallback_scrape_protocol: PrometheusText0.0.4

in the scrape job, but it would be nice if the Content-Type was provided. We're using the sidecar exporter and I am not sure if this is an issue in the web application or not.

@russgold
Copy link
Member

russgold commented Jan 8, 2025

Yes, thanks. I am working on this at present.

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

No branches or pull requests

2 participants