Skip to content

Conversation

@alxtkr77
Copy link
Member

@alxtkr77 alxtkr77 commented Jan 6, 2026

Summary

Fixes bug where Model Monitoring App shows "Endpoints: 0" when using TimescaleDB but correctly shows endpoints with V3IO.

Root cause: count_processed_model_endpoints was querying the PREDICTIONS table, which doesn't have an application_name column, instead of METRICS and APP_RESULTS tables which have this column.

Changes Made

  • Move count_processed_model_endpoints from TimescaleDBPredictionsQueries to TimescaleDBConnector
  • Use SQL UNION to efficiently count endpoints from both METRICS and APP_RESULTS tables in a single query
  • Store _tables and _pre_aggregate_manager as instance variables in connector for cross-table operations
  • Remove unused _count_with_application_join and _count_simple methods
  • Update tests to use connector fixture directly

Testing

  • All 14 TimescaleDB aggregation tests pass
  • Tested endpoint counting with:
    • No data (returns empty dict)
    • Data in METRICS only
    • Data in APP_RESULTS only
    • Data in BOTH tables (UNION behavior - counts unique endpoints)
    • Time range filtering

Checklist

  • Code formatted with ruff format
  • Code passes ruff check linting
  • Unit tests pass
  • No secrets in diff

Reference

@alxtkr77 alxtkr77 requested a review from a team as a code owner January 6, 2026 12:28
@alxtkr77 alxtkr77 force-pushed the ML-11624-timescaledb-endpoint-count branch from 2969be0 to e33effb Compare January 6, 2026 12:34
Copy link
Member

@Eyal-Danieli Eyal-Danieli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 2 small comments

# Build application filter and params
app_filter_metrics = ""
app_filter_results = ""
params: list = []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
params: list = []

self,
start: Optional[datetime.datetime] = None,
end: Optional[datetime.datetime] = None,
application_names: Optional[list[str]] = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in L448 you check if application_names is str (and if so convert it to a list) so please adjust the type annotation accordingly

Suggested change
application_names: Optional[list[str]] = None,
application_names: Optional[list[str] | str] = None,,

…bles (ML-11624)

Model Monitoring App was showing "Endpoints: 0" when using TimescaleDB but
correctly showed endpoints when using V3IO. The root cause was that
count_processed_model_endpoints was querying the PREDICTIONS table, which
doesn't have an application_name column, instead of METRICS and APP_RESULTS
tables which do have this column.

Changes:
- Move count_processed_model_endpoints from TimescaleDBPredictionsQueries
  to TimescaleDBConnector
- Use SQL UNION to efficiently count endpoints from both METRICS and
  APP_RESULTS tables in a single query
- Store _tables and _pre_aggregate_manager as instance variables in
  connector for cross-table operations
- Remove unused _count_with_application_join and _count_simple methods
- Update tests to use connector fixture directly

Reference: ML-11624
@alxtkr77 alxtkr77 force-pushed the ML-11624-timescaledb-endpoint-count branch from e33effb to f67ad32 Compare January 11, 2026 14:48
@assaf758 assaf758 merged commit 5828b80 into mlrun:development Jan 11, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants