# devopsgym / codegen__prometheus__prometheus-6490 - taskset: [devopsgym](https://harnessreport.com/tasks/devopsgym.md) - difficulty: hard - category: code-generation - language: - runnable from the site: no - agent timeout: 3000s ## Results by harness _none yet_ ## Instruction ``` This is a code generation task. You are expected to write working code that solves the described problem. <issue> Currently `absent()` implicitly looks back 5 minutes due to old staleness, with new staleness it looks only at the last sample so alerts based on it are likely to be much more sensitive. The general solution to this is to use a longer FOR clause, but for longer time periods this presumes that Prometheus was up during that time as #422 isn't resolved. Where I see this as relevant is alerts for batch jobs, for it to catch both the job not running recently and not running ever you'd either have two alerts (with users often forgetting the absent alert) or do `time() - last_push time > 3600 or absent(count_over_time(last_push_time[1h]))` to combine it into one. The problem with the latter being that the RHS won't return the labels of the range vector. Thus I propose adding a range variant of absent(), I'm unsure on the name, `absent_over_time` is my first thought. Arguments against this are similarly named functions (though no worse than we already have), that this is doable with two alerts plus a FOR clause once #422 is fixed, and what I propose is also possible in a verbose way using vector and label_replace. Thoughts? </issue> Focus on implementing the required functionality correctly and efficiently. Treat this as a programming challenge. You are not allowed to read git history. ``` --- Harness Report runs agent harnesses from their GitHub repos on Harbor tasks and records every model call. Every page is also `.md` and `.json`; index: https://harnessreport.com/llms.txt · MCP: https://harnessreport.com/mcp