Problem/Motivation

The AI Usage Log at /admin/reports/ai-metering/log shows every recorded operation with no way to narrow the list. Finding records for a specific provider or model requires scrolling the full log or exporting and filtering offline.

Steps to reproduce

  1. Navigate to /admin/reports/ai-metering/log.
  2. Try to filter by provider or model.

Environment

  • Drupal version: 10.x / 11.x
  • ai_metering version: 1.0.0-alpha1
  • AI provider module + version (e.g. ai_provider_anthropic 1.x): any
  • AI feature module tested (e.g. ai_translate, ai_chatbot, ai_assistant_api, ai_summarize...): any

Proposed resolution

Add three exposed select-list filters to the ai_usage_log view: Provider, Model, and Period (combined Month/Year). Options for provider and model are populated dynamically from values already present in the log. The period filter defaults to the last 3 months.

Remaining tasks

  • Create custom Views filter plugins for provider, model, and period.
  • Register the filters in hook_views_data() and update the view config.
  • Add a kernel test per filter.

User interface changes

The usage log page gains a filter form above the table.

API changes

N/A

Data model changes

N/A

AI assistance

Issue summary drafted with AI. Reviewed and approved by @codeitwisely.

Comments

codeitwisely created an issue. See original summary.

  • 3e4b56e0 committed on 3605193-add-log-view-filters
    Issue #3605193 by codeitwisely: Add exposed filters to usage log view
    

  • e0e89b07 committed on 3605193-add-log-view-filters
    Issue #3605193: rework period filter — year + optional month, year...

  • ad011491 committed on 3605193-add-log-view-filters
    Issue #3605193: fix validateExposed() — use $form[$identifier] not $form...

  • 2aab4a9f committed on 3605193-add-log-view-filters
    Issue #3605193: fix validateExposed() — use setErrorByName() for exposed...

  • 7bacda49 committed on 3605193-add-log-view-filters
    Issue #3605193: fix period filter validation — use messenger() not...

  • 8fe89844 committed on 3605193-add-log-view-filters
    Issue #3605193: add CSS layout for exposed filters on usage log view...

  • 2ea658ac committed on 3605193-add-log-view-filters
    Issue #3605193: fix filter buttons layout — exclude actions from column...

  • 62b15927 committed on 3605193-add-log-view-filters
    Issue #3605193 by codeitwisely: Add exposed filters to the AI Usage Log...

  • 7ef183de committed on 3605193-add-log-view-filters
    Issue #3605193: remove duplicate AI Metering Reports menu link...

  • 56639ae7 committed on 3605193-add-log-view-filters
    Issue #3605193 by codeitwisely: Add exposed filters and hub link to AI...

  • 75ef46c7 committed on 3605193-add-log-view-filters
    Issue #3605193 by codeitwisely: Add exposed filters and hub link to AI...

  • 578a52eb committed on 3605193-add-log-view-filters
    Issue #3605193 by codeitwisely: Add exposed filters and hub link to AI...

  • codeitwisely committed bf7cb2c3 on 1.0.x
    Issue #3605193: Add exposed filters to usage log view (provider, model,...
codeitwisely’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.