diff --git a/.env_file b/.env_file index 15b7a209a..6295e4946 100644 --- a/.env_file +++ b/.env_file @@ -19,4 +19,5 @@ CLICKHOUSE_USER=username CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1 CLICKHOUSE_PASSWORD=pass SUPERSET_USERNAME=superset -SUPERSET_PASSWORD=superset \ No newline at end of file +SUPERSET_PASSWORD=superset +SUPERSET_METADATA_PORT=5433 \ No newline at end of file diff --git a/.github/workflows/update_dashboard.yml b/.github/workflows/update_dashboard.yml index c06e145aa..72042885f 100644 --- a/.github/workflows/update_dashboard.yml +++ b/.github/workflows/update_dashboard.yml @@ -5,8 +5,8 @@ on: branches: - 'master' paths: - - 'dff/utils/docker/dockerfile_stats' - - 'dff/utils/docker/entrypoint_stats.sh' + - 'dff/utils/docker/**' + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/dff/config/superset_dashboard/charts/Current_topic_slot_bar_chart_4.yaml b/dff/config/superset_dashboard/charts/Current_topic_slot_bar_chart_4.yaml new file mode 100644 index 000000000..57deb8a71 --- /dev/null +++ b/dff/config/superset_dashboard/charts/Current_topic_slot_bar_chart_4.yaml @@ -0,0 +1,72 @@ +slice_name: Current topic slot [bar chart] +description: null +certified_by: null +certification_details: null +viz_type: dist_bar +params: + datasource: 3__table + viz_type: dist_bar + slice_id: 6 + granularity_sqla: start_time + time_range: No filter + metrics: + - count + adhoc_filters: + - clause: WHERE + comparator: get_slots + datasourceWarning: false + expressionType: SIMPLE + filterOptionName: filter_sz14lhn7d1d_c0zqn5dpgk + isExtra: false + isNew: false + operator: == + operatorId: EQUALS + sqlExpression: null + subject: data_key + - clause: WHERE + comparator: null + datasourceWarning: false + expressionType: SQL + filterOptionName: filter_945dhn41x2m_sci7gkxy7o + isExtra: false + isNew: false + operator: null + sqlExpression: JSON_VALUE(data, '$.current_topic') <> '' + subject: null + groupby: + - request_id + columns: + - expressionType: SQL + label: My column + sqlExpression: JSON_VALUE(data, '$.current_topic') + datasourceWarning: false + row_limit: 10000 + order_desc: true + color_scheme: echarts4Colors + show_legend: true + rich_tooltip: true + bar_stacked: true + order_bars: false + y_axis_format: SMART_NUMBER + y_axis_label: Topic counts + y_axis_bounds: + - null + - null + x_axis_label: Dialog turn + bottom_margin: auto + x_ticks_layout: auto + extra_form_data: {} + dashboards: + - 1 +query_context: '{"datasource":{"id":3,"type":"table"},"force":false,"queries":[{"time_range":"No + filter","granularity":"start_time","filters":[{"col":"data_key","op":"==","val":"get_slots"}],"extras":{"having":"","where":"(JSON_VALUE(data, + ''$.current_topic'') <> '''')"},"applied_time_extras":{},"columns":["request_id",{"expressionType":"SQL","label":"My + column","sqlExpression":"JSON_VALUE(data, ''$.current_topic'')","datasourceWarning":false}],"metrics":["count"],"annotation_layers":[],"row_limit":10000,"series_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{}}],"form_data":{"datasource":"3__table","viz_type":"dist_bar","slice_id":6,"granularity_sqla":"start_time","time_range":"No + filter","metrics":["count"],"adhoc_filters":[{"clause":"WHERE","comparator":"get_slots","datasourceWarning":false,"expressionType":"SIMPLE","filterOptionName":"filter_sz14lhn7d1d_c0zqn5dpgk","isExtra":false,"isNew":false,"operator":"==","operatorId":"EQUALS","sqlExpression":null,"subject":"data_key"},{"clause":"WHERE","comparator":null,"datasourceWarning":false,"expressionType":"SQL","filterOptionName":"filter_945dhn41x2m_sci7gkxy7o","isExtra":false,"isNew":false,"operator":null,"sqlExpression":"JSON_VALUE(data, + ''$.current_topic'') <> ''''","subject":null}],"groupby":["request_id"],"columns":[{"expressionType":"SQL","label":"My + column","sqlExpression":"JSON_VALUE(data, ''$.current_topic'')","datasourceWarning":false}],"row_limit":10000,"order_desc":true,"color_scheme":"echarts4Colors","show_legend":true,"rich_tooltip":true,"bar_stacked":true,"order_bars":false,"y_axis_format":"SMART_NUMBER","y_axis_label":"Topic + counts","y_axis_bounds":[null,null],"x_axis_label":"Dialog turn","bottom_margin":"auto","x_ticks_layout":"auto","extra_form_data":{},"dashboards":[1],"force":false,"result_format":"json","result_type":"full"},"result_format":"json","result_type":"full"}' +cache_timeout: null +uuid: a70c05d0-770b-4068-a55d-934283f5b1bb +version: 1.0.0 +dataset_uuid: 8ba2e188-2bf8-4809-a5ee-2477a539d493 diff --git a/dff/config/superset_dashboard/charts/Current_topic_time_series_bar_chart_2.yaml b/dff/config/superset_dashboard/charts/Current_topic_time_series_bar_chart_2.yaml new file mode 100644 index 000000000..26ad821d3 --- /dev/null +++ b/dff/config/superset_dashboard/charts/Current_topic_time_series_bar_chart_2.yaml @@ -0,0 +1,86 @@ +slice_name: Current topic [time series bar chart] +description: null +certified_by: null +certification_details: null +viz_type: echarts_timeseries_bar +params: + datasource: 3__table + viz_type: echarts_timeseries_bar + slice_id: 10 + granularity_sqla: start_time + time_grain_sqla: PT1M + time_range: No filter + metrics: + - count + groupby: + - datasourceWarning: false + expressionType: SQL + label: context_id + sqlExpression: JSON_VALUE(data, '$.current_topic') + adhoc_filters: + - clause: WHERE + comparator: get_slots + datasourceWarning: false + expressionType: SIMPLE + filterOptionName: filter_8tft5fr07ea_urtdezftgn + isExtra: false + isNew: false + operator: == + operatorId: EQUALS + sqlExpression: null + subject: data_key + - clause: WHERE + comparator: null + datasourceWarning: false + expressionType: SQL + filterOptionName: filter_4ffdpny1zzm_vmlo11yw7i + isExtra: false + isNew: false + operator: null + sqlExpression: JSON_VALUE(data, '$.current_topic') <> '' + subject: null + order_desc: true + row_limit: 10000 + truncate_metric: true + show_empty_columns: true + comparison_type: values + annotation_layers: [] + forecastPeriods: 10 + forecastInterval: 0.8 + orientation: vertical + x_axis_title: Time axis + x_axis_title_margin: 30 + y_axis_title: Value counts over time + y_axis_title_margin: 30 + y_axis_title_position: Left + color_scheme: echarts4Colors + show_value: false + stack: true + only_total: true + show_legend: true + legendType: scroll + legendOrientation: top + x_axis_time_format: smart_date + y_axis_format: SMART_NUMBER + y_axis_bounds: + - null + - null + rich_tooltip: true + tooltipSortByMetric: true + tooltipTimeFormat: smart_date + extra_form_data: {} + dashboards: + - 1 +query_context: '{"datasource":{"id":3,"type":"table"},"force":false,"queries":[{"time_range":"No + filter","granularity":"start_time","filters":[{"col":"data_key","op":"==","val":"get_slots"}],"extras":{"time_grain_sqla":"PT1M","having":"","where":"(JSON_VALUE(data, + ''$.current_topic'') <> '''')"},"applied_time_extras":{},"columns":[{"datasourceWarning":false,"expressionType":"SQL","label":"context_id","sqlExpression":"JSON_VALUE(data, + ''$.current_topic'')"}],"metrics":["count"],"orderby":[["count",false]],"annotation_layers":[],"row_limit":10000,"series_columns":[{"datasourceWarning":false,"expressionType":"SQL","label":"context_id","sqlExpression":"JSON_VALUE(data, + ''$.current_topic'')"}],"series_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{},"is_timeseries":true,"time_offsets":[],"post_processing":[{"operation":"pivot","options":{"index":["__timestamp"],"columns":["context_id"],"aggregates":{"count":{"operator":"mean"}},"drop_missing_columns":false}},{"operation":"rename","options":{"columns":{"count":null},"level":0,"inplace":true}},{"operation":"flatten"}]}],"form_data":{"datasource":"3__table","viz_type":"echarts_timeseries_bar","slice_id":10,"granularity_sqla":"start_time","time_grain_sqla":"PT1M","time_range":"No + filter","metrics":["count"],"groupby":[{"datasourceWarning":false,"expressionType":"SQL","label":"context_id","sqlExpression":"JSON_VALUE(data, + ''$.current_topic'')"}],"adhoc_filters":[{"clause":"WHERE","comparator":"get_slots","datasourceWarning":false,"expressionType":"SIMPLE","filterOptionName":"filter_8tft5fr07ea_urtdezftgn","isExtra":false,"isNew":false,"operator":"==","operatorId":"EQUALS","sqlExpression":null,"subject":"data_key"},{"clause":"WHERE","comparator":null,"datasourceWarning":false,"expressionType":"SQL","filterOptionName":"filter_4ffdpny1zzm_vmlo11yw7i","isExtra":false,"isNew":false,"operator":null,"sqlExpression":"JSON_VALUE(data, + ''$.current_topic'') <> ''''","subject":null}],"order_desc":true,"row_limit":10000,"truncate_metric":true,"show_empty_columns":true,"comparison_type":"values","annotation_layers":[],"forecastPeriods":10,"forecastInterval":0.8,"orientation":"vertical","x_axis_title":"Time + axis","x_axis_title_margin":30,"y_axis_title":"Value counts over time","y_axis_title_margin":30,"y_axis_title_position":"Left","color_scheme":"echarts4Colors","show_value":false,"stack":true,"only_total":true,"show_legend":true,"legendType":"scroll","legendOrientation":"top","x_axis_time_format":"smart_date","y_axis_format":"SMART_NUMBER","y_axis_bounds":[null,null],"rich_tooltip":true,"tooltipSortByMetric":true,"tooltipTimeFormat":"smart_date","extra_form_data":{},"dashboards":[1],"force":false,"result_format":"json","result_type":"full"},"result_format":"json","result_type":"full"}' +cache_timeout: null +uuid: f8215b4d-cdaf-489a-90b2-040da840ab35 +version: 1.0.0 +dataset_uuid: 8ba2e188-2bf8-4809-a5ee-2477a539d493 diff --git a/dff/config/superset_dashboard/charts/Flow_visit_ratio_monitor_1.yaml b/dff/config/superset_dashboard/charts/Flow_visit_ratio_monitor_1.yaml deleted file mode 100644 index 4fb4c2124..000000000 --- a/dff/config/superset_dashboard/charts/Flow_visit_ratio_monitor_1.yaml +++ /dev/null @@ -1,78 +0,0 @@ -slice_name: Flow visit ratio monitor -description: null -certified_by: null -certification_details: null -viz_type: echarts_timeseries_bar -params: - datasource: 2__table - viz_type: echarts_timeseries_bar - slice_id: 1 - granularity_sqla: start_time - time_grain_sqla: null - time_range: No filter - metrics: - - aggregate: COUNT - column: - advanced_data_type: null - certification_details: null - certified_by: null - column_name: context_id - description: null - expression: null - filterable: true - groupby: true - id: 1 - is_certified: false - is_dttm: false - python_date_format: null - type: STRING - type_generic: 1 - verbose_name: null - warning_markdown: null - expressionType: SIMPLE - hasCustomLabel: false - isNew: false - label: COUNT(context_id) - optionName: metric_waxxrrnkwwm_zudaex5z8bh - sqlExpression: null - groupby: - - flow_label - contributionMode: column - adhoc_filters: [] - order_desc: true - row_limit: 10000 - truncate_metric: true - show_empty_columns: true - comparison_type: values - annotation_layers: [] - forecastPeriods: 10 - forecastInterval: 0.8 - orientation: vertical - x_axis_title_margin: 15 - y_axis_title: '' - y_axis_title_margin: 50 - y_axis_title_position: Left - color_scheme: supersetColors - stack: true - only_total: true - zoomable: true - show_legend: true - legendType: scroll - legendOrientation: top - x_axis_time_format: smart_date - y_axis_format: SMART_NUMBER - y_axis_bounds: - - null - - null - rich_tooltip: true - tooltipTimeFormat: smart_date - extra_form_data: {} - dashboards: - - 1 -query_context: '{"datasource":{"id":2,"type":"table"},"force":false,"queries":[{"time_range":"No - filter","granularity":"start_time","filters":[],"extras":{"time_grain_sqla":null,"having":"","where":""},"applied_time_extras":{},"columns":["flow_label"],"metrics":[{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_waxxrrnkwwm_zudaex5z8bh","sqlExpression":null}],"orderby":[[{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_waxxrrnkwwm_zudaex5z8bh","sqlExpression":null},false]],"annotation_layers":[],"row_limit":10000,"series_columns":["flow_label"],"series_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{},"is_timeseries":true,"time_offsets":[],"post_processing":[{"operation":"pivot","options":{"index":["__timestamp"],"columns":["flow_label"],"aggregates":{"COUNT(context_id)":{"operator":"mean"}},"drop_missing_columns":false}},{"operation":"rename","options":{"columns":{"COUNT(context_id)":null},"level":0,"inplace":true}},{"operation":"contribution","options":{"orientation":"column"}},{"operation":"flatten"}]}],"form_data":{"datasource":"2__table","viz_type":"echarts_timeseries_bar","slice_id":1,"granularity_sqla":"start_time","time_grain_sqla":null,"time_range":"No - filter","metrics":[{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_waxxrrnkwwm_zudaex5z8bh","sqlExpression":null}],"groupby":["flow_label"],"contributionMode":"column","adhoc_filters":[],"order_desc":true,"row_limit":10000,"truncate_metric":true,"show_empty_columns":true,"comparison_type":"values","annotation_layers":[],"forecastPeriods":10,"forecastInterval":0.8,"orientation":"vertical","x_axis_title_margin":15,"y_axis_title":"","y_axis_title_margin":50,"y_axis_title_position":"Left","color_scheme":"supersetColors","stack":true,"only_total":true,"zoomable":true,"show_legend":true,"legendType":"scroll","legendOrientation":"top","x_axis_time_format":"smart_date","y_axis_format":"SMART_NUMBER","y_axis_bounds":[null,null],"rich_tooltip":true,"tooltipTimeFormat":"smart_date","extra_form_data":{},"dashboards":[1],"force":false,"result_format":"json","result_type":"full"},"result_format":"json","result_type":"full"}' -cache_timeout: null -uuid: ba02528b-184b-4304-b027-f2b7d9011ab0 -version: 1.0.0 -dataset_uuid: fda98ab8-f550-45f1-9ded-0113f3e67260 diff --git a/dff/config/superset_dashboard/charts/Flow_visit_ratio_monitor_13.yaml b/dff/config/superset_dashboard/charts/Flow_visit_ratio_monitor_13.yaml new file mode 100644 index 000000000..dfa036ee4 --- /dev/null +++ b/dff/config/superset_dashboard/charts/Flow_visit_ratio_monitor_13.yaml @@ -0,0 +1,101 @@ +slice_name: Flow visit ratio monitor +description: null +certified_by: null +certification_details: null +viz_type: echarts_timeseries_bar +params: + datasource: 2__table + viz_type: echarts_timeseries_bar + slice_id: 13 + granularity_sqla: start_time + time_grain_sqla: PT1M + time_range: No filter + metrics: + - aggregate: COUNT + column: + advanced_data_type: null + certification_details: null + certified_by: null + column_name: context_id + description: null + expression: null + filterable: true + groupby: true + id: 1 + is_certified: false + is_dttm: false + python_date_format: null + type: STRING + type_generic: 1 + verbose_name: null + warning_markdown: null + expressionType: SIMPLE + hasCustomLabel: false + isNew: false + label: COUNT(context_id) + optionName: metric_waxxrrnkwwm_zudaex5z8bh + sqlExpression: null + groupby: + - flow_label + contributionMode: column + adhoc_filters: + - expressionType: SIMPLE + subject: data_key + operator: == + operatorId: EQUALS + comparator: get_current_label + clause: WHERE + sqlExpression: null + isExtra: false + isNew: false + datasourceWarning: false + filterOptionName: filter_xqjhabd7z8p_05dlj2lmg6ue + - expressionType: SQL + sqlExpression: label <> '' + clause: WHERE + subject: null + operator: null + comparator: null + isExtra: false + isNew: false + datasourceWarning: false + filterOptionName: filter_822k33tkrei_irkb2zdjds + order_desc: true + row_limit: 10000 + truncate_metric: true + show_empty_columns: true + comparison_type: values + annotation_layers: [] + forecastPeriods: 10 + forecastInterval: 0.8 + orientation: vertical + x_axis_title_margin: 15 + y_axis_title: '' + y_axis_title_margin: 50 + y_axis_title_position: Left + color_scheme: echarts4Colors + stack: true + only_total: true + zoomable: true + show_legend: true + legendType: scroll + legendOrientation: top + x_axis_time_format: smart_date + y_axis_format: SMART_NUMBER + y_axis_bounds: + - null + - null + rich_tooltip: true + tooltipTimeFormat: smart_date + extra_form_data: {} + dashboards: + - 1 +query_context: '{"datasource":{"id":2,"type":"table"},"force":false,"queries":[{"time_range":"DATEADD(DATETIME(\"now\"), + -1, day) : now","granularity":"start_time","filters":[{"col":"data_key","op":"==","val":"get_current_label"}],"extras":{"time_grain_sqla":"PT1M","having":"","where":"(label + <> '''')"},"applied_time_extras":{},"columns":["flow_label"],"metrics":[{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_waxxrrnkwwm_zudaex5z8bh","sqlExpression":null}],"orderby":[[{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_waxxrrnkwwm_zudaex5z8bh","sqlExpression":null},false]],"annotation_layers":[],"row_limit":10000,"series_columns":["flow_label"],"series_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{},"is_timeseries":true,"time_offsets":[],"post_processing":[{"operation":"pivot","options":{"index":["__timestamp"],"columns":["flow_label"],"aggregates":{"COUNT(context_id)":{"operator":"mean"}},"drop_missing_columns":false}},{"operation":"rename","options":{"columns":{"COUNT(context_id)":null},"level":0,"inplace":true}},{"operation":"contribution","options":{"orientation":"column"}},{"operation":"flatten"}]}],"form_data":{"datasource":"2__table","viz_type":"echarts_timeseries_bar","slice_id":13,"granularity_sqla":"start_time","time_grain_sqla":"PT1M","time_range":"DATEADD(DATETIME(\"now\"), + -1, day) : now","metrics":[{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_waxxrrnkwwm_zudaex5z8bh","sqlExpression":null}],"groupby":["flow_label"],"contributionMode":"column","adhoc_filters":[{"expressionType":"SIMPLE","subject":"data_key","operator":"==","operatorId":"EQUALS","comparator":"get_current_label","clause":"WHERE","sqlExpression":null,"isExtra":false,"isNew":false,"datasourceWarning":false,"filterOptionName":"filter_xqjhabd7z8p_05dlj2lmg6ue"},{"expressionType":"SQL","sqlExpression":"label + <> ''''","clause":"WHERE","subject":null,"operator":null,"comparator":null,"isExtra":false,"isNew":false,"datasourceWarning":false,"filterOptionName":"filter_822k33tkrei_irkb2zdjds"}],"order_desc":true,"row_limit":10000,"truncate_metric":true,"show_empty_columns":true,"comparison_type":"values","annotation_layers":[],"forecastPeriods":10,"forecastInterval":0.8,"orientation":"vertical","x_axis_title_margin":15,"y_axis_title":"","y_axis_title_margin":50,"y_axis_title_position":"Left","color_scheme":"echarts4Colors","stack":true,"only_total":true,"zoomable":true,"show_legend":true,"legendType":"scroll","legendOrientation":"top","x_axis_time_format":"smart_date","y_axis_format":"SMART_NUMBER","y_axis_bounds":[null,null],"rich_tooltip":true,"tooltipTimeFormat":"smart_date","extra_form_data":{},"dashboards":[1],"force":false,"result_format":"json","result_type":"full"},"result_format":"json","result_type":"full"}' +cache_timeout: null +uuid: ba02528b-184b-4304-b027-f2b7d9011ab0 +version: 1.0.0 +dataset_uuid: fda98ab8-f550-45f1-9ded-0113f3e67260 diff --git a/dff/config/superset_dashboard/charts/Node_Visits_2.yaml b/dff/config/superset_dashboard/charts/Node_Visits_2.yaml deleted file mode 100644 index 802288e28..000000000 --- a/dff/config/superset_dashboard/charts/Node_Visits_2.yaml +++ /dev/null @@ -1,59 +0,0 @@ -slice_name: Node Visits -description: null -certified_by: null -certification_details: null -viz_type: dist_bar -params: - adhoc_filters: [] - bottom_margin: auto - color_scheme: supersetColors - columns: - - label - datasource: 3__table - extra_form_data: {} - granularity_sqla: start_time - groupby: - - request_id - metrics: - - aggregate: COUNT - column: - advanced_data_type: null - certification_details: null - certified_by: null - column_name: context_id - description: null - expression: null - filterable: true - groupby: true - id: 20 - is_certified: false - is_dttm: false - python_date_format: null - type: STRING - type_generic: 1 - verbose_name: null - warning_markdown: null - expressionType: SIMPLE - hasCustomLabel: false - isNew: false - label: COUNT(context_id) - optionName: metric_l2mle87zvnb_nfqzdxmig1d - sqlExpression: null - order_desc: true - rich_tooltip: true - row_limit: 10000 - show_legend: true - time_range: No filter - viz_type: dist_bar - x_axis_label: History id - x_ticks_layout: auto - y_axis_bounds: - - null - - null - y_axis_format: SMART_NUMBER - y_axis_label: Node visits -query_context: null -cache_timeout: null -uuid: 44f4ab9d-5072-4926-a6ed-8615fb81b3d0 -version: 1.0.0 -dataset_uuid: fda98ab8-f550-45f1-9ded-0113f3e67260 diff --git a/dff/config/superset_dashboard/charts/Node_Visits_7.yaml b/dff/config/superset_dashboard/charts/Node_Visits_7.yaml new file mode 100644 index 000000000..a0485c738 --- /dev/null +++ b/dff/config/superset_dashboard/charts/Node_Visits_7.yaml @@ -0,0 +1,89 @@ +slice_name: Node Visits +description: null +certified_by: null +certification_details: null +viz_type: dist_bar +params: + datasource: 2__table + viz_type: dist_bar + slice_id: 6 + granularity_sqla: start_time + time_range: No filter + metrics: + - aggregate: COUNT + column: + advanced_data_type: null + certification_details: null + certified_by: null + column_name: context_id + description: null + expression: null + filterable: true + groupby: true + id: 20 + is_certified: false + is_dttm: false + python_date_format: null + type: STRING + type_generic: 1 + verbose_name: null + warning_markdown: null + expressionType: SIMPLE + hasCustomLabel: false + isNew: false + label: COUNT(context_id) + optionName: metric_l2mle87zvnb_nfqzdxmig1d + sqlExpression: null + adhoc_filters: + - expressionType: SIMPLE + subject: data_key + operator: == + operatorId: EQUALS + comparator: get_current_label + clause: WHERE + sqlExpression: null + isExtra: false + isNew: false + datasourceWarning: false + filterOptionName: filter_jejo4gd8be_f4ygcxhh98w + - expressionType: SQL + sqlExpression: label <> '' + clause: WHERE + subject: null + operator: null + comparator: null + isExtra: false + isNew: false + datasourceWarning: false + filterOptionName: filter_wa9z5rxxr2_b9ez0nkk5le + groupby: + - request_id + columns: + - label + row_limit: 10000 + order_desc: true + color_scheme: echarts4Colors + show_legend: true + rich_tooltip: true + bar_stacked: true + y_axis_format: SMART_NUMBER + y_axis_label: Node visits + y_axis_bounds: + - null + - null + x_axis_label: Dialog turn + bottom_margin: auto + x_ticks_layout: auto + extra_form_data: {} + dashboards: + - 1 +query_context: '{"datasource":{"id":2,"type":"table"},"force":false,"queries":[{"time_range":"No + filter","granularity":"start_time","filters":[{"col":"data_key","op":"==","val":"get_current_label"}],"extras":{"having":"","where":"(label + <> '''')"},"applied_time_extras":{},"columns":["request_id","label"],"metrics":[{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":20,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_l2mle87zvnb_nfqzdxmig1d","sqlExpression":null}],"annotation_layers":[],"row_limit":10000,"series_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{}}],"form_data":{"datasource":"2__table","viz_type":"dist_bar","slice_id":6,"granularity_sqla":"start_time","time_range":"No + filter","metrics":[{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":20,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_l2mle87zvnb_nfqzdxmig1d","sqlExpression":null}],"adhoc_filters":[{"expressionType":"SIMPLE","subject":"data_key","operator":"==","operatorId":"EQUALS","comparator":"get_current_label","clause":"WHERE","sqlExpression":null,"isExtra":false,"isNew":false,"datasourceWarning":false,"filterOptionName":"filter_jejo4gd8be_f4ygcxhh98w"},{"expressionType":"SQL","sqlExpression":"label + <> ''''","clause":"WHERE","subject":null,"operator":null,"comparator":null,"isExtra":false,"isNew":false,"datasourceWarning":false,"filterOptionName":"filter_wa9z5rxxr2_b9ez0nkk5le"}],"groupby":["request_id"],"columns":["label"],"row_limit":10000,"order_desc":true,"color_scheme":"echarts4Colors","show_legend":true,"rich_tooltip":true,"bar_stacked":true,"y_axis_format":"SMART_NUMBER","y_axis_label":"Node + visits","y_axis_bounds":[null,null],"x_axis_label":"Dialog turn","bottom_margin":"auto","x_ticks_layout":"auto","extra_form_data":{},"dashboards":[1],"force":false,"result_format":"json","result_type":"full"},"result_format":"json","result_type":"full"}' +cache_timeout: null +uuid: 44f4ab9d-5072-4926-a6ed-8615fb81b3d0 +version: 1.0.0 +dataset_uuid: fda98ab8-f550-45f1-9ded-0113f3e67260 diff --git a/dff/config/superset_dashboard/charts/Node_counts_3.yaml b/dff/config/superset_dashboard/charts/Node_counts_3.yaml index 8cf476c2f..5d568c3de 100644 --- a/dff/config/superset_dashboard/charts/Node_counts_3.yaml +++ b/dff/config/superset_dashboard/charts/Node_counts_3.yaml @@ -4,17 +4,11 @@ certified_by: null certification_details: null viz_type: dist_bar params: - adhoc_filters: [] - bar_stacked: true - bottom_margin: auto - color_scheme: supersetColors - columns: - - flow_label - datasource: 1__table - extra_form_data: {} + datasource: 2__table + viz_type: dist_bar + slice_id: 9 granularity_sqla: start_time - groupby: - - label + time_range: No filter metrics: - aggregate: COUNT_DISTINCT column: @@ -40,19 +34,53 @@ params: label: COUNT_DISTINCT(context_id) optionName: metric_axee7fzlpu_upud0bdjv6 sqlExpression: null - order_bars: true - order_desc: true - rich_tooltip: true + adhoc_filters: + - expressionType: SIMPLE + subject: data_key + operator: == + operatorId: EQUALS + comparator: get_current_label + clause: WHERE + sqlExpression: null + isExtra: false + isNew: false + datasourceWarning: false + filterOptionName: filter_vhz5xz5fww_dgbx6adq7e + - expressionType: SQL + sqlExpression: label <> '' + clause: WHERE + subject: null + operator: null + comparator: null + isExtra: false + isNew: false + datasourceWarning: false + filterOptionName: filter_s3zhicnn9x_9xljjdrli2 + groupby: + - label + columns: + - flow_label row_limit: 10000 + order_desc: true + color_scheme: echarts4Colors show_legend: true - time_range: No filter - viz_type: dist_bar - x_ticks_layout: auto + rich_tooltip: true + bar_stacked: true + order_bars: true + y_axis_format: SMART_NUMBER y_axis_bounds: - null - null - y_axis_format: SMART_NUMBER -query_context: null + bottom_margin: auto + x_ticks_layout: auto + extra_form_data: {} + dashboards: + - 1 +query_context: '{"datasource":{"id":2,"type":"table"},"force":false,"queries":[{"time_range":"No + filter","granularity":"start_time","filters":[{"col":"data_key","op":"==","val":"get_current_label"}],"extras":{"having":"","where":"(label + <> '''')"},"applied_time_extras":{},"columns":["label","flow_label"],"metrics":[{"aggregate":"COUNT_DISTINCT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT_DISTINCT(context_id)","optionName":"metric_axee7fzlpu_upud0bdjv6","sqlExpression":null}],"annotation_layers":[],"row_limit":10000,"series_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{}}],"form_data":{"datasource":"2__table","viz_type":"dist_bar","slice_id":9,"granularity_sqla":"start_time","time_range":"No + filter","metrics":[{"aggregate":"COUNT_DISTINCT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT_DISTINCT(context_id)","optionName":"metric_axee7fzlpu_upud0bdjv6","sqlExpression":null}],"adhoc_filters":[{"expressionType":"SIMPLE","subject":"data_key","operator":"==","operatorId":"EQUALS","comparator":"get_current_label","clause":"WHERE","sqlExpression":null,"isExtra":false,"isNew":false,"datasourceWarning":false,"filterOptionName":"filter_vhz5xz5fww_dgbx6adq7e"},{"expressionType":"SQL","sqlExpression":"label + <> ''''","clause":"WHERE","subject":null,"operator":null,"comparator":null,"isExtra":false,"isNew":false,"datasourceWarning":false,"filterOptionName":"filter_s3zhicnn9x_9xljjdrli2"}],"groupby":["label"],"columns":["flow_label"],"row_limit":10000,"order_desc":true,"color_scheme":"echarts4Colors","show_legend":true,"rich_tooltip":true,"bar_stacked":true,"order_bars":true,"y_axis_format":"SMART_NUMBER","y_axis_bounds":[null,null],"bottom_margin":"auto","x_ticks_layout":"auto","extra_form_data":{},"dashboards":[1],"force":false,"result_format":"json","result_type":"full"},"result_format":"json","result_type":"full"}' cache_timeout: null uuid: 0c47c7b5-f500-46cb-97e3-9ebb637f0c8a version: 1.0.0 diff --git a/dff/config/superset_dashboard/charts/Node_visit_ratio_monitor_4.yaml b/dff/config/superset_dashboard/charts/Node_visit_ratio_monitor_4.yaml deleted file mode 100644 index 93c1bf239..000000000 --- a/dff/config/superset_dashboard/charts/Node_visit_ratio_monitor_4.yaml +++ /dev/null @@ -1,86 +0,0 @@ -slice_name: Node visit ratio monitor -description: null -certified_by: null -certification_details: null -viz_type: echarts_timeseries_bar -params: - datasource: 2__table - viz_type: echarts_timeseries_bar - slice_id: 4 - granularity_sqla: start_time - time_grain_sqla: null - time_range: No filter - metrics: - - aggregate: COUNT - column: - advanced_data_type: null - certification_details: null - certified_by: null - column_name: context_id - description: null - expression: null - filterable: true - groupby: true - id: 1 - is_certified: false - is_dttm: false - python_date_format: null - type: STRING - type_generic: 1 - verbose_name: null - warning_markdown: null - expressionType: SIMPLE - hasCustomLabel: false - isNew: false - label: COUNT(context_id) - optionName: metric_9yefk3wj2g_5wbp61n0pyr - sqlExpression: null - groupby: - - flow_label - - node_label - contributionMode: column - adhoc_filters: [] - order_desc: true - row_limit: 10000 - truncate_metric: true - show_empty_columns: true - comparison_type: values - annotation_layers: [] - forecastPeriods: 10 - forecastInterval: 0.8 - orientation: vertical - x_axis_title: Datetime - x_axis_title_margin: 30 - y_axis_title: Node visit ratio - y_axis_title_margin: 50 - y_axis_title_position: Left - color_scheme: supersetColors - stack: true - only_total: true - zoomable: true - show_legend: true - legendType: scroll - legendOrientation: top - x_axis_time_format: smart_date - xAxisLabelRotation: 45 - y_axis_format: SMART_NUMBER - logAxis: false - minorSplitLine: false - truncateYAxis: false - y_axis_bounds: - - null - - null - rich_tooltip: true - tooltipSortByMetric: true - tooltipTimeFormat: smart_date - extra_form_data: {} - dashboards: - - 1 -query_context: '{"datasource":{"id":2,"type":"table"},"force":false,"queries":[{"time_range":"No - filter","granularity":"start_time","filters":[],"extras":{"time_grain_sqla":null,"having":"","where":""},"applied_time_extras":{},"columns":["flow_label","node_label"],"metrics":[{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_9yefk3wj2g_5wbp61n0pyr","sqlExpression":null}],"orderby":[[{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_9yefk3wj2g_5wbp61n0pyr","sqlExpression":null},false]],"annotation_layers":[],"row_limit":10000,"series_columns":["flow_label","node_label"],"series_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{},"is_timeseries":true,"time_offsets":[],"post_processing":[{"operation":"pivot","options":{"index":["__timestamp"],"columns":["flow_label","node_label"],"aggregates":{"COUNT(context_id)":{"operator":"mean"}},"drop_missing_columns":false}},{"operation":"rename","options":{"columns":{"COUNT(context_id)":null},"level":0,"inplace":true}},{"operation":"contribution","options":{"orientation":"column"}},{"operation":"flatten"}]}],"form_data":{"datasource":"2__table","viz_type":"echarts_timeseries_bar","slice_id":4,"granularity_sqla":"start_time","time_grain_sqla":null,"time_range":"No - filter","metrics":[{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_9yefk3wj2g_5wbp61n0pyr","sqlExpression":null}],"groupby":["flow_label","node_label"],"contributionMode":"column","adhoc_filters":[],"order_desc":true,"row_limit":10000,"truncate_metric":true,"show_empty_columns":true,"comparison_type":"values","annotation_layers":[],"forecastPeriods":10,"forecastInterval":0.8,"orientation":"vertical","x_axis_title":"Datetime","x_axis_title_margin":30,"y_axis_title":"Node - visit ratio","y_axis_title_margin":50,"y_axis_title_position":"Left","color_scheme":"supersetColors","stack":true,"only_total":true,"zoomable":true,"show_legend":true,"legendType":"scroll","legendOrientation":"top","x_axis_time_format":"smart_date","xAxisLabelRotation":45,"y_axis_format":"SMART_NUMBER","logAxis":false,"minorSplitLine":false,"truncateYAxis":false,"y_axis_bounds":[null,null],"rich_tooltip":true,"tooltipSortByMetric":true,"tooltipTimeFormat":"smart_date","extra_form_data":{},"dashboards":[1],"force":false,"result_format":"json","result_type":"full"},"result_format":"json","result_type":"full"}' -cache_timeout: null -uuid: 6fafe59c-0fec-4cd8-a8b3-c0bfaffb2135 -version: 1.0.0 -dataset_uuid: fda98ab8-f550-45f1-9ded-0113f3e67260 diff --git a/dff/config/superset_dashboard/charts/Node_visit_ratio_monitor_8.yaml b/dff/config/superset_dashboard/charts/Node_visit_ratio_monitor_8.yaml new file mode 100644 index 000000000..7f5852930 --- /dev/null +++ b/dff/config/superset_dashboard/charts/Node_visit_ratio_monitor_8.yaml @@ -0,0 +1,109 @@ +slice_name: Node visit ratio monitor +description: null +certified_by: null +certification_details: null +viz_type: echarts_timeseries_bar +params: + datasource: 2__table + viz_type: echarts_timeseries_bar + slice_id: 2 + granularity_sqla: start_time + time_grain_sqla: PT1M + time_range: No filter + metrics: + - aggregate: COUNT + column: + advanced_data_type: null + certification_details: null + certified_by: null + column_name: context_id + description: null + expression: null + filterable: true + groupby: true + id: 1 + is_certified: false + is_dttm: false + python_date_format: null + type: STRING + type_generic: 1 + verbose_name: null + warning_markdown: null + expressionType: SIMPLE + hasCustomLabel: false + isNew: false + label: COUNT(context_id) + optionName: metric_9yefk3wj2g_5wbp61n0pyr + sqlExpression: null + groupby: + - flow_label + - node_label + contributionMode: column + adhoc_filters: + - expressionType: SIMPLE + subject: data_key + operator: == + operatorId: EQUALS + comparator: get_current_label + clause: WHERE + sqlExpression: null + isExtra: false + isNew: false + datasourceWarning: false + filterOptionName: filter_y0hyd1ebac9_flmblpn0ymt + - expressionType: SQL + sqlExpression: label <> '' + clause: WHERE + subject: null + operator: null + comparator: null + isExtra: false + isNew: false + datasourceWarning: false + filterOptionName: filter_tjpviv3vvq_fdqstvdz39m + order_desc: true + row_limit: 10000 + truncate_metric: true + show_empty_columns: true + comparison_type: values + annotation_layers: [] + forecastPeriods: 10 + forecastInterval: 0.8 + orientation: vertical + x_axis_title: Datetime + x_axis_title_margin: 30 + y_axis_title: Node visit ratio + y_axis_title_margin: 50 + y_axis_title_position: Left + color_scheme: echarts4Colors + stack: true + only_total: true + zoomable: true + show_legend: true + legendType: scroll + legendOrientation: top + x_axis_time_format: smart_date + xAxisLabelRotation: 45 + y_axis_format: SMART_NUMBER + logAxis: false + minorSplitLine: false + truncateYAxis: false + y_axis_bounds: + - null + - null + rich_tooltip: true + tooltipSortByMetric: true + tooltipTimeFormat: smart_date + extra_form_data: {} + dashboards: + - 1 +query_context: '{"datasource":{"id":2,"type":"table"},"force":false,"queries":[{"time_range":"DATEADD(DATETIME(\"now\"), + -1, day) : now","granularity":"start_time","filters":[{"col":"data_key","op":"==","val":"get_current_label"}],"extras":{"time_grain_sqla":"PT1M","having":"","where":"(label + <> '''')"},"applied_time_extras":{},"columns":["flow_label","node_label"],"metrics":[{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_9yefk3wj2g_5wbp61n0pyr","sqlExpression":null}],"orderby":[[{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_9yefk3wj2g_5wbp61n0pyr","sqlExpression":null},false]],"annotation_layers":[],"row_limit":10000,"series_columns":["flow_label","node_label"],"series_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{},"is_timeseries":true,"time_offsets":[],"post_processing":[{"operation":"pivot","options":{"index":["__timestamp"],"columns":["flow_label","node_label"],"aggregates":{"COUNT(context_id)":{"operator":"mean"}},"drop_missing_columns":false}},{"operation":"rename","options":{"columns":{"COUNT(context_id)":null},"level":0,"inplace":true}},{"operation":"contribution","options":{"orientation":"column"}},{"operation":"flatten"}]}],"form_data":{"datasource":"2__table","viz_type":"echarts_timeseries_bar","slice_id":2,"granularity_sqla":"start_time","time_grain_sqla":"PT1M","time_range":"DATEADD(DATETIME(\"now\"), + -1, day) : now","metrics":[{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_9yefk3wj2g_5wbp61n0pyr","sqlExpression":null}],"groupby":["flow_label","node_label"],"contributionMode":"column","adhoc_filters":[{"expressionType":"SIMPLE","subject":"data_key","operator":"==","operatorId":"EQUALS","comparator":"get_current_label","clause":"WHERE","sqlExpression":null,"isExtra":false,"isNew":false,"datasourceWarning":false,"filterOptionName":"filter_y0hyd1ebac9_flmblpn0ymt"},{"expressionType":"SQL","sqlExpression":"label + <> ''''","clause":"WHERE","subject":null,"operator":null,"comparator":null,"isExtra":false,"isNew":false,"datasourceWarning":false,"filterOptionName":"filter_tjpviv3vvq_fdqstvdz39m"}],"order_desc":true,"row_limit":10000,"truncate_metric":true,"show_empty_columns":true,"comparison_type":"values","annotation_layers":[],"forecastPeriods":10,"forecastInterval":0.8,"orientation":"vertical","x_axis_title":"Datetime","x_axis_title_margin":30,"y_axis_title":"Node + visit ratio","y_axis_title_margin":50,"y_axis_title_position":"Left","color_scheme":"echarts4Colors","stack":true,"only_total":true,"zoomable":true,"show_legend":true,"legendType":"scroll","legendOrientation":"top","x_axis_time_format":"smart_date","xAxisLabelRotation":45,"y_axis_format":"SMART_NUMBER","logAxis":false,"minorSplitLine":false,"truncateYAxis":false,"y_axis_bounds":[null,null],"rich_tooltip":true,"tooltipSortByMetric":true,"tooltipTimeFormat":"smart_date","extra_form_data":{},"dashboards":[1],"force":false,"result_format":"json","result_type":"full"},"result_format":"json","result_type":"full"}' +cache_timeout: null +uuid: 6fafe59c-0fec-4cd8-a8b3-c0bfaffb2135 +version: 1.0.0 +dataset_uuid: fda98ab8-f550-45f1-9ded-0113f3e67260 diff --git a/dff/config/superset_dashboard/charts/Node_visits_cloud_5.yaml b/dff/config/superset_dashboard/charts/Node_visits_cloud_5.yaml deleted file mode 100644 index 334bc85c7..000000000 --- a/dff/config/superset_dashboard/charts/Node_visits_cloud_5.yaml +++ /dev/null @@ -1,48 +0,0 @@ -slice_name: Node visits [cloud] -description: null -certified_by: null -certification_details: null -viz_type: word_cloud -params: - adhoc_filters: [] - color_scheme: supersetColors - datasource: 1__table - extra_form_data: {} - granularity_sqla: start_time - metric: - aggregate: COUNT - column: - advanced_data_type: null - certification_details: null - certified_by: null - column_name: context_id - description: null - expression: null - filterable: true - groupby: true - id: 1 - is_certified: false - is_dttm: false - python_date_format: null - type: STRING - type_generic: 1 - verbose_name: null - warning_markdown: null - expressionType: SIMPLE - hasCustomLabel: false - isNew: false - label: COUNT(context_id) - optionName: metric_mmbslhy6cnd_6zv1lh26whx - sqlExpression: null - rotation: flat - row_limit: 500 - series: label - size_from: 10 - size_to: 80 - time_range: No filter - viz_type: word_cloud -query_context: null -cache_timeout: null -uuid: b25b4292-ff21-4164-98ac-b1cba95e2994 -version: 1.0.0 -dataset_uuid: fda98ab8-f550-45f1-9ded-0113f3e67260 diff --git a/dff/config/superset_dashboard/charts/Node_visits_ratio_6.yaml b/dff/config/superset_dashboard/charts/Node_visits_ratio_6.yaml index f3d71f8e9..939773692 100644 --- a/dff/config/superset_dashboard/charts/Node_visits_ratio_6.yaml +++ b/dff/config/superset_dashboard/charts/Node_visits_ratio_6.yaml @@ -4,23 +4,14 @@ certified_by: null certification_details: null viz_type: pie params: - adhoc_filters: [] - color_scheme: supersetColors - datasource: 1__table - date_format: smart_date - donut: true - extra_form_data: {} + datasource: 2__table + viz_type: pie + slice_id: 3 granularity_sqla: start_time + time_range: No filter groupby: - flow_label - node_label - innerRadius: 36 - label_line: false - label_type: key - labels_outside: true - legendMargin: 100 - legendOrientation: top - legendType: plain metric: aggregate: COUNT column: @@ -46,19 +37,54 @@ params: label: COUNT(context_id) optionName: metric_lk827d91wws_mq94n624y6 sqlExpression: null - number_format: SMART_NUMBER - outerRadius: 70 + adhoc_filters: + - expressionType: SIMPLE + subject: data_key + operator: == + operatorId: EQUALS + comparator: get_current_label + clause: WHERE + sqlExpression: null + isExtra: false + isNew: false + datasourceWarning: false + filterOptionName: filter_cikhjlv8d6v_qtfsor113yg + - expressionType: SQL + sqlExpression: label <> '' + clause: WHERE + subject: null + operator: null + comparator: null + isExtra: false + isNew: false + datasourceWarning: false + filterOptionName: filter_jnqs9l8t2wl_gn1f9vyfaeh row_limit: 100 - show_labels: true + sort_by_metric: true + color_scheme: echarts4Colors show_labels_threshold: 5 show_legend: true + legendType: plain + legendOrientation: top + legendMargin: 100 + label_type: key + number_format: SMART_NUMBER + date_format: smart_date + show_labels: true + labels_outside: true + label_line: false show_total: true - sort_by_metric: true - time_range: No filter - viz_type: pie + outerRadius: 70 + donut: true + innerRadius: 36 + extra_form_data: {} + dashboards: + - 1 query_context: '{"datasource":{"id":2,"type":"table"},"force":false,"queries":[{"time_range":"No - filter","granularity":"start_time","filters":[],"extras":{"having":"","where":""},"applied_time_extras":{},"columns":["flow_label","node_label"],"metrics":[{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_lk827d91wws_mq94n624y6","sqlExpression":null}],"orderby":[[{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_lk827d91wws_mq94n624y6","sqlExpression":null},false]],"annotation_layers":[],"row_limit":100,"series_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{}}],"form_data":{"adhoc_filters":[],"color_scheme":"supersetColors","datasource":"2__table","date_format":"smart_date","donut":true,"extra_form_data":{},"granularity_sqla":"start_time","groupby":["flow_label","node_label"],"innerRadius":36,"label_line":false,"label_type":"key","labels_outside":true,"legendMargin":100,"legendOrientation":"top","legendType":"plain","metric":{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_lk827d91wws_mq94n624y6","sqlExpression":null},"number_format":"SMART_NUMBER","outerRadius":70,"row_limit":100,"show_labels":true,"show_labels_threshold":5,"show_legend":true,"show_total":true,"slice_id":6,"sort_by_metric":true,"time_range":"No - filter","viz_type":"pie","force":false,"result_format":"json","result_type":"full"},"result_format":"json","result_type":"full"}' + filter","granularity":"start_time","filters":[{"col":"data_key","op":"==","val":"get_current_label"}],"extras":{"having":"","where":"(label + <> '''')"},"applied_time_extras":{},"columns":["flow_label","node_label"],"metrics":[{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_lk827d91wws_mq94n624y6","sqlExpression":null}],"orderby":[[{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_lk827d91wws_mq94n624y6","sqlExpression":null},false]],"annotation_layers":[],"row_limit":100,"series_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{}}],"form_data":{"datasource":"2__table","viz_type":"pie","slice_id":3,"granularity_sqla":"start_time","time_range":"No + filter","groupby":["flow_label","node_label"],"metric":{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_lk827d91wws_mq94n624y6","sqlExpression":null},"adhoc_filters":[{"expressionType":"SIMPLE","subject":"data_key","operator":"==","operatorId":"EQUALS","comparator":"get_current_label","clause":"WHERE","sqlExpression":null,"isExtra":false,"isNew":false,"datasourceWarning":false,"filterOptionName":"filter_cikhjlv8d6v_qtfsor113yg"},{"expressionType":"SQL","sqlExpression":"label + <> ''''","clause":"WHERE","subject":null,"operator":null,"comparator":null,"isExtra":false,"isNew":false,"datasourceWarning":false,"filterOptionName":"filter_jnqs9l8t2wl_gn1f9vyfaeh"}],"row_limit":100,"sort_by_metric":true,"color_scheme":"echarts4Colors","show_labels_threshold":5,"show_legend":true,"legendType":"plain","legendOrientation":"top","legendMargin":100,"label_type":"key","number_format":"SMART_NUMBER","date_format":"smart_date","show_labels":true,"labels_outside":true,"label_line":false,"show_total":true,"outerRadius":70,"donut":true,"innerRadius":36,"extra_form_data":{},"dashboards":[1],"force":false,"result_format":"json","result_type":"full"},"result_format":"json","result_type":"full"}' cache_timeout: null uuid: f9fb7893-3533-4519-bbc4-1f4853f380e1 version: 1.0.0 diff --git a/dff/config/superset_dashboard/charts/Node_visits_sunburst_5.yaml b/dff/config/superset_dashboard/charts/Node_visits_sunburst_5.yaml new file mode 100644 index 000000000..f39969b18 --- /dev/null +++ b/dff/config/superset_dashboard/charts/Node_visits_sunburst_5.yaml @@ -0,0 +1,76 @@ +slice_name: Node visits [sunburst] +description: null +certified_by: null +certification_details: null +viz_type: sunburst +params: + datasource: 2__table + viz_type: sunburst + slice_id: 10 + granularity_sqla: start_time + time_range: No filter + groupby: + - flow_label + - node_label + metric: + aggregate: COUNT + column: + advanced_data_type: null + certification_details: null + certified_by: null + column_name: context_id + description: null + expression: null + filterable: true + groupby: true + id: 1 + is_certified: false + is_dttm: false + python_date_format: null + type: STRING + type_generic: 1 + verbose_name: null + warning_markdown: null + expressionType: SIMPLE + hasCustomLabel: false + isNew: false + label: COUNT(context_id) + optionName: metric_7mo9cnw40ph_rzxhx01jm0c + sqlExpression: null + adhoc_filters: + - expressionType: SIMPLE + subject: data_key + operator: == + operatorId: EQUALS + comparator: get_current_label + clause: WHERE + sqlExpression: null + isExtra: false + isNew: false + datasourceWarning: false + filterOptionName: filter_k9appc49vwn_3maud61tywi + - expressionType: SQL + sqlExpression: label <> '' + clause: WHERE + subject: null + operator: null + comparator: null + isExtra: false + isNew: false + datasourceWarning: false + filterOptionName: filter_6s6c2atm24m_3fhzyn98hbs + row_limit: 10000 + color_scheme: echarts4Colors + linear_color_scheme: superset_seq_1 + extra_form_data: {} + dashboards: + - 1 +query_context: '{"datasource":{"id":2,"type":"table"},"force":false,"queries":[{"time_range":"No + filter","granularity":"start_time","filters":[{"col":"data_key","op":"==","val":"get_current_label"}],"extras":{"having":"","where":"(label + <> '''')"},"applied_time_extras":{},"columns":["flow_label","node_label"],"metrics":[{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_7mo9cnw40ph_rzxhx01jm0c","sqlExpression":null}],"annotation_layers":[],"row_limit":10000,"series_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{}}],"form_data":{"datasource":"2__table","viz_type":"sunburst","slice_id":10,"granularity_sqla":"start_time","time_range":"No + filter","groupby":["flow_label","node_label"],"metric":{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_7mo9cnw40ph_rzxhx01jm0c","sqlExpression":null},"adhoc_filters":[{"expressionType":"SIMPLE","subject":"data_key","operator":"==","operatorId":"EQUALS","comparator":"get_current_label","clause":"WHERE","sqlExpression":null,"isExtra":false,"isNew":false,"datasourceWarning":false,"filterOptionName":"filter_k9appc49vwn_3maud61tywi"},{"expressionType":"SQL","sqlExpression":"label + <> ''''","clause":"WHERE","subject":null,"operator":null,"comparator":null,"isExtra":false,"isNew":false,"datasourceWarning":false,"filterOptionName":"filter_6s6c2atm24m_3fhzyn98hbs"}],"row_limit":10000,"color_scheme":"echarts4Colors","linear_color_scheme":"superset_seq_1","extra_form_data":{},"dashboards":[1],"force":false,"result_format":"json","result_type":"full"},"result_format":"json","result_type":"full"}' +cache_timeout: null +uuid: e955f48c-824c-423c-a11c-5b5dca162927 +version: 1.0.0 +dataset_uuid: fda98ab8-f550-45f1-9ded-0113f3e67260 diff --git a/dff/config/superset_dashboard/charts/Node_visits_sunburst_7.yaml b/dff/config/superset_dashboard/charts/Node_visits_sunburst_7.yaml deleted file mode 100644 index b3293a635..000000000 --- a/dff/config/superset_dashboard/charts/Node_visits_sunburst_7.yaml +++ /dev/null @@ -1,69 +0,0 @@ -slice_name: Node visits [sunburst] -description: null -certified_by: null -certification_details: null -viz_type: sunburst -params: - adhoc_filters: - - clause: WHERE - comparator: null - expressionType: SIMPLE - filterOptionName: filter_82x0yx6fkpv_6h8a2190nmh - isExtra: false - isNew: false - operator: IS NOT NULL - operatorId: IS_NOT_NULL - sqlExpression: null - subject: flow_label - - clause: WHERE - comparator: null - expressionType: SIMPLE - filterOptionName: filter_653tn7jqmox_x65gwtz29gc - isExtra: false - isNew: false - operator: IS NOT NULL - operatorId: IS_NOT_NULL - sqlExpression: null - subject: node_label - color_scheme: supersetColors - datasource: 3__table - extra_form_data: {} - granularity_sqla: start_time - groupby: - - flow_label - - node_label - linear_color_scheme: superset_seq_1 - metric: - aggregate: COUNT - column: - advanced_data_type: null - certification_details: null - certified_by: null - column_name: context_id - description: null - expression: null - filterable: true - groupby: true - id: 1 - is_certified: false - is_dttm: false - python_date_format: null - type: STRING - type_generic: 1 - verbose_name: null - warning_markdown: null - expressionType: SIMPLE - hasCustomLabel: false - isNew: false - label: COUNT(context_id) - optionName: metric_7mo9cnw40ph_rzxhx01jm0c - sqlExpression: null - row_limit: 10000 - slice_id: 8 - time_range: No filter - viz_type: sunburst -query_context: null -cache_timeout: null -uuid: e955f48c-824c-423c-a11c-5b5dca162927 -version: 1.0.0 -dataset_uuid: fda98ab8-f550-45f1-9ded-0113f3e67260 diff --git a/dff/config/superset_dashboard/charts/Rating_slot_line_chart_1.yaml b/dff/config/superset_dashboard/charts/Rating_slot_line_chart_1.yaml new file mode 100644 index 000000000..3c00dc2ca --- /dev/null +++ b/dff/config/superset_dashboard/charts/Rating_slot_line_chart_1.yaml @@ -0,0 +1,92 @@ +slice_name: Rating slot [line chart] +description: null +certified_by: null +certification_details: null +viz_type: echarts_timeseries_line +params: + datasource: 3__table + viz_type: echarts_timeseries_line + slice_id: 7 + granularity_sqla: start_time + time_grain_sqla: PT1M + time_range: No filter + metrics: + - aggregate: null + column: null + datasourceWarning: false + expressionType: SQL + hasCustomLabel: false + label: AVG(CAST(JSON_VALUE(data, '$.rating') AS... + optionName: metric_00oy6lz4f1x8m_ogwvyq0hxx + sqlExpression: AVG(CAST(JSON_VALUE(data, '$.rating') AS Int16)) + groupby: [] + adhoc_filters: + - clause: WHERE + comparator: get_slots + datasourceWarning: false + expressionType: SIMPLE + filterOptionName: filter_7obcf0exa9_1e58m260tq5 + isExtra: false + isNew: false + operator: == + operatorId: EQUALS + sqlExpression: null + subject: data_key + - clause: WHERE + comparator: null + datasourceWarning: false + expressionType: SQL + filterOptionName: filter_0sg816yobyac_obqceo13prc + isExtra: false + isNew: false + operator: null + sqlExpression: JSON_VALUE(data, '$.rating') <> '' + subject: null + order_desc: true + row_limit: 10000 + truncate_metric: true + show_empty_columns: true + comparison_type: values + annotation_layers: [] + forecastPeriods: 10 + forecastInterval: 0.8 + x_axis_title: Time axis + x_axis_title_margin: 30 + y_axis_title: Average rating + y_axis_title_margin: 30 + y_axis_title_position: Left + color_scheme: echarts4Colors + seriesType: line + only_total: true + opacity: 0.2 + markerSize: 6 + show_legend: true + legendType: scroll + legendOrientation: top + x_axis_time_format: smart_date + rich_tooltip: true + tooltipTimeFormat: smart_date + y_axis_format: SMART_NUMBER + y_axis_bounds: + - null + - null + extra_form_data: {} + dashboards: + - 1 +query_context: '{"datasource":{"id":3,"type":"table"},"force":false,"queries":[{"time_range":"No + filter","granularity":"start_time","filters":[{"col":"data_key","op":"==","val":"get_slots"}],"extras":{"time_grain_sqla":"PT1M","having":"","where":"(JSON_VALUE(data, + ''$.rating'') <> '''')"},"applied_time_extras":{},"columns":[],"metrics":[{"aggregate":null,"column":null,"datasourceWarning":false,"expressionType":"SQL","hasCustomLabel":false,"label":"AVG(CAST(JSON_VALUE(data, + ''$.rating'') AS...","optionName":"metric_00oy6lz4f1x8m_ogwvyq0hxx","sqlExpression":"AVG(CAST(JSON_VALUE(data, + ''$.rating'') AS Int16))"}],"orderby":[[{"aggregate":null,"column":null,"datasourceWarning":false,"expressionType":"SQL","hasCustomLabel":false,"label":"AVG(CAST(JSON_VALUE(data, + ''$.rating'') AS...","optionName":"metric_00oy6lz4f1x8m_ogwvyq0hxx","sqlExpression":"AVG(CAST(JSON_VALUE(data, + ''$.rating'') AS Int16))"},false]],"annotation_layers":[],"row_limit":10000,"series_columns":[],"series_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{},"is_timeseries":true,"time_offsets":[],"post_processing":[{"operation":"pivot","options":{"index":["__timestamp"],"columns":[],"aggregates":{"AVG(CAST(JSON_VALUE(data, + ''$.rating'') AS...":{"operator":"mean"}},"drop_missing_columns":false}},{"operation":"flatten"}]}],"form_data":{"datasource":"3__table","viz_type":"echarts_timeseries_line","slice_id":7,"granularity_sqla":"start_time","time_grain_sqla":"PT1M","time_range":"No + filter","metrics":[{"aggregate":null,"column":null,"datasourceWarning":false,"expressionType":"SQL","hasCustomLabel":false,"label":"AVG(CAST(JSON_VALUE(data, + ''$.rating'') AS...","optionName":"metric_00oy6lz4f1x8m_ogwvyq0hxx","sqlExpression":"AVG(CAST(JSON_VALUE(data, + ''$.rating'') AS Int16))"}],"groupby":[],"adhoc_filters":[{"clause":"WHERE","comparator":"get_slots","datasourceWarning":false,"expressionType":"SIMPLE","filterOptionName":"filter_7obcf0exa9_1e58m260tq5","isExtra":false,"isNew":false,"operator":"==","operatorId":"EQUALS","sqlExpression":null,"subject":"data_key"},{"clause":"WHERE","comparator":null,"datasourceWarning":false,"expressionType":"SQL","filterOptionName":"filter_0sg816yobyac_obqceo13prc","isExtra":false,"isNew":false,"operator":null,"sqlExpression":"JSON_VALUE(data, + ''$.rating'') <> ''''","subject":null}],"order_desc":true,"row_limit":10000,"truncate_metric":true,"show_empty_columns":true,"comparison_type":"values","annotation_layers":[],"forecastPeriods":10,"forecastInterval":0.8,"x_axis_title":"Time + axis","x_axis_title_margin":30,"y_axis_title":"Average rating","y_axis_title_margin":30,"y_axis_title_position":"Left","color_scheme":"echarts4Colors","seriesType":"line","only_total":true,"opacity":0.2,"markerSize":6,"show_legend":true,"legendType":"scroll","legendOrientation":"top","x_axis_time_format":"smart_date","rich_tooltip":true,"tooltipTimeFormat":"smart_date","y_axis_format":"SMART_NUMBER","y_axis_bounds":[null,null],"extra_form_data":{},"dashboards":[1],"force":false,"result_format":"json","result_type":"full"},"result_format":"json","result_type":"full"}' +cache_timeout: null +uuid: 128e1da2-1efd-433d-9b93-a07de175e2bc +version: 1.0.0 +dataset_uuid: 8ba2e188-2bf8-4809-a5ee-2477a539d493 diff --git a/dff/config/superset_dashboard/charts/Requests_17.yaml b/dff/config/superset_dashboard/charts/Requests_17.yaml new file mode 100644 index 000000000..9881f448b --- /dev/null +++ b/dff/config/superset_dashboard/charts/Requests_17.yaml @@ -0,0 +1,59 @@ +slice_name: Requests +description: null +certified_by: null +certification_details: null +viz_type: table +params: + datasource: 3__table + viz_type: table + slice_id: 8 + granularity_sqla: start_time + time_grain_sqla: P1D + time_range: No filter + query_mode: raw + groupby: [] + all_columns: + - context_id + - request_id + - start_time + - expressionType: SQL + label: data + sqlExpression: JSON_VALUE(data, '$.last_request') + datasourceWarning: false + percent_metrics: [] + adhoc_filters: + - clause: WHERE + comparator: get_last_request + datasourceWarning: false + expressionType: SIMPLE + filterOptionName: filter_4amlkzz0hd3_exx83iz5rof + isExtra: false + isNew: false + operator: == + operatorId: EQUALS + sqlExpression: null + subject: data_key + order_by_cols: [] + row_limit: 1000 + server_page_length: 10 + order_desc: true + table_timestamp_format: '%d-%m-%Y %H:%M:%S' + show_cell_bars: true + color_pn: true + column_config: + data: + columnWidth: 150 + truncateLongCells: true + extra_form_data: {} + dashboards: + - 1 +query_context: '{"datasource":{"id":3,"type":"table"},"force":false,"queries":[{"time_range":"No + filter","granularity":"start_time","filters":[{"col":"data_key","op":"==","val":"get_last_request"}],"extras":{"time_grain_sqla":"P1D","having":"","where":""},"applied_time_extras":{},"columns":["context_id","request_id","start_time",{"expressionType":"SQL","label":"data","sqlExpression":"JSON_VALUE(data, + ''$.last_request'')","datasourceWarning":false}],"orderby":[],"annotation_layers":[],"row_limit":1000,"series_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{},"post_processing":[]}],"form_data":{"datasource":"3__table","viz_type":"table","slice_id":8,"granularity_sqla":"start_time","time_grain_sqla":"P1D","time_range":"No + filter","query_mode":"raw","groupby":[],"all_columns":["context_id","request_id","start_time",{"expressionType":"SQL","label":"data","sqlExpression":"JSON_VALUE(data, + ''$.last_request'')","datasourceWarning":false}],"percent_metrics":[],"adhoc_filters":[{"clause":"WHERE","comparator":"get_last_request","datasourceWarning":false,"expressionType":"SIMPLE","filterOptionName":"filter_4amlkzz0hd3_exx83iz5rof","isExtra":false,"isNew":false,"operator":"==","operatorId":"EQUALS","sqlExpression":null,"subject":"data_key"}],"order_by_cols":[],"row_limit":1000,"server_page_length":10,"include_time":false,"order_desc":true,"table_timestamp_format":"%d-%m-%Y + %H:%M:%S","show_cell_bars":true,"color_pn":true,"column_config":{"data":{"columnWidth":150,"truncateLongCells":true}},"extra_form_data":{},"dashboards":[1],"force":false,"result_format":"json","result_type":"full"},"result_format":"json","result_type":"full"}' +cache_timeout: null +uuid: 45ef67db-d33d-49f5-8d46-1f0fa518eaac +version: 1.0.0 +dataset_uuid: 8ba2e188-2bf8-4809-a5ee-2477a539d493 diff --git a/dff/config/superset_dashboard/charts/Responses_16.yaml b/dff/config/superset_dashboard/charts/Responses_16.yaml new file mode 100644 index 000000000..02349a9f1 --- /dev/null +++ b/dff/config/superset_dashboard/charts/Responses_16.yaml @@ -0,0 +1,59 @@ +slice_name: Responses +description: null +certified_by: null +certification_details: null +viz_type: table +params: + datasource: 3__table + viz_type: table + slice_id: 15 + granularity_sqla: start_time + time_grain_sqla: P1D + time_range: No filter + query_mode: raw + groupby: [] + all_columns: + - context_id + - request_id + - start_time + - expressionType: SQL + label: data + sqlExpression: JSON_VALUE(data, '$.last_response') + datasourceWarning: false + percent_metrics: [] + adhoc_filters: + - clause: WHERE + comparator: get_last_response + datasourceWarning: false + expressionType: SIMPLE + filterOptionName: filter_m3nzyr545di_lxjaivcal1 + isExtra: false + isNew: false + operator: == + operatorId: EQUALS + sqlExpression: null + subject: data_key + order_by_cols: [] + row_limit: 1000 + server_page_length: 10 + order_desc: true + table_timestamp_format: '%d-%m-%Y %H:%M:%S' + show_cell_bars: true + color_pn: true + column_config: + data: + columnWidth: 150 + truncateLongCells: true + extra_form_data: {} + dashboards: + - 1 +query_context: '{"datasource":{"id":3,"type":"table"},"force":false,"queries":[{"time_range":"No + filter","granularity":"start_time","filters":[{"col":"data_key","op":"==","val":"get_last_response"}],"extras":{"time_grain_sqla":"P1D","having":"","where":""},"applied_time_extras":{},"columns":["context_id","request_id","start_time",{"expressionType":"SQL","label":"data","sqlExpression":"JSON_VALUE(data, + ''$.last_response'')","datasourceWarning":false}],"orderby":[],"annotation_layers":[],"row_limit":1000,"series_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{},"post_processing":[]}],"form_data":{"datasource":"3__table","viz_type":"table","slice_id":15,"granularity_sqla":"start_time","time_grain_sqla":"P1D","time_range":"No + filter","query_mode":"raw","groupby":[],"all_columns":["context_id","request_id","start_time",{"expressionType":"SQL","label":"data","sqlExpression":"JSON_VALUE(data, + ''$.last_response'')","datasourceWarning":false}],"percent_metrics":[],"adhoc_filters":[{"clause":"WHERE","comparator":"get_last_response","datasourceWarning":false,"expressionType":"SIMPLE","filterOptionName":"filter_m3nzyr545di_lxjaivcal1","isExtra":false,"isNew":false,"operator":"==","operatorId":"EQUALS","sqlExpression":null,"subject":"data_key"}],"order_by_cols":[],"row_limit":1000,"server_page_length":10,"include_time":false,"order_desc":true,"table_timestamp_format":"%d-%m-%Y + %H:%M:%S","show_cell_bars":true,"color_pn":true,"column_config":{"data":{"columnWidth":150,"truncateLongCells":true}},"extra_form_data":{},"dashboards":[1],"force":false,"result_format":"json","result_type":"full"},"result_format":"json","result_type":"full"}' +cache_timeout: null +uuid: 7844eb6d-4fce-44cf-8994-fb61a221a2ab +version: 1.0.0 +dataset_uuid: 8ba2e188-2bf8-4809-a5ee-2477a539d493 diff --git a/dff/config/superset_dashboard/charts/Service_load_max_dialogue_length_8.yaml b/dff/config/superset_dashboard/charts/Service_load_max_dialogue_length_8.yaml deleted file mode 100644 index 1e087769a..000000000 --- a/dff/config/superset_dashboard/charts/Service_load_max_dialogue_length_8.yaml +++ /dev/null @@ -1,83 +0,0 @@ -slice_name: Service load [max dialogue length] -description: null -certified_by: null -certification_details: null -viz_type: echarts_timeseries_step -params: - datasource: 2__table - viz_type: echarts_timeseries_step - slice_id: 8 - granularity_sqla: start_time - time_grain_sqla: null - time_range: No filter - metrics: - - aggregate: null - column: null - datasourceWarning: false - expressionType: SQL - hasCustomLabel: false - label: AVG(CAST(request_id AS Int16)) - optionName: metric_8h0zfurdcy_tzo5q0tuczi - sqlExpression: AVG(CAST(request_id AS Int16)) - - aggregate: null - column: null - datasourceWarning: false - expressionType: SQL - hasCustomLabel: false - label: MAX(CAST(request_id AS Int16)) - optionName: metric_wz5zx1kqqc_u42eslame2 - sqlExpression: MAX(CAST(request_id AS Int16)) - groupby: [] - adhoc_filters: [] - order_desc: true - row_limit: 10000 - truncate_metric: true - show_empty_columns: true - comparison_type: values - annotation_layers: [] - forecastPeriods: 10 - forecastInterval: 0.8 - x_axis_title_margin: 15 - y_axis_title: AVG/MAX dialogue length - y_axis_title_margin: 50 - y_axis_title_position: Left - color_scheme: supersetColors - seriesType: start - only_total: true - opacity: 0.2 - markerSize: 6 - zoomable: true - show_legend: true - legendType: scroll - legendOrientation: top - x_axis_time_format: smart_date - rich_tooltip: true - tooltipSortByMetric: false - tooltipTimeFormat: smart_date - y_axis_format: SMART_NUMBER - logAxis: false - y_axis_bounds: - - null - - null - extra_form_data: {} - dashboards: - - 1 -query_context: '{"datasource":{"id":2,"type":"table"},"force":false,"queries":[{"time_range":"No - filter","granularity":"start_time","filters":[],"extras":{"time_grain_sqla":null,"having":"","where":""},"applied_time_extras":{},"columns":[],"metrics":[{"aggregate":null,"column":null,"datasourceWarning":false,"expressionType":"SQL","hasCustomLabel":false,"label":"AVG(CAST(request_id - AS Int16))","optionName":"metric_8h0zfurdcy_tzo5q0tuczi","sqlExpression":"AVG(CAST(request_id - AS Int16))"},{"aggregate":null,"column":null,"datasourceWarning":false,"expressionType":"SQL","hasCustomLabel":false,"label":"MAX(CAST(request_id - AS Int16))","optionName":"metric_wz5zx1kqqc_u42eslame2","sqlExpression":"MAX(CAST(request_id - AS Int16))"}],"orderby":[[{"aggregate":null,"column":null,"datasourceWarning":false,"expressionType":"SQL","hasCustomLabel":false,"label":"AVG(CAST(request_id - AS Int16))","optionName":"metric_8h0zfurdcy_tzo5q0tuczi","sqlExpression":"AVG(CAST(request_id - AS Int16))"},false]],"annotation_layers":[],"row_limit":10000,"series_columns":[],"series_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{},"is_timeseries":true,"time_offsets":[],"post_processing":[{"operation":"pivot","options":{"index":["__timestamp"],"columns":[],"aggregates":{"AVG(CAST(request_id - AS Int16))":{"operator":"mean"},"MAX(CAST(request_id AS Int16))":{"operator":"mean"}},"drop_missing_columns":false}},{"operation":"flatten"}]}],"form_data":{"datasource":"2__table","viz_type":"echarts_timeseries_step","slice_id":8,"granularity_sqla":"start_time","time_grain_sqla":null,"time_range":"No - filter","metrics":[{"aggregate":null,"column":null,"datasourceWarning":false,"expressionType":"SQL","hasCustomLabel":false,"label":"AVG(CAST(request_id - AS Int16))","optionName":"metric_8h0zfurdcy_tzo5q0tuczi","sqlExpression":"AVG(CAST(request_id - AS Int16))"},{"aggregate":null,"column":null,"datasourceWarning":false,"expressionType":"SQL","hasCustomLabel":false,"label":"MAX(CAST(request_id - AS Int16))","optionName":"metric_wz5zx1kqqc_u42eslame2","sqlExpression":"MAX(CAST(request_id - AS Int16))"}],"groupby":[],"adhoc_filters":[],"order_desc":true,"row_limit":10000,"truncate_metric":true,"show_empty_columns":true,"comparison_type":"values","annotation_layers":[],"forecastPeriods":10,"forecastInterval":0.8,"x_axis_title_margin":15,"y_axis_title":"AVG/MAX - dialogue length","y_axis_title_margin":50,"y_axis_title_position":"Left","color_scheme":"supersetColors","seriesType":"start","only_total":true,"opacity":0.2,"markerSize":6,"zoomable":true,"show_legend":true,"legendType":"scroll","legendOrientation":"top","x_axis_time_format":"smart_date","rich_tooltip":true,"tooltipSortByMetric":false,"tooltipTimeFormat":"smart_date","y_axis_format":"SMART_NUMBER","logAxis":false,"y_axis_bounds":[null,null],"extra_form_data":{},"dashboards":[1],"force":false,"result_format":"json","result_type":"full"},"result_format":"json","result_type":"full"}' -cache_timeout: null -uuid: 276c3aa7-89bc-49ff-91b6-6232ae35c854 -version: 1.0.0 -dataset_uuid: fda98ab8-f550-45f1-9ded-0113f3e67260 diff --git a/dff/config/superset_dashboard/charts/Table_10.yaml b/dff/config/superset_dashboard/charts/Table_10.yaml deleted file mode 100644 index b3f9f636c..000000000 --- a/dff/config/superset_dashboard/charts/Table_10.yaml +++ /dev/null @@ -1,34 +0,0 @@ -slice_name: Table -description: null -certified_by: null -certification_details: null -viz_type: table -params: - adhoc_filters: [] - all_columns: [] - color_pn: true - datasource: 3__table - extra_form_data: {} - granularity_sqla: start_time - groupby: - - context_id - - start_time - - data_key - - data - order_by_cols: [] - order_desc: false - percent_metrics: [] - query_mode: aggregate - row_limit: 10000 - server_page_length: 10 - show_cell_bars: true - slice_id: 14 - table_timestamp_format: smart_date - time_grain_sqla: null - time_range: No filter - viz_type: table -query_context: null -cache_timeout: null -uuid: 38d353dc-c0ef-41a0-97c7-3dcbebab9e02 -version: 1.0.0 -dataset_uuid: fda98ab8-f550-45f1-9ded-0113f3e67260 diff --git a/dff/config/superset_dashboard/charts/Table_14.yaml b/dff/config/superset_dashboard/charts/Table_14.yaml new file mode 100644 index 000000000..fade8e8c9 --- /dev/null +++ b/dff/config/superset_dashboard/charts/Table_14.yaml @@ -0,0 +1,38 @@ +slice_name: Table +description: null +certified_by: null +certification_details: null +viz_type: table +params: + datasource: 3__table + viz_type: table + slice_id: 16 + granularity_sqla: start_time + time_grain_sqla: null + time_range: No filter + query_mode: aggregate + groupby: + - context_id + - start_time + - data_key + - data + all_columns: [] + percent_metrics: [] + adhoc_filters: [] + order_by_cols: [] + row_limit: 10000 + server_page_length: 10 + order_desc: false + table_timestamp_format: smart_date + show_cell_bars: true + color_pn: true + extra_form_data: {} + dashboards: + - 1 +query_context: '{"datasource":{"id":3,"type":"table"},"force":false,"queries":[{"time_range":"No + filter","granularity":"start_time","filters":[],"extras":{"time_grain_sqla":null,"having":"","where":""},"applied_time_extras":{},"columns":["context_id","start_time","data_key","data"],"metrics":[],"orderby":[],"annotation_layers":[],"row_limit":10000,"series_limit":0,"order_desc":false,"url_params":{},"custom_params":{},"custom_form_data":{},"post_processing":[]}],"form_data":{"datasource":"3__table","viz_type":"table","slice_id":16,"granularity_sqla":"start_time","time_grain_sqla":null,"time_range":"No + filter","query_mode":"aggregate","groupby":["context_id","start_time","data_key","data"],"all_columns":[],"percent_metrics":[],"adhoc_filters":[],"order_by_cols":[],"row_limit":10000,"server_page_length":10,"order_desc":false,"table_timestamp_format":"smart_date","show_cell_bars":true,"color_pn":true,"extra_form_data":{},"dashboards":[1],"force":false,"result_format":"json","result_type":"full"},"result_format":"json","result_type":"full"}' +cache_timeout: null +uuid: 38d353dc-c0ef-41a0-97c7-3dcbebab9e02 +version: 1.0.0 +dataset_uuid: 8ba2e188-2bf8-4809-a5ee-2477a539d493 diff --git a/dff/config/superset_dashboard/charts/Terminal_labels_11.yaml b/dff/config/superset_dashboard/charts/Terminal_labels_15.yaml similarity index 100% rename from dff/config/superset_dashboard/charts/Terminal_labels_11.yaml rename to dff/config/superset_dashboard/charts/Terminal_labels_15.yaml diff --git a/dff/config/superset_dashboard/charts/Transition_counts_12.yaml b/dff/config/superset_dashboard/charts/Transition_counts_12.yaml index f44c72191..56c6099f9 100644 --- a/dff/config/superset_dashboard/charts/Transition_counts_12.yaml +++ b/dff/config/superset_dashboard/charts/Transition_counts_12.yaml @@ -4,18 +4,11 @@ certified_by: null certification_details: null viz_type: dist_bar params: - adhoc_filters: [] - bar_stacked: true - bottom_margin: auto - color_scheme: supersetColors - columns: - - flow_label - datasource: 1__table - extra_form_data: {} + datasource: 2__table + viz_type: dist_bar + slice_id: 1 granularity_sqla: start_time - groupby: - - prev_label - - label + time_range: No filter metrics: - aggregate: COUNT_DISTINCT column: @@ -41,22 +34,67 @@ params: label: COUNT_DISTINCT(context_id) optionName: metric_tc3lb0a1pff_dyroibp08h7 sqlExpression: null - order_desc: true - rich_tooltip: true + adhoc_filters: + - expressionType: SIMPLE + subject: data_key + operator: == + operatorId: EQUALS + comparator: get_current_label + clause: WHERE + sqlExpression: null + isExtra: false + isNew: false + datasourceWarning: false + filterOptionName: filter_f7v0qac48fr_l37sg1wvtm + - expressionType: SQL + sqlExpression: label <> '' + clause: WHERE + subject: null + operator: null + comparator: null + isExtra: false + isNew: false + datasourceWarning: false + filterOptionName: filter_e9h83eu2wg_ata0o82djjn + - expressionType: SQL + sqlExpression: prev_label <> '' + clause: WHERE + subject: null + operator: null + comparator: null + isExtra: false + isNew: false + datasourceWarning: false + filterOptionName: filter_t2quebiqkp_x1qhr9mtq7f + groupby: + - prev_label + - label + columns: + - flow_label row_limit: 10000 + order_desc: true + color_scheme: echarts4Colors show_legend: true - slice_id: 6 - time_range: No filter - viz_type: dist_bar - x_axis_label: Transitions - x_ticks_layout: auto - y_axis_bounds: - - null - - null + rich_tooltip: true + bar_stacked: true y_axis_format: SMART_NUMBER y_axis_label: Counts y_axis_showminmax: false -query_context: null + y_axis_bounds: + - null + - null + x_axis_label: Transitions + bottom_margin: auto + x_ticks_layout: auto + extra_form_data: {} + dashboards: + - 1 +query_context: '{"datasource":{"id":2,"type":"table"},"force":false,"queries":[{"time_range":"No + filter","granularity":"start_time","filters":[{"col":"data_key","op":"==","val":"get_current_label"}],"extras":{"having":"","where":"(label + <> '''') AND (prev_label <> '''')"},"applied_time_extras":{},"columns":["prev_label","label","flow_label"],"metrics":[{"aggregate":"COUNT_DISTINCT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT_DISTINCT(context_id)","optionName":"metric_tc3lb0a1pff_dyroibp08h7","sqlExpression":null}],"annotation_layers":[],"row_limit":10000,"series_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{}}],"form_data":{"datasource":"2__table","viz_type":"dist_bar","slice_id":1,"granularity_sqla":"start_time","time_range":"No + filter","metrics":[{"aggregate":"COUNT_DISTINCT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT_DISTINCT(context_id)","optionName":"metric_tc3lb0a1pff_dyroibp08h7","sqlExpression":null}],"adhoc_filters":[{"expressionType":"SIMPLE","subject":"data_key","operator":"==","operatorId":"EQUALS","comparator":"get_current_label","clause":"WHERE","sqlExpression":null,"isExtra":false,"isNew":false,"datasourceWarning":false,"filterOptionName":"filter_f7v0qac48fr_l37sg1wvtm"},{"expressionType":"SQL","sqlExpression":"label + <> ''''","clause":"WHERE","subject":null,"operator":null,"comparator":null,"isExtra":false,"isNew":false,"datasourceWarning":false,"filterOptionName":"filter_e9h83eu2wg_ata0o82djjn"},{"expressionType":"SQL","sqlExpression":"prev_label + <> ''''","clause":"WHERE","subject":null,"operator":null,"comparator":null,"isExtra":false,"isNew":false,"datasourceWarning":false,"filterOptionName":"filter_t2quebiqkp_x1qhr9mtq7f"}],"groupby":["prev_label","label"],"columns":["flow_label"],"row_limit":10000,"order_desc":true,"color_scheme":"echarts4Colors","show_legend":true,"rich_tooltip":true,"bar_stacked":true,"y_axis_format":"SMART_NUMBER","y_axis_label":"Counts","y_axis_showminmax":false,"y_axis_bounds":[null,null],"x_axis_label":"Transitions","bottom_margin":"auto","x_ticks_layout":"auto","extra_form_data":{},"dashboards":[1],"force":false,"result_format":"json","result_type":"full"},"result_format":"json","result_type":"full"}' cache_timeout: null uuid: 9fcc7cc1-9257-4c0d-b377-b3a60a8bf3df version: 1.0.0 diff --git a/dff/config/superset_dashboard/charts/Transition_layout_10.yaml b/dff/config/superset_dashboard/charts/Transition_layout_10.yaml new file mode 100644 index 000000000..8b674fd59 --- /dev/null +++ b/dff/config/superset_dashboard/charts/Transition_layout_10.yaml @@ -0,0 +1,101 @@ +slice_name: Transition layout +description: null +certified_by: null +certification_details: null +viz_type: graph_chart +params: + datasource: 2__table + viz_type: graph_chart + slice_id: 8 + granularity_sqla: start_time + time_range: No filter + source: prev_label + target: label + metric: + aggregate: COUNT + column: + advanced_data_type: null + certification_details: null + certified_by: null + column_name: context_id + description: null + expression: null + filterable: true + groupby: true + id: 1 + is_certified: false + is_dttm: false + python_date_format: null + type: STRING + type_generic: 1 + verbose_name: null + warning_markdown: null + expressionType: SIMPLE + hasCustomLabel: false + isNew: false + label: COUNT(context_id) + optionName: metric_qxsyaujh63_4b75kyx6b5g + sqlExpression: null + source_category: prev_flow + target_category: flow_label + adhoc_filters: + - expressionType: SIMPLE + subject: data_key + operator: == + operatorId: EQUALS + comparator: get_current_label + clause: WHERE + sqlExpression: null + isExtra: false + isNew: false + datasourceWarning: false + filterOptionName: filter_avle3r80zu4_c4684cbrjfg + - expressionType: SQL + sqlExpression: label <> '' + clause: WHERE + subject: null + operator: null + comparator: null + isExtra: false + isNew: false + datasourceWarning: false + filterOptionName: filter_0jip6y1w3awu_eysm19dnp2 + - expressionType: SQL + sqlExpression: prev_label <> '' + clause: WHERE + subject: null + operator: null + comparator: null + isExtra: false + isNew: false + datasourceWarning: false + filterOptionName: filter_29oq8kbalhr_6wudwxysro + row_limit: 10000 + color_scheme: echarts4Colors + show_legend: true + legendType: scroll + legendOrientation: top + layout: force + edgeSymbol: none,arrow + draggable: false + roam: scale + selectedMode: single + baseNodeSize: 20 + baseEdgeWidth: 3 + edgeLength: 400 + gravity: 0.3 + repulsion: 1000 + friction: 0.2 + extra_form_data: {} + dashboards: + - 1 +query_context: '{"datasource":{"id":2,"type":"table"},"force":false,"queries":[{"time_range":"No + filter","granularity":"start_time","filters":[{"col":"data_key","op":"==","val":"get_current_label"}],"extras":{"having":"","where":"(label + <> '''') AND (prev_label <> '''')"},"applied_time_extras":{},"columns":["prev_label","label","flow_label"],"metrics":[{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_qxsyaujh63_4b75kyx6b5g","sqlExpression":null}],"annotation_layers":[],"row_limit":10000,"series_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{}}],"form_data":{"datasource":"2__table","viz_type":"graph_chart","slice_id":8,"granularity_sqla":"start_time","time_range":"No + filter","source":"prev_label","target":"label","metric":{"aggregate":"COUNT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT(context_id)","optionName":"metric_qxsyaujh63_4b75kyx6b5g","sqlExpression":null},"source_category":"prev_flow","target_category":"flow_label","adhoc_filters":[{"expressionType":"SIMPLE","subject":"data_key","operator":"==","operatorId":"EQUALS","comparator":"get_current_label","clause":"WHERE","sqlExpression":null,"isExtra":false,"isNew":false,"datasourceWarning":false,"filterOptionName":"filter_avle3r80zu4_c4684cbrjfg"},{"expressionType":"SQL","sqlExpression":"label + <> ''''","clause":"WHERE","subject":null,"operator":null,"comparator":null,"isExtra":false,"isNew":false,"datasourceWarning":false,"filterOptionName":"filter_0jip6y1w3awu_eysm19dnp2"},{"expressionType":"SQL","sqlExpression":"prev_label + <> ''''","clause":"WHERE","subject":null,"operator":null,"comparator":null,"isExtra":false,"isNew":false,"datasourceWarning":false,"filterOptionName":"filter_29oq8kbalhr_6wudwxysro"}],"row_limit":10000,"color_scheme":"echarts4Colors","show_legend":true,"legendType":"scroll","legendOrientation":"top","layout":"force","edgeSymbol":"none,arrow","draggable":false,"roam":"scale","selectedMode":"single","baseNodeSize":20,"baseEdgeWidth":3,"edgeLength":400,"gravity":0.3,"repulsion":1000,"friction":0.2,"extra_form_data":{},"dashboards":[1],"force":false,"result_format":"json","result_type":"full"},"result_format":"json","result_type":"full"}' +cache_timeout: null +uuid: 801e8c66-f693-46e3-a9a5-7b2b0b08a4a7 +version: 1.0.0 +dataset_uuid: fda98ab8-f550-45f1-9ded-0113f3e67260 diff --git a/dff/config/superset_dashboard/charts/Transition_layout_13.yaml b/dff/config/superset_dashboard/charts/Transition_layout_13.yaml deleted file mode 100644 index 5999b30ed..000000000 --- a/dff/config/superset_dashboard/charts/Transition_layout_13.yaml +++ /dev/null @@ -1,62 +0,0 @@ -slice_name: Transition layout -description: null -certified_by: null -certification_details: null -viz_type: graph_chart -params: - adhoc_filters: [] - baseEdgeWidth: 3 - baseNodeSize: 20 - color_scheme: supersetColors - datasource: 1__table - draggable: false - edgeLength: 400 - edgeSymbol: none,arrow - extra_form_data: {} - friction: 0.2 - granularity_sqla: start_time - gravity: 0.3 - layout: force - legendOrientation: top - legendType: scroll - metric: - aggregate: COUNT - column: - advanced_data_type: null - certification_details: null - certified_by: null - column_name: context_id - description: null - expression: null - filterable: true - groupby: true - id: 1 - is_certified: false - is_dttm: false - python_date_format: null - type: STRING - type_generic: 1 - verbose_name: null - warning_markdown: null - expressionType: SIMPLE - hasCustomLabel: false - isNew: false - label: COUNT(context_id) - optionName: metric_qxsyaujh63_4b75kyx6b5g - sqlExpression: null - repulsion: 1000 - roam: scale - row_limit: 10000 - selectedMode: single - show_legend: true - source: prev_label - source_category: flow_label - target: label - target_category: flow_label - time_range: No filter - viz_type: graph_chart -query_context: null -cache_timeout: null -uuid: 801e8c66-f693-46e3-a9a5-7b2b0b08a4a7 -version: 1.0.0 -dataset_uuid: fda98ab8-f550-45f1-9ded-0113f3e67260 diff --git a/dff/config/superset_dashboard/charts/Transition_ratio_chord_11.yaml b/dff/config/superset_dashboard/charts/Transition_ratio_chord_11.yaml new file mode 100644 index 000000000..5083aa859 --- /dev/null +++ b/dff/config/superset_dashboard/charts/Transition_ratio_chord_11.yaml @@ -0,0 +1,86 @@ +slice_name: Transition ratio [chord] +description: null +certified_by: null +certification_details: null +viz_type: chord +params: + datasource: 2__table + viz_type: chord + slice_id: 12 + granularity_sqla: start_time + time_range: No filter + groupby: label + columns: prev_label + metric: + aggregate: COUNT_DISTINCT + column: + advanced_data_type: null + certification_details: null + certified_by: null + column_name: context_id + description: null + expression: null + filterable: true + groupby: true + id: 1 + is_certified: false + is_dttm: false + python_date_format: null + type: STRING + type_generic: 1 + verbose_name: null + warning_markdown: null + expressionType: SIMPLE + hasCustomLabel: false + isNew: false + label: COUNT_DISTINCT(context_id) + optionName: metric_97lz5hqft8j_aqofzpt1ma5 + sqlExpression: null + adhoc_filters: + - expressionType: SIMPLE + subject: data_key + operator: == + operatorId: EQUALS + comparator: get_current_label + clause: WHERE + sqlExpression: null + isExtra: false + isNew: false + datasourceWarning: false + filterOptionName: filter_ug6txpdjuzj_znl0zrda72n + - expressionType: SQL + sqlExpression: label <> '' + clause: WHERE + subject: null + operator: null + comparator: null + isExtra: false + isNew: false + datasourceWarning: false + filterOptionName: filter_a4j5xkh81f5_k2i0586j12h + - expressionType: SQL + sqlExpression: prev_label <> '' + clause: WHERE + subject: null + operator: null + comparator: null + isExtra: false + isNew: false + datasourceWarning: false + filterOptionName: filter_p4zwr1yr4v9_avka1ppurai + row_limit: 10000 + y_axis_format: ~g + color_scheme: echarts4Colors + extra_form_data: {} + dashboards: + - 1 +query_context: '{"datasource":{"id":2,"type":"table"},"force":false,"queries":[{"time_range":"No + filter","granularity":"start_time","filters":[{"col":"data_key","op":"==","val":"get_current_label"}],"extras":{"having":"","where":"(label + <> '''') AND (prev_label <> '''')"},"applied_time_extras":{},"columns":["label","prev_label"],"metrics":[{"aggregate":"COUNT_DISTINCT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT_DISTINCT(context_id)","optionName":"metric_97lz5hqft8j_aqofzpt1ma5","sqlExpression":null}],"annotation_layers":[],"row_limit":10000,"series_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{}}],"form_data":{"datasource":"2__table","viz_type":"chord","slice_id":12,"granularity_sqla":"start_time","time_range":"No + filter","groupby":"label","columns":"prev_label","metric":{"aggregate":"COUNT_DISTINCT","column":{"advanced_data_type":null,"certification_details":null,"certified_by":null,"column_name":"context_id","description":null,"expression":null,"filterable":true,"groupby":true,"id":1,"is_certified":false,"is_dttm":false,"python_date_format":null,"type":"STRING","type_generic":1,"verbose_name":null,"warning_markdown":null},"expressionType":"SIMPLE","hasCustomLabel":false,"isNew":false,"label":"COUNT_DISTINCT(context_id)","optionName":"metric_97lz5hqft8j_aqofzpt1ma5","sqlExpression":null},"adhoc_filters":[{"expressionType":"SIMPLE","subject":"data_key","operator":"==","operatorId":"EQUALS","comparator":"get_current_label","clause":"WHERE","sqlExpression":null,"isExtra":false,"isNew":false,"datasourceWarning":false,"filterOptionName":"filter_ug6txpdjuzj_znl0zrda72n"},{"expressionType":"SQL","sqlExpression":"label + <> ''''","clause":"WHERE","subject":null,"operator":null,"comparator":null,"isExtra":false,"isNew":false,"datasourceWarning":false,"filterOptionName":"filter_a4j5xkh81f5_k2i0586j12h"},{"expressionType":"SQL","sqlExpression":"prev_label + <> ''''","clause":"WHERE","subject":null,"operator":null,"comparator":null,"isExtra":false,"isNew":false,"datasourceWarning":false,"filterOptionName":"filter_p4zwr1yr4v9_avka1ppurai"}],"row_limit":10000,"y_axis_format":"~g","color_scheme":"echarts4Colors","extra_form_data":{},"dashboards":[1],"force":false,"result_format":"json","result_type":"full"},"result_format":"json","result_type":"full"}' +cache_timeout: null +uuid: 388d2359-8d13-4795-8dc9-1cb5dfa92ee1 +version: 1.0.0 +dataset_uuid: fda98ab8-f550-45f1-9ded-0113f3e67260 diff --git a/dff/config/superset_dashboard/charts/Transition_ratio_chord_14.yaml b/dff/config/superset_dashboard/charts/Transition_ratio_chord_14.yaml deleted file mode 100644 index e9d1f8723..000000000 --- a/dff/config/superset_dashboard/charts/Transition_ratio_chord_14.yaml +++ /dev/null @@ -1,48 +0,0 @@ -slice_name: Transition ratio [chord] -description: null -certified_by: null -certification_details: null -viz_type: chord -params: - adhoc_filters: [] - color_scheme: bnbColors - columns: prev_label - datasource: 1__table - extra_form_data: {} - granularity_sqla: start_time - groupby: label - metric: - aggregate: COUNT_DISTINCT - column: - advanced_data_type: null - certification_details: null - certified_by: null - column_name: context_id - description: null - expression: null - filterable: true - groupby: true - id: 1 - is_certified: false - is_dttm: false - python_date_format: null - type: STRING - type_generic: 1 - verbose_name: null - warning_markdown: null - expressionType: SIMPLE - hasCustomLabel: false - isNew: false - label: COUNT_DISTINCT(context_id) - optionName: metric_97lz5hqft8j_aqofzpt1ma5 - sqlExpression: null - row_limit: 10000 - slice_id: 13 - time_range: No filter - viz_type: chord - y_axis_format: ~g -query_context: null -cache_timeout: null -uuid: 388d2359-8d13-4795-8dc9-1cb5dfa92ee1 -version: 1.0.0 -dataset_uuid: fda98ab8-f550-45f1-9ded-0113f3e67260 diff --git a/dff/config/superset_dashboard/dashboards/DFF_Stats_1.yaml b/dff/config/superset_dashboard/dashboards/DFF_Stats_1.yaml deleted file mode 100644 index 0523b8ae1..000000000 --- a/dff/config/superset_dashboard/dashboards/DFF_Stats_1.yaml +++ /dev/null @@ -1,555 +0,0 @@ -dashboard_title: DFF Stats -description: null -css: '' -slug: dff-stats -uuid: 68bce374-99bc-4890-b8c2-cb172409b894 -position: - CHART-Af3zvLsiKV: - children: [] - id: CHART-Af3zvLsiKV - meta: - chartId: 4 - height: 66 - sliceName: Node visit ratio monitor - uuid: 6fafe59c-0fec-4cd8-a8b3-c0bfaffb2135 - width: 12 - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-6zE8noCIsx - - ROW-7g6_n72hZ - type: CHART - CHART-CuCYDOlGEu: - children: [] - id: CHART-CuCYDOlGEu - meta: - chartId: 10 - height: 50 - sliceName: Table - sliceNameOverride: Stats table - uuid: 38d353dc-c0ef-41a0-97c7-3dcbebab9e02 - width: 12 - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-JCU6rANFP - - ROW-EaYAQjv4W - type: CHART - CHART-DxY0c3RnIv: - children: [] - id: CHART-DxY0c3RnIv - meta: - chartId: 3 - height: 61 - sliceName: Node counts - uuid: 0c47c7b5-f500-46cb-97e3-9ebb637f0c8a - width: 12 - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-VUknWnOAy - - ROW-PvToekFjO - type: CHART - CHART-explore-10-1: - children: [] - id: CHART-explore-10-1 - meta: - chartId: 13 - height: 73 - sliceName: Transition layout - sliceNameOverride: Dialogue layout - uuid: 801e8c66-f693-46e3-a9a5-7b2b0b08a4a7 - width: 6 - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-JCU6rANFP - - ROW-Ccs1FbcI- - type: CHART - CHART-explore-11-1: - children: [] - id: CHART-explore-11-1 - meta: - chartId: 5 - height: 56 - sliceName: Node visits [cloud] - uuid: b25b4292-ff21-4164-98ac-b1cba95e2994 - width: 8 - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-Gw0Ffh1lG - - ROW-rR4J0eAhh - type: CHART - CHART-explore-13-1: - children: [] - id: CHART-explore-13-1 - meta: - chartId: 14 - height: 74 - sliceName: Transition ratio [chord] - uuid: 388d2359-8d13-4795-8dc9-1cb5dfa92ee1 - width: 6 - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-JCU6rANFP - - ROW-Ccs1FbcI- - type: CHART - CHART-explore-14-1: - children: [] - id: CHART-explore-14-1 - meta: - chartId: 7 - height: 105 - sliceName: Node visits [sunburst] - uuid: e955f48c-824c-423c-a11c-5b5dca162927 - width: 6 - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-Gw0Ffh1lG - - ROW-ZcN9G9RL5 - type: CHART - CHART-explore-20-1: - children: [] - id: CHART-explore-20-1 - meta: - chartId: 2 - height: 50 - sliceName: Node Visits - uuid: 44f4ab9d-5072-4926-a6ed-8615fb81b3d0 - width: 12 - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-6zE8noCIsx - - ROW-ksepbeQu6 - type: CHART - CHART-explore-21-1: - children: [] - id: CHART-explore-21-1 - meta: - chartId: 1 - height: 60 - sliceName: Flow visit ratio monitor - uuid: ba02528b-184b-4304-b027-f2b7d9011ab0 - width: 12 - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-6zE8noCIsx - - ROW-ZTVWOu2o0 - type: CHART - CHART-explore-22-1: - children: [] - id: CHART-explore-22-1 - meta: - chartId: 11 - height: 61 - sliceName: Terminal labels - sliceNameOverride: Terminal labels monitor - uuid: cf066e41-a9e8-4f54-a875-ebf4da350b59 - width: 12 - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-6zE8noCIsx - - ROW-LhKWfqM7V - type: CHART - CHART-explore-9-1: - children: [] - id: CHART-explore-9-1 - meta: - chartId: 6 - height: 105 - sliceName: Node visits [ratio] - uuid: f9fb7893-3533-4519-bbc4-1f4853f380e1 - width: 6 - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-Gw0Ffh1lG - - ROW-ZcN9G9RL5 - type: CHART - CHART-mYC2udeF3a: - children: [] - id: CHART-mYC2udeF3a - meta: - chartId: 9 - height: 50 - sliceName: Service load [users] - uuid: b5d43314-514c-464e-9fcc-f897e3ae0963 - width: 12 - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-6zE8noCIsx - - ROW-Ae7v1prsp2 - type: CHART - CHART-wci7CHiza6: - children: [] - id: CHART-wci7CHiza6 - meta: - chartId: 12 - height: 66 - sliceName: Transition counts - uuid: 9fcc7cc1-9257-4c0d-b377-b3a60a8bf3df - width: 12 - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-VUknWnOAy - - ROW-TRNUnY9X_Y - type: CHART - COLUMN-JRaDi96UVP: - children: [] - id: COLUMN-JRaDi96UVP - meta: - background: BACKGROUND_TRANSPARENT - width: 2 - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-Gw0Ffh1lG - - ROW-rR4J0eAhh - type: COLUMN - COLUMN-WysgPuf0P1: - children: [] - id: COLUMN-WysgPuf0P1 - meta: - background: BACKGROUND_TRANSPARENT - width: 2 - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-Gw0Ffh1lG - - ROW-rR4J0eAhh - type: COLUMN - DASHBOARD_VERSION_KEY: v2 - GRID_ID: - children: - - HEADER-nYVwogYInk - - TABS-Xoi5oUBxZI - id: GRID_ID - parents: - - ROOT_ID - type: GRID - HEADER-nYVwogYInk: - children: [] - id: HEADER-nYVwogYInk - meta: - background: BACKGROUND_TRANSPARENT - headerSize: LARGE_HEADER - text: DFF Stats - parents: - - ROOT_ID - - GRID_ID - type: HEADER - HEADER_ID: - id: HEADER_ID - meta: - text: DFF Stats - type: HEADER - ROOT_ID: - children: - - GRID_ID - id: ROOT_ID - type: ROOT - ROW-7g6_n72hZ: - children: - - CHART-Af3zvLsiKV - id: ROW-7g6_n72hZ - meta: - background: BACKGROUND_TRANSPARENT - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-6zE8noCIsx - type: ROW - ROW-Ae7v1prsp2: - children: - - CHART-mYC2udeF3a - id: ROW-Ae7v1prsp2 - meta: - background: BACKGROUND_TRANSPARENT - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-6zE8noCIsx - type: ROW - ROW-Ccs1FbcI-: - children: - - CHART-explore-10-1 - - CHART-explore-13-1 - id: ROW-Ccs1FbcI- - meta: - background: BACKGROUND_TRANSPARENT - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-JCU6rANFP - type: ROW - ROW-EaYAQjv4W: - children: - - CHART-CuCYDOlGEu - id: ROW-EaYAQjv4W - meta: - background: BACKGROUND_TRANSPARENT - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-JCU6rANFP - type: ROW - ROW-LhKWfqM7V: - children: - - CHART-explore-22-1 - id: ROW-LhKWfqM7V - meta: - background: BACKGROUND_TRANSPARENT - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-6zE8noCIsx - type: ROW - ROW-PvToekFjO: - children: - - CHART-DxY0c3RnIv - id: ROW-PvToekFjO - meta: - background: BACKGROUND_TRANSPARENT - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-VUknWnOAy - type: ROW - ROW-TRNUnY9X_Y: - children: - - CHART-wci7CHiza6 - id: ROW-TRNUnY9X_Y - meta: - background: BACKGROUND_TRANSPARENT - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-VUknWnOAy - type: ROW - ROW-ZTVWOu2o0: - children: - - CHART-explore-21-1 - id: ROW-ZTVWOu2o0 - meta: - background: BACKGROUND_TRANSPARENT - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-6zE8noCIsx - type: ROW - ROW-ZcN9G9RL5: - children: - - CHART-explore-9-1 - - CHART-explore-14-1 - id: ROW-ZcN9G9RL5 - meta: - background: BACKGROUND_TRANSPARENT - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-Gw0Ffh1lG - type: ROW - ROW-hfJk2ddHi: - children: - - CHART-explore-20-1 - id: ROW-hfJk2ddHi - meta: - background: BACKGROUND_TRANSPARENT - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-VUknWnOAy - type: ROW - ROW-ksepbeQu6: - children: - - CHART-explore-20-1 - id: ROW-ksepbeQu6 - meta: - background: BACKGROUND_TRANSPARENT - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-6zE8noCIsx - type: ROW - ROW-rR4J0eAhh: - children: - - COLUMN-JRaDi96UVP - - CHART-explore-11-1 - - COLUMN-WysgPuf0P1 - id: ROW-rR4J0eAhh - meta: - background: BACKGROUND_TRANSPARENT - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - - TAB-Gw0Ffh1lG - type: ROW - TAB-6zE8noCIsx: - children: - - ROW-Ae7v1prsp2 - - ROW-ksepbeQu6 - - ROW-ZTVWOu2o0 - - ROW-7g6_n72hZ - - ROW-LhKWfqM7V - id: TAB-6zE8noCIsx - meta: - defaultText: Tab title - placeholder: Tab title - text: Service stats - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - type: TAB - TAB-Gw0Ffh1lG: - children: - - ROW-ZcN9G9RL5 - - ROW-rR4J0eAhh - id: TAB-Gw0Ffh1lG - meta: - defaultText: Tab title - placeholder: Tab title - text: General stats - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - type: TAB - TAB-JCU6rANFP: - children: - - ROW-EaYAQjv4W - - ROW-Ccs1FbcI- - id: TAB-JCU6rANFP - meta: - defaultText: Tab title - placeholder: Tab title - text: Overview - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - type: TAB - TAB-VUknWnOAy: - children: - - ROW-PvToekFjO - - ROW-hfJk2ddHi - - ROW-TRNUnY9X_Y - id: TAB-VUknWnOAy - meta: - defaultText: Tab title - placeholder: Tab title - text: Additional stats - parents: - - ROOT_ID - - GRID_ID - - TABS-Xoi5oUBxZI - type: TAB - TABS-Xoi5oUBxZI: - children: - - TAB-JCU6rANFP - - TAB-Gw0Ffh1lG - - TAB-VUknWnOAy - - TAB-6zE8noCIsx - id: TABS-Xoi5oUBxZI - meta: {} - parents: - - ROOT_ID - - GRID_ID - type: TABS -metadata: - color_scheme: echarts4Colors - label_colors: {} - shared_label_colors: - 'greeting_flow: node1': '#c23531' - 'greeting_flow: node2': '#2f4554' - 'greeting_flow: node3': '#61a0a8' - 'greeting_flow: node4': '#d48265' - greeting_flow, node1: '#c23531' - greeting_flow, node2: '#2f4554' - greeting_flow, node3: '#61a0a8' - greeting_flow, node4: '#d48265' - greeting_flow: '#c23531' - AVG(CAST(request_id AS Int16)): '#c23531' - MAX(CAST(request_id AS Int16)): '#2f4554' - root: '#c23531' - node2: '#61a0a8' - node4: '#d48265' - node3: '#91c7ae' - node1: '#749f83' - ? '' - : '#c23531' - timed_refresh_immune_slices: [] - expanded_slices: {} - refresh_frequency: 1800 - show_native_filters: true - default_filters: '{}' - chart_configuration: {} - color_scheme_domain: - - '#c23531' - - '#2f4554' - - '#61a0a8' - - '#d48265' - - '#91c7ae' - - '#749f83' - - '#ca8622' - - '#bda29a' - - '#6e7074' - - '#546570' - - '#c4ccd3' - cross_filters_enabled: false - native_filter_configuration: - - id: NATIVE_FILTER-5vyW3SgU5 - controlValues: - enableEmptyFilter: false - name: Time grain - filterType: filter_timegrain - targets: - - datasetUuid: fda98ab8-f550-45f1-9ded-0113f3e67260 - defaultDataMask: - extraFormData: {} - filterState: {} - ownState: {} - cascadeParentIds: [] - scope: - rootPath: - - TAB-6zE8noCIsx - excluded: - - 7 - type: NATIVE_FILTER - description: '' -version: 1.0.0 diff --git a/dff/config/superset_dashboard/dashboards/DFF_statistics_dashboard_1.yaml b/dff/config/superset_dashboard/dashboards/DFF_statistics_dashboard_1.yaml new file mode 100644 index 000000000..ce8e32496 --- /dev/null +++ b/dff/config/superset_dashboard/dashboards/DFF_statistics_dashboard_1.yaml @@ -0,0 +1,1291 @@ +dashboard_title: DFF statistics dashboard +description: null +css: '' +slug: dff-stats +uuid: 68bce374-99bc-4890-b8c2-cb172409b894 +position: + CHART-91whs_IaiF: + children: [] + id: CHART-91whs_IaiF + meta: + chartId: 17 + height: 50 + sliceName: Requests + uuid: 45ef67db-d33d-49f5-8d46-1f0fa518eaac + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-Gw0Ffh1lG + - ROW-oXaTD35jB + type: CHART + CHART-Af3zvLsiKV: + children: [] + id: CHART-Af3zvLsiKV + meta: + chartId: 8 + height: 66 + sliceName: Node visit ratio monitor + uuid: 6fafe59c-0fec-4cd8-a8b3-c0bfaffb2135 + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-6zE8noCIsx + - ROW-7g6_n72hZ + type: CHART + CHART-CuCYDOlGEu: + children: [] + id: CHART-CuCYDOlGEu + meta: + chartId: 14 + height: 42 + sliceName: Table + sliceNameOverride: Raw data + uuid: 38d353dc-c0ef-41a0-97c7-3dcbebab9e02 + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-JCU6rANFP + - ROW-EaYAQjv4W + type: CHART + CHART-DxY0c3RnIv: + children: [] + id: CHART-DxY0c3RnIv + meta: + chartId: 3 + height: 61 + sliceName: Node counts + sliceNameOverride: General node visit distribution + uuid: 0c47c7b5-f500-46cb-97e3-9ebb637f0c8a + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-Gw0Ffh1lG + - ROW-WirNNBBom + type: CHART + CHART-cxqeW2rGoV: + children: [] + id: CHART-cxqeW2rGoV + meta: + chartId: 7 + height: 50 + sliceName: Node Visits + sliceNameOverride: Node per dialog turn distribution + uuid: 44f4ab9d-5072-4926-a6ed-8615fb81b3d0 + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-Gw0Ffh1lG + - ROW-hNOZdWZpw + type: CHART + CHART-eZttETxtot: + children: [] + id: CHART-eZttETxtot + meta: + chartId: 16 + height: 50 + sliceName: Responses + uuid: 7844eb6d-4fce-44cf-8994-fb61a221a2ab + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-Gw0Ffh1lG + - ROW-lvxd9vvnS5 + type: CHART + CHART-explore-10-1: + children: [] + id: CHART-explore-10-1 + meta: + chartId: 10 + height: 73 + sliceName: Transition layout + sliceNameOverride: Weighted transition graph + uuid: 801e8c66-f693-46e3-a9a5-7b2b0b08a4a7 + width: 6 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-JCU6rANFP + - ROW-Ccs1FbcI- + type: CHART + CHART-explore-13-1: + children: [] + id: CHART-explore-13-1 + meta: + chartId: 11 + height: 74 + sliceName: Transition ratio [chord] + sliceNameOverride: Weighted transition graph [chord plot] + uuid: 388d2359-8d13-4795-8dc9-1cb5dfa92ee1 + width: 6 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-JCU6rANFP + - ROW-Ccs1FbcI- + type: CHART + CHART-explore-14-1: + children: [] + id: CHART-explore-14-1 + meta: + chartId: 5 + height: 105 + sliceName: Node visits [sunburst] + sliceNameOverride: Node visit distribution [sunburst] + uuid: e955f48c-824c-423c-a11c-5b5dca162927 + width: 6 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-Gw0Ffh1lG + - ROW-uSb7snkjI + type: CHART + CHART-explore-15-1: + children: [] + id: CHART-explore-15-1 + meta: + chartId: 2 + height: 50 + sliceName: Current topic [time series bar chart] + sliceNameOverride: Current topic slot [time series bar chart] + uuid: f8215b4d-cdaf-489a-90b2-040da840ab35 + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-q4CdGUDlq + - ROW-s_aeCbvt3 + type: CHART + CHART-explore-16-1: + children: [] + id: CHART-explore-16-1 + meta: + chartId: 4 + height: 50 + sliceName: Current topic slot [bar chart] + uuid: a70c05d0-770b-4068-a55d-934283f5b1bb + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-q4CdGUDlq + - ROW-IsV-8cS3Z + type: CHART + CHART-explore-17-1: + children: [] + id: CHART-explore-17-1 + meta: + chartId: 1 + height: 50 + sliceName: Rating slot [line chart] + uuid: 128e1da2-1efd-433d-9b93-a07de175e2bc + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-q4CdGUDlq + - ROW-TZwRV0tZy + type: CHART + CHART-explore-21-1: + children: [] + id: CHART-explore-21-1 + meta: + chartId: 13 + height: 60 + sliceName: Flow visit ratio monitor + uuid: ba02528b-184b-4304-b027-f2b7d9011ab0 + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-6zE8noCIsx + - ROW-ZTVWOu2o0 + type: CHART + CHART-explore-22-1: + children: [] + id: CHART-explore-22-1 + meta: + chartId: 15 + height: 61 + sliceName: Terminal labels + sliceNameOverride: Terminal labels monitor + uuid: cf066e41-a9e8-4f54-a875-ebf4da350b59 + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-6zE8noCIsx + - ROW-LhKWfqM7V + type: CHART + CHART-explore-9-1: + children: [] + id: CHART-explore-9-1 + meta: + chartId: 6 + height: 105 + sliceName: Node visits [ratio] + sliceNameOverride: Node visit distribution [ratio] + uuid: f9fb7893-3533-4519-bbc4-1f4853f380e1 + width: 6 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-Gw0Ffh1lG + - ROW-uSb7snkjI + type: CHART + CHART-mYC2udeF3a: + children: [] + id: CHART-mYC2udeF3a + meta: + chartId: 9 + height: 50 + sliceName: Service load [users] + uuid: b5d43314-514c-464e-9fcc-f897e3ae0963 + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-6zE8noCIsx + - ROW-Ae7v1prsp2 + type: CHART + CHART-wci7CHiza6: + children: [] + id: CHART-wci7CHiza6 + meta: + chartId: 12 + height: 66 + sliceName: Transition counts + sliceNameOverride: General transitions distribution + uuid: 9fcc7cc1-9257-4c0d-b377-b3a60a8bf3df + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-Gw0Ffh1lG + - ROW-UiCWq3ix1 + type: CHART + DASHBOARD_VERSION_KEY: v2 + GRID_ID: + children: + - TABS-Xoi5oUBxZI + id: GRID_ID + parents: + - ROOT_ID + type: GRID + HEADER_ID: + id: HEADER_ID + meta: + text: DFF statistics dashboard + type: HEADER + MARKDOWN-8Q9BhcEwva: + children: [] + id: MARKDOWN-8Q9BhcEwva + meta: + code: '## Current topic + + + Assuming that we extract the current topic as a slot on each dialog turn, + we can build a bar chart to see how various dialog topics are distributed. + The first of the two charts below aggregates the counts over dialog turns, + while the second one displays the distribution over time.' + height: 20 + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-q4CdGUDlq + - ROW-K0fThyfqJq + type: MARKDOWN + MARKDOWN-HncT4Y_WmV: + children: [] + id: MARKDOWN-HncT4Y_WmV + meta: + code: '## Flow visit ratio monitor + + + This chart aggregates the ratio of visits for each flow over the whole period + of service uptime. The aggregation period can be set using the filters on the left.' + height: 17 + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-6zE8noCIsx + - ROW-klrE6Idjlp + type: MARKDOWN + MARKDOWN-LyRuvHp-7m: + children: [] + id: MARKDOWN-LyRuvHp-7m + meta: + code: '## Weighted transition graph + + + The two weighted transition graphs emphasize the most frequently visited nodes + and transitions, effectively demonstrating the most popular routes inside + the dialog graph. + + + This can reveal characteristic features of user behavior given the current + dialog structure. + + +
+ + ' + height: 24 + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-JCU6rANFP + - ROW-FMNDn-yXPC + type: MARKDOWN + MARKDOWN-NXluIKVHl5: + children: [] + id: MARKDOWN-NXluIKVHl5 + meta: + code: '# Annotations + + + Annotations are values that your conversational service derives from user + requests and stores in the `Context` object. They are produced by `PROCESSING` + functions and by some supplemental services in the `Pipeline`. + + + To make them available in the dashboard, you need to define a custom extractor + function for them (see the [Extractor functions](https://deeppavlov.github.io/dialog_flow_framework/tutorials/tutorials.stats.1_extractor_functions.html) ). + The output of that function will then be persisted to the `data` column of + the logs table, while the name of the function will be available in the `data + key` column. That makes it easy to filter the relevant log entries and use + them to build a Superset chart. + + + If you need custom charts, consult the official Superset documentation for + instructions on how to create those: [link](https://superset.apache.org/docs/creating-charts-dashboards/exploring-data/#pivot-table). + + + It''s important to keep in mind that `data` is a JSON column, which is why + you need to specify your own `custom sql` expression to get the relevant value. + + + ```sql + + JSON_VALUE(data, ''$.key.nested_key'') + + ``` + + + Additionally, you may need to cast the extracted string to a numeric datatype + like below to use certain aggregation functions. + + ```sql + + AVG(CAST(JSON_VALUE(data, ''$.key'') AS Int16)) + + ``` + + + **Note that the charts below will only display meaningful figures if the respective + annotation values have been collected. To get those, run the sample data + provider script located in the `utils/stats/` folder.**' + height: 63 + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-q4CdGUDlq + - ROW-efGgRzySlP + type: MARKDOWN + MARKDOWN-Ne7griq2wJ: + children: [] + id: MARKDOWN-Ne7griq2wJ + meta: + code: '## Node per dialog turn distribution + + + This bar chart aggregates node labels over dialog turns. Not only does this + show the average dialog length, but it also allows you to observe + whether the path that users take on average deviates from the happy + path that you plan for the users. + +
+ + ' + height: 24 + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-Gw0Ffh1lG + - ROW-tzfO7Zd-dD + type: MARKDOWN + MARKDOWN-OCNK7Q0hyn: + children: [] + id: MARKDOWN-OCNK7Q0hyn + meta: + code: "## Rating slot\n\nLet's assume that you have a service that extracts\ + \ ratings from user requests as a numeric variable. Much like the previous\ + \ example, you can employ a variety of charts to analyze this data, such as\ + \ line charts or box plots. \n\nNote that to reproduce the chart below the\ + \ value will have to be cast to Int16 or to some other numeric datatype to\ + \ find the average.\n\n```sql\nAVG(CAST(JSON_VALUE(data, '$.key') AS Int16))\n\ + ```" + height: 33 + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-q4CdGUDlq + - ROW-Hcn9FCMH6a + type: MARKDOWN + MARKDOWN-PY70BXaRGq: + children: [] + id: MARKDOWN-PY70BXaRGq + meta: + code: "# Overview\n\nThe `overview` section is a generalized representation\ + \ of the data related to your service. It allows you to inspect raw data entries\ + \ or to observe some general trends using weighted charts based on the dialog\ + \ graph.\n\n## Raw data\n\nRaw data shows unaggregated data points as a table.\ + \ \nThe `data` column offers a closer view of the collected keys and labels\ + \ in the form of JSON objects.\n\n
\n" + height: 33 + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-JCU6rANFP + - ROW-R1SOLtdPpz + type: MARKDOWN + MARKDOWN-XuW-kEED70: + children: [] + id: MARKDOWN-XuW-kEED70 + meta: + code: '# Node statistics + + + The `Node statistics` section mostly contains data related to how frequently + individual nodes are visited with the aim of providing you insights on how + well distinct parts of the graph function. + + + ## Node visits distribution + + + The charts below display the number of times that the flows and nodes of the + dialog graph were visited during graph traversal. These statistics are supposed + to help the developers better understand the importance of any particular + node inside the graph.' + height: 35 + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-Gw0Ffh1lG + - ROW-t7PnH6oKHU + type: MARKDOWN + MARKDOWN-aXRTn3gE5x: + children: [] + id: MARKDOWN-aXRTn3gE5x + meta: + code: '## Transitions distribution + + + The chart below shows how frequently each of the graph edges is traversed + by various users. + Based on this information, you can determine which transitions inside the + dialog graph function as intended. + + You can use the `Node` filter on the left + to select a slice of transitions that target a specific node. + +
' + height: 24 + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-Gw0Ffh1lG + - ROW-y6AC1wLv1j + type: MARKDOWN + MARKDOWN-i9daMe46XY: + children: [] + id: MARKDOWN-i9daMe46XY + meta: + code: '## Requests and responses + + + The table charts below make it possible to explore the user requests and bot + responses produced in the scope of your conversational service. You can also + use the `Dialog turn` and `User ID` filters on the left to only consider the + requests produced by a particular user or requests sent on a specific dialog turn. + + + Functions `get_last_request` and `get_last_response` need to be used to collect + the data.' + height: 26 + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-Gw0Ffh1lG + - ROW-DKYV2zUmwU + type: MARKDOWN + MARKDOWN-pmSRDxroDW: + children: [] + id: MARKDOWN-pmSRDxroDW + meta: + code: '## Terminal labels monitor + + + The following chart dynamically measures which nodes appear the most as a + finishing point in the dialog, e.g. what are the dialog turns, after which + the users quit the conversation. This chart is very useful, since it allows + you to trace potentially unwanted behavior and see if any of the bot messages + is discouraging users from further interaction.' + height: 21 + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-6zE8noCIsx + - ROW-j6eWWjqran + type: MARKDOWN + MARKDOWN-w66E2L3xdo: + children: [] + id: MARKDOWN-w66E2L3xdo + meta: + code: '## Node visit ratio monitor + + + Like the `Flow visit ratio monitor`, the node visit ratio monitor aggregates + node visits over time, showing the proportion of unique users visiting each + node of the graph at a given moment in time. For instance, this can demonstrate + how the dynamics of user load change after some changes are made to the graph, + e.g. nodes are added or deleted. The length of time spans can be regulated + using filters.' + height: 26 + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-6zE8noCIsx + - ROW-CBSQJNAfEV + type: MARKDOWN + MARKDOWN-zISK-3R8Ta: + children: [] + id: MARKDOWN-zISK-3R8Ta + meta: + code: '# Service statistics + + + This section contains charts that aggregate statistics over time, covering + the whole uptime of the service. They can be of big help, when the task is + to trace the changes in user behavior when new features or fixes are being + introduced. + + + ## Service users + + + This plot aggregates the count of unique users querying the DFF service at + any given point in time. The time periods to aggregate over can be changed + using the filter on the left. + + ' + height: 35 + width: 12 + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-6zE8noCIsx + - ROW-zC6DVrW4wu + type: MARKDOWN + ROOT_ID: + children: + - GRID_ID + id: ROOT_ID + type: ROOT + ROW-7g6_n72hZ: + children: + - CHART-Af3zvLsiKV + id: ROW-7g6_n72hZ + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-6zE8noCIsx + type: ROW + ROW-Ae7v1prsp2: + children: + - CHART-mYC2udeF3a + id: ROW-Ae7v1prsp2 + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-6zE8noCIsx + type: ROW + ROW-CBSQJNAfEV: + children: + - MARKDOWN-w66E2L3xdo + id: ROW-CBSQJNAfEV + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-6zE8noCIsx + type: ROW + ROW-Ccs1FbcI-: + children: + - CHART-explore-10-1 + - CHART-explore-13-1 + id: ROW-Ccs1FbcI- + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-JCU6rANFP + type: ROW + ROW-DKYV2zUmwU: + children: + - MARKDOWN-i9daMe46XY + id: ROW-DKYV2zUmwU + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-Gw0Ffh1lG + type: ROW + ROW-EaYAQjv4W: + children: + - CHART-CuCYDOlGEu + id: ROW-EaYAQjv4W + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-JCU6rANFP + type: ROW + ROW-FMNDn-yXPC: + children: + - MARKDOWN-LyRuvHp-7m + id: ROW-FMNDn-yXPC + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-JCU6rANFP + type: ROW + ROW-Hcn9FCMH6a: + children: + - MARKDOWN-OCNK7Q0hyn + id: ROW-Hcn9FCMH6a + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-q4CdGUDlq + type: ROW + ROW-IsV-8cS3Z: + children: + - CHART-explore-16-1 + id: ROW-IsV-8cS3Z + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-q4CdGUDlq + type: ROW + ROW-K0fThyfqJq: + children: + - MARKDOWN-8Q9BhcEwva + id: ROW-K0fThyfqJq + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-q4CdGUDlq + type: ROW + ROW-LhKWfqM7V: + children: + - CHART-explore-22-1 + id: ROW-LhKWfqM7V + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-6zE8noCIsx + type: ROW + ROW-R1SOLtdPpz: + children: + - MARKDOWN-PY70BXaRGq + id: ROW-R1SOLtdPpz + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-JCU6rANFP + type: ROW + ROW-TZwRV0tZy: + children: + - CHART-explore-17-1 + id: ROW-TZwRV0tZy + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-q4CdGUDlq + type: ROW + ROW-UiCWq3ix1: + children: + - CHART-wci7CHiza6 + id: ROW-UiCWq3ix1 + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-Gw0Ffh1lG + type: ROW + ROW-WirNNBBom: + children: + - CHART-DxY0c3RnIv + id: ROW-WirNNBBom + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-Gw0Ffh1lG + type: ROW + ROW-ZTVWOu2o0: + children: + - CHART-explore-21-1 + id: ROW-ZTVWOu2o0 + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-6zE8noCIsx + type: ROW + ROW-efGgRzySlP: + children: + - MARKDOWN-NXluIKVHl5 + id: ROW-efGgRzySlP + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-q4CdGUDlq + type: ROW + ROW-hNOZdWZpw: + children: + - CHART-cxqeW2rGoV + id: ROW-hNOZdWZpw + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-Gw0Ffh1lG + type: ROW + ROW-j6eWWjqran: + children: + - MARKDOWN-pmSRDxroDW + id: ROW-j6eWWjqran + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-6zE8noCIsx + type: ROW + ROW-klrE6Idjlp: + children: + - MARKDOWN-HncT4Y_WmV + id: ROW-klrE6Idjlp + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-6zE8noCIsx + type: ROW + ROW-lvxd9vvnS5: + children: + - CHART-eZttETxtot + id: ROW-lvxd9vvnS5 + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-Gw0Ffh1lG + type: ROW + ROW-oXaTD35jB: + children: + - CHART-91whs_IaiF + id: ROW-oXaTD35jB + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-Gw0Ffh1lG + type: ROW + ROW-s_aeCbvt3: + children: + - CHART-explore-15-1 + id: ROW-s_aeCbvt3 + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-q4CdGUDlq + type: ROW + ROW-t7PnH6oKHU: + children: + - MARKDOWN-XuW-kEED70 + id: ROW-t7PnH6oKHU + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-Gw0Ffh1lG + type: ROW + ROW-tzfO7Zd-dD: + children: + - MARKDOWN-Ne7griq2wJ + id: ROW-tzfO7Zd-dD + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-Gw0Ffh1lG + type: ROW + ROW-uSb7snkjI: + children: + - CHART-explore-9-1 + - CHART-explore-14-1 + id: ROW-uSb7snkjI + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-Gw0Ffh1lG + type: ROW + ROW-y6AC1wLv1j: + children: + - MARKDOWN-aXRTn3gE5x + id: ROW-y6AC1wLv1j + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-Gw0Ffh1lG + type: ROW + ROW-zC6DVrW4wu: + children: + - MARKDOWN-zISK-3R8Ta + id: ROW-zC6DVrW4wu + meta: + background: BACKGROUND_TRANSPARENT + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + - TAB-6zE8noCIsx + type: ROW + TAB-6zE8noCIsx: + children: + - ROW-zC6DVrW4wu + - ROW-Ae7v1prsp2 + - ROW-klrE6Idjlp + - ROW-ZTVWOu2o0 + - ROW-CBSQJNAfEV + - ROW-7g6_n72hZ + - ROW-j6eWWjqran + - ROW-LhKWfqM7V + id: TAB-6zE8noCIsx + meta: + defaultText: Tab title + placeholder: Tab title + text: Service statistics + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + type: TAB + TAB-Gw0Ffh1lG: + children: + - ROW-t7PnH6oKHU + - ROW-uSb7snkjI + - ROW-WirNNBBom + - ROW-y6AC1wLv1j + - ROW-UiCWq3ix1 + - ROW-tzfO7Zd-dD + - ROW-hNOZdWZpw + - ROW-DKYV2zUmwU + - ROW-oXaTD35jB + - ROW-lvxd9vvnS5 + id: TAB-Gw0Ffh1lG + meta: + defaultText: Tab title + placeholder: Tab title + text: Node statistics + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + type: TAB + TAB-JCU6rANFP: + children: + - ROW-R1SOLtdPpz + - ROW-EaYAQjv4W + - ROW-FMNDn-yXPC + - ROW-Ccs1FbcI- + id: TAB-JCU6rANFP + meta: + defaultText: Tab title + placeholder: Tab title + text: Overview + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + type: TAB + TAB-q4CdGUDlq: + children: + - ROW-efGgRzySlP + - ROW-K0fThyfqJq + - ROW-IsV-8cS3Z + - ROW-s_aeCbvt3 + - ROW-Hcn9FCMH6a + - ROW-TZwRV0tZy + id: TAB-q4CdGUDlq + meta: + defaultText: Tab title + placeholder: Tab title + text: Annotations + parents: + - ROOT_ID + - GRID_ID + - TABS-Xoi5oUBxZI + type: TAB + TABS-Xoi5oUBxZI: + children: + - TAB-JCU6rANFP + - TAB-Gw0Ffh1lG + - TAB-6zE8noCIsx + - TAB-q4CdGUDlq + id: TABS-Xoi5oUBxZI + meta: {} + parents: + - ROOT_ID + - GRID_ID + type: TABS +metadata: + color_scheme: echarts4Colors + label_colors: {} + shared_label_colors: + '0': '#c23531' + '1': '#2f4554' + '2': '#546570' + '3': '#c4ccd3' + '4': '#c23531' + '5': '#2f4554' + '6': '#61a0a8' + '7': '#d48265' + '8': '#91c7ae' + '9': '#749f83' + '10': '#61a0a8' + '11': '#d48265' + '12': '#91c7ae' + timed_refresh_immune_slices: [] + expanded_slices: {} + refresh_frequency: 1800 + show_native_filters: true + default_filters: '{}' + chart_configuration: {} + color_scheme_domain: + - '#c23531' + - '#2f4554' + - '#61a0a8' + - '#d48265' + - '#91c7ae' + - '#749f83' + - '#ca8622' + - '#bda29a' + - '#6e7074' + - '#546570' + - '#c4ccd3' + cross_filters_enabled: false + native_filter_configuration: + - id: NATIVE_FILTER-5vyW3SgU5 + controlValues: + enableEmptyFilter: false + name: Time grain + filterType: filter_timegrain + targets: + - datasetUuid: fda98ab8-f550-45f1-9ded-0113f3e67260 + defaultDataMask: + extraFormData: + time_grain_sqla: PT1M + filterState: + label: Minute + value: + - PT1M + cascadeParentIds: [] + scope: + rootPath: + - TAB-6zE8noCIsx + excluded: + - 5 + type: NATIVE_FILTER + description: '' + chartsInScope: + - 2 + - 4 + - 7 + - 13 + tabsInScope: + - TAB-6zE8noCIsx + - id: NATIVE_FILTER-k81Ybg31L + controlValues: + enableEmptyFilter: false + name: Time range + filterType: filter_time + targets: + - {} + defaultDataMask: + extraFormData: + time_range: 'DATEADD(DATETIME("now"), -1, day) : now' + filterState: + value: 'DATEADD(DATETIME("now"), -1, day) : now' + cascadeParentIds: [] + scope: + rootPath: + - TAB-6zE8noCIsx + excluded: [] + type: NATIVE_FILTER + description: '' + chartsInScope: + - 1 + - 2 + - 3 + - 4 + - 6 + - 8 + - 9 + - 10 + - 12 + - 13 + - 14 + - 15 + tabsInScope: + - TAB-6zE8noCIsx + - TAB-Gw0Ffh1lG + - TAB-JCU6rANFP + - id: NATIVE_FILTER-Q_v9J5gqV + controlValues: + enableEmptyFilter: false + name: History + filterType: filter_range + targets: + - column: + name: request_id + datasetUuid: fda98ab8-f550-45f1-9ded-0113f3e67260 + defaultDataMask: + extraFormData: {} + filterState: {} + ownState: {} + cascadeParentIds: [] + scope: + rootPath: + - TAB-Gw0Ffh1lG + excluded: [] + type: NATIVE_FILTER + description: '' + chartsInScope: + - 1 + - 3 + - 6 + - 9 + - 10 + tabsInScope: + - TAB-Gw0Ffh1lG + - id: NATIVE_FILTER-EGnz5obeE + controlValues: + enableEmptyFilter: false + defaultToFirstItem: false + multiSelect: true + searchAllOptions: false + inverseSelection: false + name: User id + filterType: filter_select + targets: + - column: + name: context_id + datasetUuid: fda98ab8-f550-45f1-9ded-0113f3e67260 + defaultDataMask: + extraFormData: {} + filterState: {} + ownState: {} + cascadeParentIds: [] + scope: + rootPath: + - TAB-Gw0Ffh1lG + - TAB-q4CdGUDlq + - TAB-JCU6rANFP + excluded: [] + type: NATIVE_FILTER + description: '' + chartsInScope: + - 1 + - 3 + - 6 + - 8 + - 9 + - 10 + - 12 + - 14 + - 15 + - 16 + - 17 + tabsInScope: + - TAB-Gw0Ffh1lG + - TAB-JCU6rANFP + - TAB-q4CdGUDlq + - id: NATIVE_FILTER-BU7iNmYAX + adhoc_filters: + - expressionType: SQL + sqlExpression: label <> '' + clause: WHERE + subject: null + operator: null + comparator: null + isExtra: false + isNew: false + datasourceWarning: false + filterOptionName: filter_68jo660l3a3_xn0lv9ghc2i + time_range: No filter + controlValues: + enableEmptyFilter: false + defaultToFirstItem: false + multiSelect: true + searchAllOptions: false + inverseSelection: false + name: Node + filterType: filter_select + targets: + - column: + name: label + datasetUuid: fda98ab8-f550-45f1-9ded-0113f3e67260 + defaultDataMask: + extraFormData: {} + filterState: {} + ownState: {} + cascadeParentIds: [] + scope: + rootPath: + - TAB-Gw0Ffh1lG + - TAB-q4CdGUDlq + excluded: [] + type: NATIVE_FILTER + description: '' + chartsInScope: + - 1 + - 3 + - 6 + - 9 + - 10 + - 15 + - 16 + - 17 + tabsInScope: + - TAB-Gw0Ffh1lG + - TAB-q4CdGUDlq + stagger_refresh: true +version: 1.0.0 diff --git a/dff/config/superset_dashboard/datasets/dff_database/dff_final_nodes.yaml b/dff/config/superset_dashboard/datasets/dff_database/dff_final_nodes.yaml index a07fdd800..4a8628298 100644 --- a/dff/config/superset_dashboard/datasets/dff_database/dff_final_nodes.yaml +++ b/dff/config/superset_dashboard/datasets/dff_database/dff_final_nodes.yaml @@ -5,14 +5,7 @@ default_endpoint: null offset: 0 cache_timeout: null schema: test -sql: "\nWITH main AS (\n SELECT LogAttributes['context_id'] AS context_id,\n \ - \ max(LogAttributes['request_id']) AS max_history\n FROM otel_logs\nGROUP BY\ - \ context_id\n)\nSELECT DISTINCT LogAttributes['context_id'] AS context_id,\nLogAttributes['request_id']\ - \ AS request_id,\notel_logs.Timestamp AS start_time,\nJSON_VALUE(otel_logs.Body,\ - \ '$.label') AS label,\nJSON_VALUE(otel_logs.Body, '$.flow') AS flow_label,\nJSON_VALUE(otel_logs.Body,\ - \ '$.node') AS node_label\nFROM otel_logs\nINNER JOIN main\nON context_id = main.context_id\n\ - AND request_id = main.max_history\nINNER JOIN otel_traces\nON otel_logs.TraceId\ - \ = otel_traces.TraceId\nWHERE otel_traces.SpanName = 'get_current_label'\n" +sql: null params: null template_params: null filter_select_enabled: false @@ -33,7 +26,7 @@ columns: verbose_name: null is_dttm: true is_active: true - type: DateTime64(9) + type: DateTime advanced_data_type: null groupby: true filterable: true @@ -81,7 +74,7 @@ columns: verbose_name: null is_dttm: false is_active: true - type: String + type: Nullable(UInt64) advanced_data_type: null groupby: true filterable: true diff --git a/dff/config/superset_dashboard/datasets/dff_database/dff_node_stats.yaml b/dff/config/superset_dashboard/datasets/dff_database/dff_node_stats.yaml index 5ddab7c69..4e2cc5792 100644 --- a/dff/config/superset_dashboard/datasets/dff_database/dff_node_stats.yaml +++ b/dff/config/superset_dashboard/datasets/dff_database/dff_node_stats.yaml @@ -5,17 +5,7 @@ default_endpoint: null offset: 0 cache_timeout: null schema: test -sql: "\nWITH main AS (\n SELECT DISTINCT otel_logs.LogAttributes['context_id']\ - \ as context_id,\n otel_logs.LogAttributes['request_id'] as request_id,\n \ - \ otel_traces.Timestamp as start_time,\n otel_traces.SpanName as data_key,\n\ - \ otel_logs.Body as data,\n JSON_VALUE(otel_logs.Body, '$.label') as label,\n\ - \ JSON_VALUE(otel_logs.Body, '$.flow') as flow_label,\n JSON_VALUE(otel_logs.Body,\ - \ '$.node') as node_label,\n otel_logs.TraceId as trace_id,\n otel_traces.TraceId\n\ - FROM otel_logs, otel_traces\n WHERE otel_logs.TraceId = otel_traces.TraceId and\ - \ otel_traces.SpanName = 'get_current_label'\n ORDER BY context_id, request_id\n\ - ) SELECT context_id,\n request_id,\n start_time,\n data_key,\n data,\n\ - \ label,\n neighbor(label, -1) as prev_label,\n flow_label,\n node_label\n\ - FROM main\nWHERE label != ''\n" +sql: null params: null template_params: null filter_select_enabled: false @@ -80,6 +70,18 @@ columns: description: null python_date_format: null extra: {} +- column_name: prev_flow + verbose_name: null + is_dttm: false + is_active: true + type: String + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: {} - column_name: flow_label verbose_name: null is_dttm: false @@ -108,7 +110,7 @@ columns: verbose_name: null is_dttm: false is_active: true - type: String + type: Nullable(UInt64) advanced_data_type: null groupby: true filterable: true diff --git a/dff/config/superset_dashboard/datasets/dff_database/dff_stats.yaml b/dff/config/superset_dashboard/datasets/dff_database/dff_stats.yaml new file mode 100644 index 000000000..6f1efe683 --- /dev/null +++ b/dff/config/superset_dashboard/datasets/dff_database/dff_stats.yaml @@ -0,0 +1,146 @@ +table_name: dff_stats +main_dttm_col: null +description: null +default_endpoint: null +offset: 0 +cache_timeout: null +schema: test +sql: null +params: null +template_params: null +filter_select_enabled: false +fetch_values_predicate: null +extra: null +uuid: 8ba2e188-2bf8-4809-a5ee-2477a539d493 +metrics: +- metric_name: count + verbose_name: null + metric_type: null + expression: count(*) + description: null + d3format: null + extra: {} + warning_text: null +columns: +- column_name: data_key + verbose_name: null + is_dttm: false + is_active: true + type: LowCardinality(String) + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: {} +- column_name: start_time + verbose_name: null + is_dttm: true + is_active: true + type: DateTime + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: {} +- column_name: node_label + verbose_name: null + is_dttm: false + is_active: true + type: String + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: {} +- column_name: prev_label + verbose_name: null + is_dttm: false + is_active: true + type: String + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: {} +- column_name: flow_label + verbose_name: null + is_dttm: false + is_active: true + type: String + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: {} +- column_name: context_id + verbose_name: null + is_dttm: false + is_active: true + type: String + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: {} +- column_name: request_id + verbose_name: null + is_dttm: false + is_active: true + type: Nullable(UInt64) + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: {} +- column_name: prev_flow + verbose_name: null + is_dttm: false + is_active: true + type: String + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: {} +- column_name: data + verbose_name: null + is_dttm: false + is_active: true + type: String + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: {} +- column_name: label + verbose_name: null + is_dttm: false + is_active: true + type: String + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: {} +version: 1.0.0 +database_uuid: ee32f76e-55e3-483a-935a-22d03072db23 diff --git a/dff/config/superset_dashboard/metadata.yaml b/dff/config/superset_dashboard/metadata.yaml index b68dadba1..421997817 100644 --- a/dff/config/superset_dashboard/metadata.yaml +++ b/dff/config/superset_dashboard/metadata.yaml @@ -1,3 +1,3 @@ version: 1.0.0 type: Dashboard -timestamp: '2023-07-25T14:27:32.324677+00:00' +timestamp: '2023-09-15T11:46:43.125179+00:00' diff --git a/dff/stats/__main__.py b/dff/stats/__main__.py index 396273ea2..92ca42e87 100644 --- a/dff/stats/__main__.py +++ b/dff/stats/__main__.py @@ -73,6 +73,7 @@ def main(parsed_args: Optional[argparse.Namespace] = None): parser.add_argument("-dn", "--db.name", help="Name of the database.") parser.add_argument("-dt", "--db.table", default="otel_logs", help="Name of the table.") parser.add_argument("-o", "--outfile", help="Optionally persist the configuration as a zip file.") + parser.add_argument("-i", "--infile", help="Configuration zip file to import.") parser.add_argument("-H", "--host", default="localhost", help="Superset host") parser.add_argument("-p", "--port", default="8088", help="Superset port.") parser.add_argument("-U", "--username", required=True, help="Superset user.") @@ -100,11 +101,18 @@ def main(parsed_args: Optional[argparse.Namespace] = None): if parsed_args is None: parsed_args = parser.parse_args(sys.argv[1:]) - outfile = make_zip_config(parsed_args) - import_dashboard(parsed_args, zip_file=str(outfile)) + file = None + use_infile = hasattr(parsed_args, "infile") and parsed_args.infile is not None + use_outfile = hasattr(parsed_args, "outfile") and parsed_args.outfile is not None + if not use_infile: + file = make_zip_config(parsed_args) + else: + file = parsed_args.infile - if not hasattr(parsed_args, "outfile") or parsed_args.outfile is None: - outfile.unlink() + import_dashboard(parsed_args, zip_file=str(file)) + + if not use_infile and not use_outfile: + file.unlink() if __name__ == "__main__": diff --git a/dff/stats/cli.py b/dff/stats/cli.py index 20058a990..2b881b00d 100644 --- a/dff/stats/cli.py +++ b/dff/stats/cli.py @@ -4,6 +4,7 @@ This modules defines commands that can be called via the command line interface. """ +from uuid import uuid4 import tempfile import shutil import sys @@ -60,7 +61,7 @@ DFF_NODE_STATS_STATEMENT = """ WITH main AS ( SELECT DISTINCT {table}.LogAttributes['context_id'] as context_id, - {table}.LogAttributes['request_id'] as request_id, + toUInt64OrNull({table}.LogAttributes['request_id']) as request_id, toDateTime(otel_traces.Timestamp) as start_time, otel_traces.SpanName as data_key, {table}.Body as data, @@ -69,7 +70,7 @@ {nodefield} as node_label, {table}.TraceId as trace_id, otel_traces.TraceId\nFROM {table}, otel_traces - WHERE {table}.TraceId = otel_traces.TraceId and otel_traces.SpanName = 'get_current_label' + WHERE {table}.TraceId = otel_traces.TraceId and data_key = 'get_current_label' ORDER BY context_id, request_id ) SELECT context_id, request_id, @@ -77,44 +78,47 @@ data_key, data, label, - {lag} as prev_label, + {label_lag} as prev_label, + {flow_lag} as prev_flow, flow_label, node_label FROM main -WHERE label != '' """ -DFF_ACYCLIC_NODES_STATEMENT = """ +DFF_STATS_STATEMENT = """ WITH main AS ( SELECT DISTINCT {table}.LogAttributes['context_id'] as context_id, - {table}.LogAttributes['request_id'] as request_id, - {table}.Timestamp as timestamp, - {lblfield} as label\nFROM {table} - INNER JOIN -( - WITH helper AS ( - SELECT DISTINCT {table}.LogAttributes['context_id'] as context_id, - {table}.LogAttributes['request_id'] as request_id, - {lblfield} as label - FROM {table} - ) - SELECT context_id FROM helper - GROUP BY context_id - HAVING COUNT(context_id) = COUNT(DISTINCT label) -) as plain_ctx -ON plain_ctx.context_id = context_id -ORDER by context_id, request_id -) -SELECT * FROM main + toUInt64OrNull({table}.LogAttributes['request_id']) as request_id, + toDateTime(otel_traces.Timestamp) as start_time, + otel_traces.SpanName as data_key, + {table}.Body as data, + {lblfield} as label, + {flowfield} as flow_label, + {nodefield} as node_label, + {table}.TraceId as trace_id, + otel_traces.TraceId\nFROM {table}, otel_traces + WHERE {table}.TraceId = otel_traces.TraceId + ORDER BY data_key, context_id, request_id +) SELECT context_id, + request_id, + start_time, + data_key, + data, + label, + {label_lag} as prev_label, + {flow_lag} as prev_flow, + flow_label, + node_label +FROM main """ DFF_FINAL_NODES_STATEMENT = """ WITH main AS ( SELECT LogAttributes['context_id'] AS context_id, - max(LogAttributes['request_id']) AS max_history + max(toUInt64OrNull(LogAttributes['request_id'])) AS max_history FROM {table}\nGROUP BY context_id ) SELECT DISTINCT LogAttributes['context_id'] AS context_id, -LogAttributes['request_id'] AS request_id, -{table}.Timestamp AS start_time, +toUInt64OrNull({table}.LogAttributes['request_id']) AS request_id, +toDateTime(otel_traces.Timestamp) AS start_time, {lblfield} AS label, {flowfield} AS flow_label, {nodefield} AS node_label @@ -128,7 +132,7 @@ """ SQL_STATEMENT_MAPPING = { - "dff_acyclic_nodes.yaml": DFF_ACYCLIC_NODES_STATEMENT, + "dff_stats.yaml": DFF_STATS_STATEMENT, "dff_node_stats.yaml": DFF_NODE_STATS_STATEMENT, "dff_final_nodes.yaml": DFF_FINAL_NODES_STATEMENT, } @@ -184,7 +188,7 @@ def make_zip_config(parsed_args: argparse.Namespace) -> Path: if hasattr(parsed_args, "outfile") and parsed_args.outfile: outfile_name = parsed_args.outfile else: - outfile_name = "temp.zip" + outfile_name = f"config_{str(uuid4())}.zip" file_conf = OmegaConf.load(parsed_args.file) sys.argv = [__file__] + [f"{key}={value}" for key, value in parsed_args.__dict__.items() if value] @@ -194,7 +198,12 @@ def make_zip_config(parsed_args: argparse.Namespace) -> Path: if OmegaConf.select(cli_conf, "db.driver") == "clickhousedb+connect": params = dict( table="${db.table}", - lag="neighbor(label, -1)", + label_lag="lagInFrame(label) OVER " + "(PARTITION BY context_id ORDER BY request_id ASC " + "ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)", + flow_lag="lagInFrame(flow_label) OVER " + "(PARTITION BY context_id ORDER BY request_id ASC " + "ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)", texttype="String", lblfield="JSON_VALUE(${db.table}.Body, '$.label')", flowfield="JSON_VALUE(${db.table}.Body, '$.flow')", diff --git a/dff/stats/default_extractors.py b/dff/stats/default_extractors.py index d48cd6d26..f90a3e3ad 100644 --- a/dff/stats/default_extractors.py +++ b/dff/stats/default_extractors.py @@ -13,18 +13,23 @@ from datetime import datetime from dff.script import Context -from dff.pipeline import ExtraHandlerRuntimeInfo +from dff.pipeline import ExtraHandlerRuntimeInfo, Pipeline from .utils import get_wrapper_field -async def get_current_label(ctx: Context, _, info: ExtraHandlerRuntimeInfo): +async def get_current_label(ctx: Context, pipeline: Pipeline, info: ExtraHandlerRuntimeInfo): """ Extract the current label on each turn. This function is required for running the dashboard with the default configuration. + + .. note:: + + Preferrably, it needs to be invoked as `after_handler` of the `Actor` service. + """ last_label = ctx.last_label if last_label is None: - return {"flow": None, "node": None, "label": None} + last_label = pipeline.actor.start_label[:2] return {"flow": last_label[0], "node": last_label[1], "label": ": ".join(last_label)} @@ -53,3 +58,33 @@ async def get_timing_after(ctx: Context, _, info: ExtraHandlerRuntimeInfo): # n start_time = ctx.framework_states[get_wrapper_field(info, "time")] data = {"execution_time": str(datetime.now() - start_time)} return data + + +async def get_last_response(ctx: Context, _, info: ExtraHandlerRuntimeInfo): + """ + Extract the text of the last response in the current context. + This handler is best used together with the `ACTOR` component. + + This function is required to enable charts that aggregate requests and responses. + """ + data = {"last_response": ctx.last_response.text} + return data + + +async def get_last_request(ctx: Context, _, info: ExtraHandlerRuntimeInfo): + """ + Extract the text of the last request in the current context. + This handler is best used together with the `ACTOR` component. + + This function is required to enable charts that aggregate requests and responses. + """ + data = {"last_request": ctx.last_request.text} + return data + + +__all__ = ["get_current_label", "get_timing_before", "get_timing_after", "get_last_request", "get_last_response"] +""" +List of exported functions. + +:meta hide-avlue: +""" diff --git a/dff/stats/instrumentor.py b/dff/stats/instrumentor.py index a053c532b..41f7c2ca5 100644 --- a/dff/stats/instrumentor.py +++ b/dff/stats/instrumentor.py @@ -62,7 +62,7 @@ class OtelInstrumentor(BaseInstrumentor): .. code-block:: @dff_instrumentor - def function(context, pipeline, runtime_info): + async def function(context, pipeline, runtime_info): ... :param logger_provider: Opentelemetry logger provider. Used to construct a logger instance. @@ -126,14 +126,12 @@ def _instrument(self, logger_provider=None, tracer_provider=None, meter_provider self._configure_providers( logger_provider=logger_provider, tracer_provider=tracer_provider, meter_provider=meter_provider ) - wrap_function_wrapper(default_extractors, "get_current_label", self.__call__.__wrapped__) - wrap_function_wrapper(default_extractors, "get_timing_before", self.__call__.__wrapped__) - wrap_function_wrapper(default_extractors, "get_timing_after", self.__call__.__wrapped__) + for func_name in default_extractors.__all__: + wrap_function_wrapper(default_extractors, func_name, self.__call__.__wrapped__) def _uninstrument(self, **kwargs): - unwrap(default_extractors, "get_current_label") - unwrap(default_extractors, "get_timing_before") - unwrap(default_extractors, "get_timing_after") + for func_name in default_extractors.__all__: + unwrap(default_extractors, func_name) def _configure_providers(self, logger_provider, tracer_provider, meter_provider): self._logger_provider = logger_provider or get_logger_provider() diff --git a/dff/utils/docker/dockerfile_stats b/dff/utils/docker/dockerfile_stats index 5017fd975..9c40071ea 100644 --- a/dff/utils/docker/dockerfile_stats +++ b/dff/utils/docker/dockerfile_stats @@ -2,5 +2,7 @@ FROM apache/superset:2.1.0rc1 USER root RUN cd /app && pip install .[clickhouse] COPY entrypoint_stats.sh /app/docker/ +COPY --chown=superset superset_config_docker.py /app/pythonpath/ +ENV SUPERSET_CONFIG_PATH /app/pythonpath/superset_config_docker.py USER superset ENTRYPOINT ["/bin/bash","/app/docker/entrypoint_stats.sh"] \ No newline at end of file diff --git a/dff/utils/docker/entrypoint_stats.sh b/dff/utils/docker/entrypoint_stats.sh index 663a39b75..cac946f7d 100644 --- a/dff/utils/docker/entrypoint_stats.sh +++ b/dff/utils/docker/entrypoint_stats.sh @@ -2,6 +2,7 @@ export SERVER_THREADS_AMOUNT=8 set -m nohup /bin/bash /usr/bin/run-server.sh & +sleep 5 superset fab create-admin --firstname superset --lastname admin --username $SUPERSET_USERNAME --email admin@admin.com --password $SUPERSET_PASSWORD superset db upgrade superset init diff --git a/dff/utils/docker/superset_config_docker.py b/dff/utils/docker/superset_config_docker.py new file mode 100644 index 000000000..ca138927f --- /dev/null +++ b/dff/utils/docker/superset_config_docker.py @@ -0,0 +1,32 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# +# This is an example "local" configuration file. In order to set/override config +# options that ONLY apply to your local environment, simply copy/rename this file +# to docker/pythonpath/superset_config_docker.py +# It ends up being imported by docker/superset_config.py which is loaded by +# superset/config.py +# +import os + +SQLALCHEMY_DATABASE_URI = "postgresql+psycopg2://{0}:{1}@dashboard-metadata:{2}/{3}".format( + os.getenv("POSTGRES_USERNAME"), + os.getenv("POSTGRES_PASSWORD"), + os.getenv("SUPERSET_METADATA_PORT"), + os.getenv("POSTGRES_DB"), +) diff --git a/dff/utils/testing/toy_script.py b/dff/utils/testing/toy_script.py index 78a3f0fb1..f035df047 100644 --- a/dff/utils/testing/toy_script.py +++ b/dff/utils/testing/toy_script.py @@ -62,3 +62,143 @@ :meta hide-value: """ + +MULTIFLOW_SCRIPT = { + "root": { + "start": { + RESPONSE: Message(text="Hi"), + TRANSITIONS: { + ("small_talk", "ask_some_questions"): exact_match(Message(text="hi")), + ("animals", "have_pets"): exact_match(Message(text="i like animals")), + ("animals", "like_animals"): exact_match(Message(text="let's talk about animals")), + ("news", "what_news"): exact_match(Message(text="let's talk about news")), + }, + }, + "fallback": {RESPONSE: Message(text="Oops")}, + }, + "animals": { + "have_pets": { + RESPONSE: Message(text="do you have pets?"), + TRANSITIONS: {"what_animal": exact_match(Message(text="yes"))}, + }, + "like_animals": { + RESPONSE: Message(text="do you like it?"), + TRANSITIONS: {"what_animal": exact_match(Message(text="yes"))}, + }, + "what_animal": { + RESPONSE: Message(text="what animals do you have?"), + TRANSITIONS: { + "ask_about_color": exact_match(Message(text="bird")), + "ask_about_breed": exact_match(Message(text="dog")), + }, + }, + "ask_about_color": {RESPONSE: Message(text="what color is it")}, + "ask_about_breed": { + RESPONSE: Message(text="what is this breed?"), + TRANSITIONS: { + "ask_about_breed": exact_match(Message(text="pereat")), + "tell_fact_about_breed": exact_match(Message(text="bulldog")), + "ask_about_training": exact_match(Message(text="I don't know")), + }, + }, + "tell_fact_about_breed": { + RESPONSE: Message(text="Bulldogs appeared in England as specialized bull-baiting dogs. "), + }, + "ask_about_training": {RESPONSE: Message(text="Do you train your dog? ")}, + }, + "news": { + "what_news": { + RESPONSE: Message(text="what kind of news do you prefer?"), + TRANSITIONS: { + "ask_about_science": exact_match(Message(text="science")), + "ask_about_sport": exact_match(Message(text="sport")), + }, + }, + "ask_about_science": { + RESPONSE: Message(text="i got news about science, do you want to hear?"), + TRANSITIONS: { + "science_news": exact_match(Message(text="yes")), + ("small_talk", "ask_some_questions"): exact_match(Message(text="let's change the topic")), + }, + }, + "science_news": { + RESPONSE: Message(text="This is science news"), + TRANSITIONS: { + "what_news": exact_match(Message(text="ok")), + ("small_talk", "ask_some_questions"): exact_match(Message(text="let's change the topic")), + }, + }, + "ask_about_sport": { + RESPONSE: Message(text="i got news about sport, do you want to hear?"), + TRANSITIONS: { + "sport_news": exact_match(Message(text="yes")), + ("small_talk", "ask_some_questions"): exact_match(Message(text="let's change the topic")), + }, + }, + "sport_news": { + RESPONSE: Message(text="This is sport news"), + TRANSITIONS: { + "what_news": exact_match(Message(text="ok")), + ("small_talk", "ask_some_questions"): exact_match(Message(text="let's change the topic")), + }, + }, + }, + "small_talk": { + "ask_some_questions": { + RESPONSE: Message(text="how are you"), + TRANSITIONS: { + "ask_talk_about": exact_match(Message(text="fine")), + ("animals", "like_animals"): exact_match(Message(text="let's talk about animals")), + ("news", "what_news"): exact_match(Message(text="let's talk about news")), + }, + }, + "ask_talk_about": { + RESPONSE: Message(text="what do you want to talk about"), + TRANSITIONS: { + ("animals", "like_animals"): exact_match(Message(text="dog")), + ("news", "what_news"): exact_match(Message(text="let's talk about news")), + }, + }, + }, +} +""" +Simple dialog with multiple flows. + +:meta hide-value: +""" + +MULTIFLOW_REQUEST_OPTIONS = { + "root": { + "start": [ + "hi", + "i like animals", + "let's talk about animals", + ] + }, + "animals": { + "have_pets": ["yes"], + "like_animals": ["yes"], + "what_animal": ["bird", "dog"], + "ask_about_breed": ["pereat", "bulldog", "I don't know"], + }, + "news": { + "what_news": ["science", "sport"], + "ask_about_science": ["yes", "let's change the topic"], + "science_news": ["ok", "let's change the topic"], + "ask_about_sport": ["yes", "let's change the topic"], + "sport_news": ["ok", "let's change the topic"], + }, + "small_talk": { + "ask_some_questions": [ + "fine", + "let's talk about animals", + "let's talk about news", + ], + "ask_talk_about": ["dog", "let's talk about news"], + }, +} +""" +Request options for automated client requests for :py:data:`~.MULTIFLOW_SCRIPT`. + +:meta hide-value: +""" diff --git a/docker-compose.yml b/docker-compose.yml index 382dc1dea..3c88bc854 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -50,10 +50,33 @@ services: context: ./dff/utils/docker dockerfile: dockerfile_stats image: ghcr.io/deeppavlov/superset_df_dashboard:latest + depends_on: + dashboard-metadata: + condition: service_healthy + clickhouse: + condition: service_started profiles: - stats ports: - "8088:8088" + dashboard-metadata: + env_file: [.env_file] + image: postgres:latest + profiles: + - stats + restart: unless-stopped + expose: + - "5433" + ports: + - 5433:5433 + command: -p 5433 + healthcheck: + test: pg_isready -p 5433 --username=$${POSTGRES_USERNAME} + interval: 4s + timeout: 3s + retries: 3 + volumes: + - dashboard-data:/var/lib/postgresql/data clickhouse: env_file: [.env_file] image: clickhouse/clickhouse-server:latest @@ -66,6 +89,11 @@ services: - '9000:9000' volumes: - ch-data:/var/lib/clickhouse/ + healthcheck: + test: wget --no-verbose --tries=1 --spider http://localhost:8123/ping || exit 1 + interval: 5s + timeout: 4s + retries: 5 otelcol: image: otel/opentelemetry-collector-contrib:latest profiles: @@ -73,6 +101,9 @@ services: container_name: otel-col restart: unless-stopped command: [ "--config=/etc/otelcol-config.yml", "--config=/etc/otelcol-config-extras.yml" ] + depends_on: + clickhouse: + condition: service_healthy volumes: - ./dff/utils/otel/otelcol-config.yml:/etc/otelcol-config.yml:ro - ./dff/utils/otel/otelcol-config-extras.yml:/etc/otelcol-config-extras.yml:ro @@ -82,3 +113,5 @@ services: volumes: ch-data: name: "ch-data" + dashboard-data: + name: "dashboard-data" diff --git a/docs/source/_static/images/annotations.png b/docs/source/_static/images/annotations.png new file mode 100644 index 000000000..b1e524890 Binary files /dev/null and b/docs/source/_static/images/annotations.png differ diff --git a/docs/source/user_guides/superset_guide.rst b/docs/source/user_guides/superset_guide.rst index c19142055..d3b4a29a1 100644 --- a/docs/source/user_guides/superset_guide.rst +++ b/docs/source/user_guides/superset_guide.rst @@ -19,8 +19,13 @@ Collection procedure **Installation** .. code-block:: shell + :linenos: - pip install dff[stats] + # clone the original repository to access the docker-compose file + git clone https://github.com/deeppavlov/dialog_flow_framework.git + # install with the stats extra + cd dialog_flow_framework + pip install .[stats] **Launching services** @@ -36,13 +41,13 @@ Collection procedure **Collecting data** Collecting data is done by means of instrumenting your conversational service before you run it. -DFF tutorials showcase all the necessary steps, needed to achieve that. We will run -`one of those files <../tutorials/tutorials.stats.1_extractor_functions.py>`_ -in order to obtain sample data points to visualize. +DFF tutorials (`1 <../tutorials/tutorials.stats.1_extractor_functions.py>`_, `2 <../tutorials/tutorials.stats.2_pipeline_integration.py>`_) +showcase all the steps needed to achieve that. We will run +a special script in order to obtain richly-annotated sample data points to visualize. .. code-block:: shell - export DISABLE_INTERACTIVE_MODE=1 && python tutorials/stats/1_extractor_functions.py + python utils/stats/sample_data_provider.py Displaying the data ~~~~~~~~~~~~~~~~~~~ @@ -84,7 +89,7 @@ Using Superset | In order to view the imported dashboard, log into `Superset `_ using your username and password (which are both `superset` by default and can be configured via `.env_file`). | The dashboard will then be available in the **Dashboards** section of the Superset UI under the name of **DFF stats**. -| The dashboard has four sections, each one of them containing different kind of data. +| The dashboard is split into four sections based on the types of charts and on the chart topic. * The **Overview** section summarizes the information about user interaction with your script. And displays a weighted graph of transitions from one node to another. The data is also shown in the form of a table for better introspection capabilities. @@ -92,17 +97,11 @@ Using Superset Overview plots. -* The data displayed in the **General stats** section reports, how frequent each of the nodes in your script was visited by users. The information is aggregated in several forms for better interpretability. +* The data displayed in the **Node stats** section reports, how frequent each of the nodes in your script was visited by users. The information is aggregated in several forms for better interpretability. .. figure:: ../_static/images/general_stats.png - General stats plots. - -* The **Additional stats** section includes charts for node visit counts aggregated over various specific variables. - -.. figure:: ../_static/images/additional_stats.png - - Additional stats plots. + Node stats plots. * General service load data aggregated over time can be found in the **Service stats** section. @@ -110,9 +109,83 @@ Using Superset Service stats plots. +* The **Annotations** section contains example charts that show how annotations from supplemental pipeline services can be viewed and analyzed. + +.. figure:: ../_static/images/annotations.png + + Plots for pipeline-produced dialog annotations. + On some occasions, Superset can show warnings about the database connection being faulty. In that case, you can navigate to the `Database Connections` section through the `Settings` menu and edit the `dff_database` instance updating the credentials. .. figure:: ../_static/images/databases.png - Locate the database settings in the right corner of the screen. \ No newline at end of file + Locate the database settings in the right corner of the screen. + +Customizing the dashboard +~~~~~~~~~~~~~~~~~~~~~~~~~ + +The most notable advantage of using Superset as a visualization tool is that it provides +an easy and intuitive way to create your own charts and to customize the dashboard. + +**Datasets** + +If you aim to create your own chart, Superset will prompt you to select a dataset to draw data from. +The current configuration provides three datasets `dff-node-stats`, `dff-stats`, and `dff-final-nodes`. +However, in most cases, you would use `dff-stats` or `dff-node-stats`. The former contains all data points, +while the latter only includes the logs produced by `get_current_label` extractor +(`see the API reference <../apiref/dff.stats.default_extractors.html#dff.stats.default_extractors.get_current_label>`_). +`dff-final-nodes` contains the same information as the said datasources, +but only aggregates the labels of nodes visited at the end of dialog graph traversal, +i.e. nodes that terminate the dialog. + +`dff-nodes-stats` uses the following variables to store the data: + +* The `context_id` field can be used to distinguish dialog contexts from each other and serves as a user identifier. +* `request_id` is the number of the dialog turn at which the data record was emitted. The data points can be aggregated over this field, showing the distribution of a variable over the dialog history. +* The `data_key` field contains the name of the extractor function that emitted the given record. Since in most cases you will only need the output of one extractor, you can filter out all the other records using filters. +* Finally, the `data` field is a set of JSON-encoded key-value pairs. The keys and values differ depending on the extractor function that emitted the data (you can essentially save arbitrary data under arbitrary keys), which makes filtering the data rows by their `data_key` all the more important. The JSON format implies that individual values need to be extracted using the Superset SQL functions (see below). + + +.. code-block:: + + JSON_VALUE(data, '$.key') + JSON_VALUE(data, '$.outer_key.nested_key') + +**Chart creation** + +.. note:: + + Chart creation is described in detail in the official Superset documentation. + We suggest that you consult it in addition to this section: + `link `_. + +Creating your own chart is as easy as navigating to the `Charts` section of the Superset app +and pressing the `Create` button. + +Initially, you will be prompted for the dataset that you want to use as well as for the chart type. +The Superset GUI provides comprehensive previews of each chart type making it very easy +to find the exact kind that you need. + +At the next step, you will be redirected to the chart creation interface. +Depending on the kind of chat that you have chosen previously, menus will be available +to choose a column for the x-axis and, optionally, a column for the y-axis. As mentioned above, +a separate menu for data filters will also be available. If you need to use the data +from the `data` column, you will need to find the `custom_sql` option when adding the column +and put in the extraction expression, as shown in the examples above. + +**Exporting the chart configuration** + +The configuration of a Superset dashboard can be easily exported and then reused +in other Superset instances. This can be done using the GUI: navigate to the +`Dashboards` section of the Superset application, locate your dashboard (named `DFF statistics` per default). +Then press the `export` button on the right and save the zip file to any convenient location. + +**Importing existing configuration files** + +If you need to restore your dashboard or update the configuration, you can import a configuration archive +that has been saved in the manner described below. + +Log in to Superset, open the `Dashboards` tab and press the import button on the right of the screen. +You will be prompted for the database password. If the database credentials match, +the updated dashboard will appear in the dashboard list. \ No newline at end of file diff --git a/makefile b/makefile index e182bfcdf..cd4a36789 100644 --- a/makefile +++ b/makefile @@ -50,7 +50,7 @@ lint: venv .PHONY: lint docker_up: - docker-compose --profile context_storage --profile stats up -d + docker-compose --profile context_storage --profile stats up -d --build .PHONY: docker_up wait_db: docker_up diff --git a/tests/stats/test_defaults.py b/tests/stats/test_defaults.py index 11c525723..d565efcdd 100644 --- a/tests/stats/test_defaults.py +++ b/tests/stats/test_defaults.py @@ -6,6 +6,7 @@ except ImportError: pytest.skip(allow_module_level=True, reason="One of the Opentelemetry packages is missing.") +import importlib from dff.script import Context from dff.pipeline.types import ExtraHandlerRuntimeInfo, ServiceRuntimeInfo from dff.stats import default_extractors @@ -20,7 +21,15 @@ ], ) async def test_get_current_label(context: Context, expected: set): - result = await default_extractors.get_current_label(context, None, {"component": {"path": "."}}) + example_module = importlib.import_module("tutorials.stats.1_extractor_functions") + runtime_info = ExtraHandlerRuntimeInfo( + func=lambda x: x, + stage="BEFORE", + component=ServiceRuntimeInfo( + path=".", name=".", timeout=None, asynchronous=False, execution_state={".": "FINISHED"} + ), + ) + result = await default_extractors.get_current_label(context, example_module.pipeline, runtime_info) assert expected.intersection(set(result.items())) == expected @@ -35,6 +44,7 @@ async def test_get_current_label(context: Context, expected: set): async def test_otlp_integration(context, expected, tracer_exporter_and_provider, log_exporter_and_provider): _, tracer_provider = tracer_exporter_and_provider log_exporter, logger_provider = log_exporter_and_provider + example_module = importlib.import_module("tutorials.stats.1_extractor_functions") instrumentor = OtelInstrumentor() if instrumentor.is_instrumented_by_opentelemetry: instrumentor.uninstrument() @@ -46,7 +56,7 @@ async def test_otlp_integration(context, expected, tracer_exporter_and_provider, path=".", name=".", timeout=None, asynchronous=False, execution_state={".": "FINISHED"} ), ) - _ = await default_extractors.get_current_label(context, None, runtime_info) + _ = await default_extractors.get_current_label(context, example_module.pipeline, runtime_info) tracer_provider.force_flush() logger_provider.force_flush() assert len(log_exporter.get_finished_logs()) > 0 diff --git a/tests/stats/test_main.py b/tests/stats/test_main.py index ac72fbf9b..c6539343e 100644 --- a/tests/stats/test_main.py +++ b/tests/stats/test_main.py @@ -52,14 +52,19 @@ def dashboard_display_test(args: Namespace, session, headers, base_url: str): dashboard_res = session.get(dashboard_url, headers=headers) assert dashboard_res.status_code == 200 dashboard_json = dashboard_res.json() + print(dashboard_json["result"]["charts"]) assert sorted(dashboard_json["result"]["charts"]) == [ + "Current topic [time series bar chart]", + "Current topic slot [bar chart]", "Flow visit ratio monitor", "Node Visits", "Node counts", "Node visit ratio monitor", - "Node visits [cloud]", "Node visits [ratio]", "Node visits [sunburst]", + "Rating slot [line chart]", + "Requests", + "Responses", "Service load [users]", "Table", "Terminal labels", @@ -68,20 +73,21 @@ def dashboard_display_test(args: Namespace, session, headers, base_url: str): "Transition ratio [chord]", ] assert dashboard_json["result"]["url"] == "/superset/dashboard/dff-stats/" - assert dashboard_json["result"]["dashboard_title"] == "DFF Stats" + assert dashboard_json["result"]["dashboard_title"] == "DFF statistics dashboard" datasets_result = session.get(datasets_url, headers=headers) datasets_json = datasets_result.json() - assert datasets_json["count"] == 2 - assert datasets_json["ids"] == [1, 2] - assert [item["id"] for item in datasets_json["result"]] == [1, 2] + assert datasets_json["count"] == 3 + assert datasets_json["ids"] == [1, 2, 3] + assert [item["id"] for item in datasets_json["result"]] == [1, 2, 3] assert sorted([item["table_name"] for item in datasets_json["result"]]) == [ "dff_final_nodes", "dff_node_stats", + "dff_stats", ] charts_result = session.get(charts_url, headers=headers) charts_json = charts_result.json() - assert charts_json["count"] == 14 - assert sorted(charts_json["ids"]) == list(range(1, 15)) + assert charts_json["count"] == 17 + assert sorted(charts_json["ids"]) == list(range(1, 18)) session.close() diff --git a/tutorials/stats/1_extractor_functions.py b/tutorials/stats/1_extractor_functions.py index 20f371ba6..f8ba327c0 100644 --- a/tutorials/stats/1_extractor_functions.py +++ b/tutorials/stats/1_extractor_functions.py @@ -7,12 +7,16 @@ Statistics are collected from pipeline services by extractor functions that report the state of one or more pipeline components. The `stats` module provides several default extractors, but users are free to define their own -extractor functions. +extractor functions. You can find API reference for default extractors +[here](%doclink(api,stats.default_extractors)). -It is required that the extractors have the following uniform signature: +It is a preferred practice to define extractors as asynchronous functions. +Extractors need to have the following uniform signature: the expected arguments are always `Context`, `Pipeline`, and `ExtraHandlerRuntimeInfo`, -while the expected return value is an arbitrary `dict` or a `None`. It is a preferred practice -to define extractors as asynchronous functions. +while the expected return value is an arbitrary `dict` or a `None`. +The returned value gets persisted to Clickhouse as JSON +which is why it can contain arbitrarily nested dictionaries, +but it cannot contain any complex objects that cannot be trivially serialized. The output of these functions will be captured by an OpenTelemetry instrumentor and directed to the Opentelemetry collector server which in its turn batches and persists data @@ -49,8 +53,9 @@ an appropriate Opentelemetry exporter instance and bind it to provider classes. * Nextly, the `OtelInstrumentor` class should be constructed to log the output -of extractor functions. Custom extractors can be decorated with the `OtelInstrumentor` instance. -Default extractors are instrumented by calling the `instrument` method. +of extractor functions. Custom extractors need to be decorated +with the `OtelInstrumentor` instance. Default extractors are instrumented +by calling the `instrument` method. * The entirety of the process is illustrated in the example below. diff --git a/tutorials/stats/2_pipeline_integration.py b/tutorials/stats/2_pipeline_integration.py index de81a3593..53c3b4b3a 100644 --- a/tutorials/stats/2_pipeline_integration.py +++ b/tutorials/stats/2_pipeline_integration.py @@ -72,6 +72,10 @@ async def heavy_service(ctx: Context): the pre-service and post-service states of the context to measure the performance of various components, etc. +Some extractors, like `get_current_label`, have restrictions in terms of their run stage: +for instance, `get_current_label` needs to only be used as an `after_handler` +to function correctly. + """ # %% pipeline = Pipeline.from_dict( @@ -90,11 +94,13 @@ async def heavy_service(ctx: Context): ), Service( handler=ACTOR, - before_handler=[default_extractors.get_timing_before], + before_handler=[ + default_extractors.get_timing_before, + ], after_handler=[ get_service_state, - default_extractors.get_timing_after, default_extractors.get_current_label, + default_extractors.get_timing_after, ], ), ], diff --git a/utils/stats/sample_data_provider.py b/utils/stats/sample_data_provider.py new file mode 100644 index 000000000..d778c922a --- /dev/null +++ b/utils/stats/sample_data_provider.py @@ -0,0 +1,127 @@ +#!/usr/bin/env python +# %% [markdown] +""" +This script demonstrates various instrumentation capabilities. +It also provides data for the dashboard emulating simultaneous queries +to the service by multiple users. + +""" + +# %% +import random +import asyncio +from tqdm import tqdm +from dff.script import Context, Message +from dff.pipeline import Pipeline, Service, ACTOR, ExtraHandlerRuntimeInfo +from dff.stats import ( + default_extractors, + OtelInstrumentor, +) +from dff.utils.testing.toy_script import MULTIFLOW_SCRIPT, MULTIFLOW_REQUEST_OPTIONS + +# %% +# instrumentation code +dff_instrumentor = OtelInstrumentor.from_url("grpc://localhost:4317", insecure=True) +dff_instrumentor.instrument() + + +def slot_processor_1(ctx: Context): + ctx.misc["slots"] = {**ctx.misc.get("slots", {}), "rating": random.randint(1, 10)} + + +def slot_processor_2(ctx: Context): + ctx.misc["slots"] = { + **ctx.misc.get("slots", {}), + "current_topic": random.choice(["films", "games", "books", "smalltalk"]), + } + + +@dff_instrumentor +async def get_slots(ctx: Context, _, info: ExtraHandlerRuntimeInfo): + return ctx.misc["slots"] + + +def confidence_processor(ctx: Context): + ctx.misc["response_confidence"] = random.random() + + +@dff_instrumentor +async def get_confidence(ctx: Context, _, info: ExtraHandlerRuntimeInfo): + data = {"response_confidence": ctx.misc["response_confidence"]} + return data + + +# %% +pipeline = Pipeline.from_dict( + { + "script": MULTIFLOW_SCRIPT, + "start_label": ("root", "start"), + "fallback_label": ("root", "fallback"), + "components": [ + Service(slot_processor_1, after_handler=[get_slots]), + Service(slot_processor_2, after_handler=[get_slots]), + Service( + handler=ACTOR, + before_handler=[ + default_extractors.get_timing_before, + ], + after_handler=[ + default_extractors.get_timing_after, + default_extractors.get_current_label, + default_extractors.get_last_request, + default_extractors.get_last_response, + ], + ), + Service(confidence_processor, after_handler=[get_confidence]), + ], + } +) + + +# %% +async def worker(queue: asyncio.Queue): + """ + Worker function for dispatching one client message. + The client message is chosen randomly from a predetermined set of options. + It simulates pauses in between messages by calling the sleep function. + + The function also starts a new dialog as a new user, if the current dialog + ended in the fallback_node. + + :param queue: Queue for sharing context variables. + """ + ctx: Context = await queue.get() + label = ctx.last_label if ctx.last_label else pipeline.actor.fallback_label + flow, node = label[:2] + if [flow, node] == ["root", "fallback"]: + await asyncio.sleep(random.random() * 3) + ctx = Context() + flow, node = ["root", "start"] + answers = list(MULTIFLOW_REQUEST_OPTIONS.get(flow, {}).get(node, [])) + in_text = random.choice(answers) if answers else "go to fallback" + in_message = Message(text=in_text) + await asyncio.sleep(random.random() * 3) + ctx = await pipeline._run_pipeline(in_message, ctx.id) + await asyncio.sleep(random.random() * 3) + await queue.put(ctx) + + +# %% +# main loop +async def main(n_iterations: int = 100, n_workers: int = 4): + """ + The main loop that runs one or more worker coroutines in parallel. + + :param n_iterations: Total number of coroutine runs. + :param n_workers: Number of parallelized coroutine runs. + """ + ctxs = asyncio.Queue() + parallel_iterations = n_iterations // n_workers + for _ in range(n_workers): + await ctxs.put(Context()) + for _ in tqdm(range(parallel_iterations)): + await asyncio.gather(*(worker(ctxs) for _ in range(n_workers))) + + +if __name__ == "__main__": + asyncio.run(main())