Prometheus 1.8/2.2.1采集Confluence Exporter报"no token"错误求助
I’ve dealt with head-scratching exporter failures like this before, so let’s walk through some deeper checks beyond what you’ve already done. The fact that even Prometheus 1.8 is now failing (after working for months) tells us it’s not just a 2.x-specific quirk—something in the pipeline between Prometheus, the exporter, or Confluence shifted, even if you don’t see it at first glance.
1. Dig Into the Exporter’s Runtime Logs
This is usually where the hidden issues live. You mentioned checking the URL and promtool, but the exporter itself might be throwing errors that don’t show up in Prometheus’ scrape logs:
- If you’re running the exporter as a systemd service, run
journalctl -u confluence_exporter -fto watch live logs. Look for red flags likeTLS handshake failed,context deadline exceeded, orAPI request rejected by Confluence. - If it’s a container, use
docker logs -f <exporter-container-name>to get the same granular details. Even a minor dependency update (like a Go patch) could break the exporter’s ability to talk to Confluence. - Double-check the exporter’s version with
confluence_exporter --version—make sure it’s the exact same build that worked before. Accidental updates happen more often than you’d think.
2. Validate Prometheus Scrape Config Edge Cases
Even if the URL works manually, Prometheus’ scrape behavior might be hitting unforeseen limits:
- TLS Certificate Issues: If you use self-signed certs for the exporter, confirm Prometheus (both versions) has the correct CA cert in its scrape job’s
tls_config. Try addinginsecure_skip_verify: truetemporarily (don’t leave this enabled long-term) to rule out cert validation failures. - Timeout & Retry Settings: The exporter might be taking longer to fetch metrics than Prometheus’ default timeout. Bump
scrape_timeoutto 15s in your job config and setscrape_retries: 2—transient network blips or slow Confluence responses could be causing silent failures. - Metric Naming Warnings Turning Into Failures: That promtool warning about
confluence_cluster_panic_countmissing the_totalsuffix might be more impactful than you think. Some Prometheus builds (especially newer 2.x versions with strict config checks) can block ingestion if metrics don’t follow naming conventions. Try renaming the metric in the exporter’s config (if supported) or modifying its code to add_total—this might resolve the scrape block.
3. Test the Network Path From Prometheus’ Perspective
Your local test of the URL doesn’t mean the Prometheus server can reach it the same way:
- Run
curl -v <exporter-https-url>directly on the Prometheus server. This will show you if there are TLS errors, redirects, or proxy issues that don’t show up on your workstation. - Check if firewall rules changed. Even if Confluence didn’t update, network teams might have modified allowlists to block the exporter’s IP address. Verify the exporter’s IP is still allowed to reach Confluence’s metrics endpoints.
- If Prometheus uses a proxy, double-check the
proxy_urlsetting in the scrape job. A misconfigured proxy after migration could be silently dropping requests.
4. Verify Exporter-Confluence API Permissions
Even if Confluence itself didn’t change, its permission settings might have:
- Check Confluence’s access logs for the exporter’s API token. Look for 4xx (permission denied) or 5xx (server error) status codes that the exporter might not log.
- Confirm the exporter’s API token still has the required permissions (e.g., read access to system metrics). Sometimes Confluence plugin updates or admin changes reset these permissions without notice.
- Manually hit the exporter’s
/metricsendpoint from the Prometheus server. If it returns an empty response or partial metrics, the issue is with the exporter fetching data from Confluence—not Prometheus scraping the exporter.
Start with checking the exporter’s live logs and running the curl test from the Prometheus server—those two steps usually uncover the root cause faster than anything else. Let me know what you find!
内容的提问来源于stack exchange,提问作者Markus

