Skip to content

pmrep --ignore-unknown flag doesn't work, fails on unknown metrics #2452

@tallpsmith

Description

@tallpsmith

The --ignore-unknown flag exists (option -5 / --ignore-unknown) but doesn't gracefully handle unknown metrics as documented.

Expected behavior:
When --ignore-unknown is set, unknown metrics should be tracked but not cause fatal errors (similar to pmstat behavior)

Actual behavior:
pmrep exits with error even when --ignore-unknown is set:

$ pmrep --ignore-unknown :vmstat
Invalid metric swap.used (PM_ERR_PMID Unknown or illegal metric identifier).

Root cause:
Three exception handlers in pmconfig.py (lines 644-648, 816-818, 1070-1075) don't check ignore_unknown_metrics() before calling sys.exit(1)

Solution:
Add per-metric failure tracking and check ignore_unknown_metrics() at all three exception points

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions