dotCMS / core

Headless/Hybrid Content Management System for Enterprises

Home Page:http://dotcms.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Telemetry/Metrics Query to Pull Time series for all metrics

john-thomas-dotcms opened this issue · comments

Use Case

As a business user, I need to be able to see a report of how a customer's use of each feature has changed over time.

Details

We currently have a query which allows us to get a time series for a single metric over time. But this means that in order to run a full report on all metrics for a single customer/environment, we would need to perform many different queries (currently about 20, but in the future it could be over 100).

We need a single query which, specifies a single client_env in the WHERE clause, and returns results where:

  • Each row represents a timestamp
  • Each column represents a single metric collected by the telemetry feature

Notes

  • It doesn't matter whether this is done via a direct query or a view.
  • I'm not sure if we'll need to specify each column in the query.
    • But if it's possible to write the query or create a view that includes all metrics automatically, that would be ideal.

Acceptance Criteria

  • Query against the prod telemetry DB for client_env='auth' and client_env='prod' returns valid results for all metrics, for all time (in the DB).
  • A WHERE clause can be added to the same query to limit the results to a specific date range.
  • Query takes no more than 30 seconds to run against a fairly full DB.

I created a new view called 'time_series_all_metrics_view', so if you want to get all the metrics for a specific client you need to:

select * from time_series_all_metrics_view where client_name = 'corpsites' and client_env = 'prod'

also you canuse the client_category on the filtering

IQA passed.