1import{a as m,f as b}from"../chunks/CO4gmjL0.js";import{s as e,A as g,e as v,c as o,$ as k,r as t,n as y}from"../chunks/eyz4FpZ8.js";import{h as w}from"../chunks/B8iujwKi.js";var C=b(`<h1>Troubleshooting</h1> <p class="lead !mt-4 text-slate-300">The first-install failures InferCost users have actually hit, in order of frequency. If none of 2 these match what you're seeing, <a href="https://github.com/defilantech/infercost/issues/new" rel="external">open an issue</a> with your <code>kubectl describe costprofile</code> output attached.</p> <h2>The Grafana dashboard shows "No data"</h2> <p>Prometheus isn't scraping InferCost. The chart ships a <code>PodMonitor</code> template 3 (default-enabled) that should discover the controller automatically on 4 kube-prometheus-stack. Check in order:</p> <ol><li><code>kubectl get podmonitor -n infercost-system</code> â if empty, either <code>prometheus.podMonitor.enabled=false</code> or the <code>monitoring.coreos.com/v1</code> CRD isn't installed (no prometheus-operator).</li> <li>Target status in Prometheus: open the Prometheus UI â Status â Targets, search for <code>infercost</code>. If the target is listed but "down", Prometheus can see the PodMonitor 5 but can't reach the pod â usually a NetworkPolicy or a port mismatch.</li> <li>If running <strong>ServiceMonitor</strong> instead (custom prometheus-operator config), set <code>prometheus.serviceMonitor.enabled=true</code> and <code>prometheus.podMonitor.enabled=false</code> to avoid duplicate scraping.</li></ol> <h2>CostProfile shows $0/hr</h2> <p>The amortization denominator is the life of the hardware in hours, so if any input is zero the 6 output will be zero. Check:</p> <pre><code></code></pre> <p>And verify the spec has all three:</p> <ul><li><code>spec.hardware.purchasePriceUSD</code> (non-zero)</li> <li><code>spec.hardware.amortizationYears</code> (non-zero)</li> <li><code>spec.hardware.gpuCount</code> (non-zero)</li></ul> <p>If those look right, check <code>status.currentPowerDrawWatts</code>. If it's zero, the DCGM path 7 didn't return readings â see <a href="/docs/dcgm">DCGM setup</a> for the four diagnostic states.</p> <h2>UsageReport has no tokens</h2> <p>The controller can't find inference pods to scrape. It expects pods with the LLMKube model label <code>inference.llmkube.dev/model</code>. Without that label the pod is invisible.</p> <pre><code></code></pre> <p>Also verify the pod is <code>Running</code> with a <code>PodIP</code> assigned. Pending pods are 8 skipped.</p> <h2>Wrong backend parsed: llama.cpp metrics named as vLLM (or vice versa)</h2> <p>InferCost defaults to the llama.cpp metrics format. For vLLM pods, set the backend annotation:</p> <pre><code></code></pre> <p>Without this, scraping a vLLM pod returns zeros â the metric names don't match. Zero is the safe 9 fail state (no silent misattribution), but you will see flat token counts in the dashboard.</p> <p>Custom metrics port? Add <code>infercost.ai/metrics-port: "9000"</code> as an annotation or label 10 â the default is 8080 for llama.cpp and 8000 for vLLM.</p> <h2>Controller pod crashlooping at startup</h2> <p>Most common cause: a malformed <code>--pricing-file</code> override. The controller fails loud 11 rather than silently falling back to list prices â if you configured negotiated rates, we owe 12 you a loud error when we can't parse them.</p> <pre><code></code></pre> <p>Look for messages starting with <code>Failed to load pricing file</code>. Fix the YAML 13 (<a href="/docs/pricing">pricing docs</a>) and redeploy.</p> <h2>UsageReport reports cost but byModel is empty</h2> <p>The rollup path: at least one pod was scrapeable, but the controller couldn't attribute tokens to 14 a model. This happens when a pod is exposing metrics but does not carry the <code>inference.llmkube.dev/model</code> label. Check pod labels as in the "no tokens" case above.</p> <h2>FOCUS export fails with "no UsageReports matched"</h2> <p>The CLI filters by <code>--namespace</code> and <code>--period</code>. Drop both to see what the 15 cluster actually has:</p> <pre><code></code></pre> <p>If the list is empty, no UsageReport CR has been created yet â create one (see the <a href="/docs/crd-reference">CRD reference</a>). The controller populates status on the first 16 reconcile, usually within 30 seconds.</p>`,1);function x(d){var c=C();w("up4997",M=>{v(()=>{k.title="Troubleshooting â InferCost docs"})});var r=e(g(c),14),l=o(r);l.textContent="kubectl describe costprofile <name> | grep -A10 Status",t(r);var a=e(r,12),p=o(a);p.textContent=`# Find what InferCost is looking for 17kubectl get pods --all-namespaces -l inference.llmkube.dev/model 18 19# If you don't use LLMKube, add the label manually 20kubectl label pod my-vllm-pod -n engineering inference.llmkube.dev/model=qwen3-coder-30b`,t(a);var s=e(a,8),h=o(s);h.textContent=`metadata: 21 annotations: 22 infercost.ai/backend: vllm`,t(s);var n=e(s,10),u=o(n);u.textContent="kubectl logs -n infercost-system deploy/infercost-controller-manager",t(n);var i=e(n,12),f=o(i);f.textContent="kubectl get usagereports --all-namespaces",t(i),y(2),m(d,c)}export{x as component};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.