Read SecObserve Metrics
secobserve_product_metricsRetrieve pre-aggregated vulnerability counts by severity and status for a product, group, or instance. Choose current, timeline, delta, or status views to track changes without querying raw findings.
Instructions
Read pre-aggregated observation counts for a product, a group, or the whole instance.
Far cheaper than counting rows with secobserve_list: these come from the metrics tables a background job maintains. That also means they are as old as the last calculation -- kind="status" tells you how old, and is worth reading before quoting a number as current.
License counts are not in here: use secobserve_list("products") for the per-product *_licenses_count fields, or the license_overview action on license_components for counts grouped by license.
kind="delta" answers "what changed between these two dates", which the API itself cannot: it offers relative windows only, has no delta endpoint, and its timeline skips the days the background job did not run.
Args: kind (str): "current", "timeline", "delta" or "status". product_id (Optional[int]): One product, or every product in a group when the id is a product group. Resolved before the metrics are read, because the endpoints answer for the whole instance when the id matches nothing. Omit for the instance. age (Optional[MetricsAge]): Window for "timeline": "Past 7 days", "Past 30 days", "Past 90 days", "Past 365 days". since (Optional[str]): Start of the range for "delta", YYYY-MM-DD. until (Optional[str]): End of the range for "delta", YYYY-MM-DD, today when omitted. response_format (ResponseFormat): "json" (default) or "markdown".
Returns: str: For kind="current", a JSON object of fifteen counts: six by severity (active_critical, active_high, active_medium, active_low, active_none, active_unknown) and nine by status (open, affected, resolved, duplicate, false_positive, in_review, not_affected, not_security, risk_accepted). It carries an extra "stale" block when the metrics job has not run for several of its own calculation intervals, because the endpoint then answers 200 with every count at zero instead of failing. The warning says how long ago it last ran. For kind="timeline", a JSON object keyed by ISO date, each value the counts for that day. For kind="delta", {"since": {"requested", "used"}, "until": {"requested", "used"}, "start": counts, "end": counts, "delta": signed change per counter, "missing_days": days in the range the job never wrote}. Quote "used" rather than "requested" whenever they differ, since the counts come from the dates that exist. For kind="status", {"last_calculated": ISO timestamp, "calculation_interval": minutes}.
Examples: - Use when: "how many critical findings are open in product 12?" -> kind="current", product_id=12 - Use when: "is our backlog growing?" -> kind="timeline", age="Past 90 days" - Use when: "what changed in August?" -> kind="delta", since="2026-08-01", until="2026-08-31" - Use when: a metric looks wrong -> kind="status", to check the job has run. - Don't use when: you need the findings themselves (use secobserve_list). - Don't use when: you need license counts, see above.
Error Handling: 403 means no view permission on the product, and an unknown product_id is refused rather than silently widened to the whole instance. An empty timeline usually means the metrics job has not run yet for that window -- check kind="status". A "stale" block on kind="current" is not an error, but the zeros under it are not an answer: report the staleness instead of the counts. kind="delta" refuses a since after until, a since older than everything the instance retains (the error names the earliest date it has), and since or until on another kind.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| age | No | Time window, for kind='timeline' only. Omit for the full retained history. | |
| kind | Yes | 'current' = observation counts by severity and status as of the last calculation; 'timeline' = one entry per day; 'delta' = the signed change between since and until; 'status' = when metrics were last calculated and how often, which tells you how stale 'current' is. | |
| since | No | Start of the range for kind='delta', ISO YYYY-MM-DD. The nearest date with metrics at or before it is used, and the result names it. | |
| until | No | End of the range for kind='delta', ISO YYYY-MM-DD. Defaults to today, resolved like since. | |
| product_id | No | Restrict to one product, or to every product in a product group when the id is a group. An id that matches neither is refused. Omit for the whole instance. | |
| response_format | No | Output format. | json |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |