def get_rules_for(app_name: str, rule_groups: list) -> list:
    """Find rule group for a specific application.

    Prometheus charm creates a rule group for each related scrape
    target. This method finds the rule group for one specific
    application.

    Args:
        app_name: string name of scrape target application
        rule_groups: list of Prometheus rule groups

    Returns:
        a dictionary (possibly empty) representing the rule group
    """
    groups = []
    for group in rule_groups:
        if app_name in group["name"]:
            groups.append(group)
    return groups