From 9b9a6900e983f81cbaab5363f744c5d179b046c3 Mon Sep 17 00:00:00 2001 From: Sean Li Date: Wed, 2 Nov 2022 18:31:10 -0700 Subject: [PATCH] Sidepanel update (#1230) * Updating sidepanel Signed-off-by: Sean Li * Removing mock metrics Signed-off-by: Sean Li * Allowing horizontal scroll on metric lists Signed-off-by: Sean Li * Minor changes Signed-off-by: Sean Li Signed-off-by: Sean Li --- .../common/constants/metrics.ts | 2 + .../components/metrics/helpers/utils.tsx | 35 +- .../metrics/redux/slices/metrics_slice.ts | 26 +- .../metrics/redux/slices/mockMetrics.js | 2552 ----------------- .../components/metrics/sidebar/search_bar.tsx | 59 + .../components/metrics/sidebar/sidebar.scss | 4 + .../components/metrics/sidebar/sidebar.tsx | 28 +- .../components/metrics/top_menu/top_menu.tsx | 26 +- 8 files changed, 130 insertions(+), 2602 deletions(-) delete mode 100644 dashboards-observability/public/components/metrics/redux/slices/mockMetrics.js create mode 100644 dashboards-observability/public/components/metrics/sidebar/search_bar.tsx diff --git a/dashboards-observability/common/constants/metrics.ts b/dashboards-observability/common/constants/metrics.ts index 49232392f..066e7373d 100644 --- a/dashboards-observability/common/constants/metrics.ts +++ b/dashboards-observability/common/constants/metrics.ts @@ -4,6 +4,8 @@ */ // requests constants +export const VISUALIZATION = 'viz'; +export const SAVED_VISUALIZATION = 'savedVisualization'; export const PPL_PROMETHEUS_CATALOG_REQUEST = 'show catalogs | where CONNECTOR_TYPE="PROMETHEUS" | fields CATALOG_NAME'; diff --git a/dashboards-observability/public/components/metrics/helpers/utils.tsx b/dashboards-observability/public/components/metrics/helpers/utils.tsx index 1f8a4583c..a09bf115b 100644 --- a/dashboards-observability/public/components/metrics/helpers/utils.tsx +++ b/dashboards-observability/public/components/metrics/helpers/utils.tsx @@ -7,29 +7,20 @@ import dateMath from '@elastic/datemath'; import { ShortDate } from '@elastic/eui'; import { DurationRange } from '@elastic/eui/src/components/date_picker/types'; import _ from 'lodash'; -import { Moment } from 'moment-timezone'; import React from 'react'; -import { CUSTOM_PANELS_API_PREFIX } from '../../../../common/constants/custom_panels'; -import { PPL_DATE_FORMAT } from '../../../../common/constants/shared'; +import { Layout } from 'react-grid-layout'; +import { VISUALIZATION, SAVED_VISUALIZATION } from '../../../../common/constants/metrics'; +import { + EVENT_ANALYTICS, + OBSERVABILITY_BASE, + SAVED_OBJECTS, +} from '../../../../common/constants/shared'; import PPLService from '../../../services/requests/ppl'; import { CoreStart } from '../../../../../../src/core/public'; import { MetricType } from '../../../../common/types/metrics'; -import { Layout } from 'react-grid-layout'; import { VisualizationType } from '../../../../common/types/custom_panels'; import { DEFAULT_METRIC_HEIGHT, DEFAULT_METRIC_WIDTH } from '../../../../common/constants/metrics'; -export const convertDateTime = (datetime: string, isStart = true, formatted = true) => { - let returnTime: undefined | Moment; - if (isStart) { - returnTime = dateMath.parse(datetime); - } else { - returnTime = dateMath.parse(datetime, { roundUp: true }); - } - - if (formatted) return returnTime!.format(PPL_DATE_FORMAT); - return returnTime; -}; - export const onTimeChange = ( start: ShortDate, end: ShortDate, @@ -50,16 +41,20 @@ export const onTimeChange = ( // PPL Service requestor export const pplServiceRequestor = (pplService: PPLService, finalQuery: string) => { - return pplService.fetch({ query: finalQuery, format: 'viz' }).catch((error: Error) => { + return pplService.fetch({ query: finalQuery, format: VISUALIZATION }).catch((error: Error) => { console.error(error); }); }; // Observability backend to fetch visualizations/custom metrics export const getVisualizations = (http: CoreStart['http']) => { - return http.get(`${CUSTOM_PANELS_API_PREFIX}/visualizations/`).catch((err) => { - console.error('Issue in fetching all saved visualizations', err); - }); + return http + .get(`${OBSERVABILITY_BASE}${EVENT_ANALYTICS}${SAVED_OBJECTS}`, { + query: { objectType: [SAVED_VISUALIZATION] }, + }) + .catch((err) => { + console.error('Issue in fetching all saved visualizations', err); + }); }; interface boxType { diff --git a/dashboards-observability/public/components/metrics/redux/slices/metrics_slice.ts b/dashboards-observability/public/components/metrics/redux/slices/metrics_slice.ts index fc3e038b5..7d3c9e6b0 100644 --- a/dashboards-observability/public/components/metrics/redux/slices/metrics_slice.ts +++ b/dashboards-observability/public/components/metrics/redux/slices/metrics_slice.ts @@ -29,12 +29,15 @@ export const loadMetrics = createAsyncThunk('metrics/loadData', async (services: const fetchCustomMetrics = async (http: any) => { const dataSet = await getVisualizations(http); - - const normalizedData = dataSet.visualizations.map((obj: any) => ({ - id: obj.id, - name: obj.name, + const savedMetrics = dataSet.observabilityObjectList.filter( + (obj: any) => obj.savedVisualization.sub_type === 'metric' + ); + const normalizedData = savedMetrics.map((obj: any) => ({ + id: obj.objectId, + name: obj.savedVisualization.name, catalog: 'CUSTOM_METRICS', - type: obj.type, + type: obj.savedVisualization.type, + recentlyCreated: (Date.now() - obj.createdTimeMs) / 36e5 <= 12, })); return normalizedData; }; @@ -52,6 +55,7 @@ const fetchRemoteMetrics = async (pplService: any) => { name: `${obj.TABLE_CATALOG}.${obj.TABLE_NAME}`, catalog: `${catalog.CATALOG_NAME}`, type: obj.TABLE_TYPE, + recentlyCreated: false, })); dataSet.push(normalizedData); } @@ -122,11 +126,21 @@ export const { deSelectMetric, selectMetric, updateMetricsLayout } = metricSlice export const metricsStateSelector = (state) => state.metrics; export const availableMetricsSelector = (state) => - state.metrics.metrics.filter((metric) => !state.metrics.selected.includes(metric.id)); + state.metrics.metrics.filter( + (metric) => !state.metrics.selected.includes(metric.id) && !metric.recentlyCreated + ); export const selectedMetricsSelector = (state) => state.metrics.metrics.filter((metric) => state.metrics.selected.includes(metric.id)); +export const recentlyCreatedMetricsSelector = (state) => + state.metrics.metrics.filter( + (metric) => !state.metrics.selected.includes(metric.id) && metric.recentlyCreated + ); + +export const allAvailableMetricsSelector = (state) => + state.metrics.metrics.filter((metric) => !state.metrics.selected.includes(metric.id)); + export const metricsLayoutSelector = (state) => state.metrics.metricsLayout; export default metricSlice.reducer; diff --git a/dashboards-observability/public/components/metrics/redux/slices/mockMetrics.js b/dashboards-observability/public/components/metrics/redux/slices/mockMetrics.js deleted file mode 100644 index f95d191b2..000000000 --- a/dashboards-observability/public/components/metrics/redux/slices/mockMetrics.js +++ /dev/null @@ -1,2552 +0,0 @@ -export const customMetricsTablePPL = { - jsonData: [ - { - objectId: '5PZrE4QB5_fIyAzrigGg', - lastUpdatedTimeMs: 1666773125792, - createdTimeMs: 1666773125792, - tenant: '', - savedVisualization: { - name: '[Logs] Daily count for error response codes', - description: '', - query: - "source = opensearch_dashboards_sample_data_logs | where response='503' or response='404' | stats count() by span(timestamp,1d)", - type: 'bar', - selected_date_range: { - start: 'now/y', - end: 'now', - text: '', - }, - selected_timestamp: { - name: 'timestamp', - type: 'timestamp', - }, - selected_fields: { - text: '', - tokens: [], - }, - }, - }, - ], -}; - -export const metricNamesTablePPL = { - data: { - TABLE_CATALOG: [ - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - 'prometheus_1', - ], - TABLE_SCHEMA: [ - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - 'default', - ], - TABLE_NAME: [ - 'prometheus_tsdb_lowest_timestamp_seconds', - 'prometheus_http_requests_total', - 'prometheus_tsdb_reloads_total', - 'prometheus_tsdb_wal_page_flushes_total', - 'prometheus_tsdb_snapshot_replay_error_total', - 'promhttp_metric_handler_requests_in_flight', - 'process_virtual_memory_bytes', - 'go_memstats_mspan_sys_bytes', - 'go_memstats_stack_sys_bytes', - 'prometheus_target_scrapes_exceeded_body_size_limit_total', - 'prometheus_tsdb_wal_truncations_failed_total', - 'prometheus_engine_query_log_enabled', - 'prometheus_target_scrape_pool_targets', - 'prometheus_tsdb_compactions_total', - 'prometheus_sd_nomad_failures_total', - 'prometheus_tsdb_exemplar_max_exemplars', - 'prometheus_tsdb_exemplar_exemplars_in_storage', - 'prometheus_engine_query_duration_seconds', - 'prometheus_tsdb_isolation_high_watermark', - 'prometheus_engine_queries_concurrent_max', - 'prometheus_remote_storage_exemplars_in_total', - 'prometheus_tsdb_data_replay_duration_seconds', - 'prometheus_sd_dns_lookups_total', - 'prometheus_tsdb_out_of_bound_samples_total', - 'net_conntrack_dialer_conn_closed_total', - 'go_memstats_frees_total', - 'prometheus_tsdb_exemplar_out_of_order_exemplars_total', - 'prometheus_tsdb_wal_writes_failed_total', - 'prometheus_target_metadata_cache_bytes', - 'go_memstats_buck_hash_sys_bytes', - 'prometheus_target_sync_failed_total', - 'go_memstats_mallocs_total', - 'prometheus_tsdb_mmap_chunk_corruptions_total', - 'prometheus_web_federation_errors_total', - 'prometheus_sd_discovered_targets', - 'prometheus_sd_file_read_errors_total', - 'prometheus_sd_kuma_fetch_duration_seconds', - 'prometheus_tsdb_head_series_created_total', - 'prometheus_tsdb_head_active_appenders', - 'prometheus_tsdb_symbol_table_size_bytes', - 'prometheus_sd_received_updates_total', - 'prometheus_tsdb_isolation_low_watermark', - 'prometheus_tsdb_compaction_chunk_samples', - 'prometheus_tsdb_head_truncations_total', - 'prometheus_http_request_duration_seconds', - 'prometheus_tsdb_compactions_triggered_total', - 'net_conntrack_dialer_conn_established_total', - 'process_resident_memory_bytes', - 'prometheus_tsdb_lowest_timestamp', - 'go_memstats_heap_sys_bytes', - 'prometheus_tsdb_checkpoint_creations_failed_total', - 'prometheus_target_scrapes_sample_duplicate_timestamp_total', - 'prometheus_treecache_zookeeper_failures_total', - 'prometheus_tsdb_tombstone_cleanup_seconds', - 'prometheus_tsdb_compaction_chunk_size_bytes', - 'prometheus_tsdb_head_gc_duration_seconds', - 'process_open_fds', - 'prometheus_target_metadata_cache_entries', - 'prometheus_treecache_watcher_goroutines', - 'process_max_fds', - 'go_memstats_heap_objects', - 'go_memstats_mcache_inuse_bytes', - 'go_memstats_other_sys_bytes', - 'prometheus_sd_linode_failures_total', - 'prometheus_target_scrape_pool_reloads_total', - 'go_threads', - 'prometheus_tsdb_head_out_of_order_samples_appended_total', - 'go_memstats_heap_inuse_bytes', - 'net_conntrack_dialer_conn_failed_total', - 'go_memstats_mcache_sys_bytes', - 'prometheus_remote_storage_samples_in_total', - 'prometheus_tsdb_exemplar_last_exemplars_timestamp_seconds', - 'prometheus_config_last_reload_successful', - 'prometheus_tsdb_head_min_time', - 'go_memstats_alloc_bytes_total', - 'prometheus_tsdb_exemplar_series_with_exemplars_in_storage', - 'prometheus_tsdb_head_series', - 'go_gc_duration_seconds', - 'prometheus_sd_kubernetes_events_total', - 'prometheus_target_scrapes_sample_out_of_bounds_total', - 'prometheus_tsdb_storage_blocks_bytes', - 'prometheus_build_info', - 'prometheus_sd_updates_total', - 'prometheus_tsdb_time_retentions_total', - 'prometheus_tsdb_compaction_chunk_range_seconds', - 'prometheus_sd_azure_failures_total', - 'prometheus_tsdb_exemplar_exemplars_appended_total', - 'prometheus_tsdb_head_chunks', - 'prometheus_tsdb_head_max_time', - 'prometheus_tsdb_head_series_removed_total', - 'prometheus_tsdb_wal_truncate_duration_seconds', - 'prometheus_tsdb_wal_corruptions_total', - 'net_conntrack_listener_conn_closed_total', - 'prometheus_tsdb_wal_fsync_duration_seconds', - 'prometheus_tsdb_vertical_compactions_total', - 'prometheus_tsdb_wal_segment_current', - 'prometheus_sd_http_failures_total', - 'prometheus_target_scrapes_exemplar_out_of_order_total', - 'prometheus_tsdb_checkpoint_creations_total', - 'net_conntrack_dialer_conn_attempted_total', - 'prometheus_target_scrape_pool_reloads_failed_total', - 'prometheus_tsdb_head_min_time_seconds', - 'prometheus_notifications_alertmanagers_discovered', - 'prometheus_tsdb_blocks_loaded', - 'go_memstats_last_gc_time_seconds', - 'prometheus_notifications_queue_capacity', - 'prometheus_notifications_dropped_total', - 'prometheus_config_last_reload_success_timestamp_seconds', - 'prometheus_remote_storage_highest_timestamp_in_seconds', - 'prometheus_rule_evaluation_duration_seconds', - 'prometheus_tsdb_wal_completed_pages_total', - 'prometheus_tsdb_compaction_duration_seconds', - 'prometheus_web_federation_warnings_total', - 'process_start_time_seconds', - 'promhttp_metric_handler_requests_total', - 'go_memstats_heap_alloc_bytes', - 'prometheus_notifications_queue_length', - 'go_memstats_mspan_inuse_bytes', - 'go_memstats_lookups_total', - 'prometheus_tsdb_checkpoint_deletions_total', - 'go_memstats_alloc_bytes', - 'prometheus_template_text_expansions_total', - 'go_memstats_sys_bytes', - 'prometheus_target_scrapes_sample_out_of_order_total', - 'prometheus_target_scrape_pools_total', - 'prometheus_tsdb_head_chunks_removed_total', - 'prometheus_tsdb_compactions_skipped_total', - 'prometheus_target_scrape_pool_exceeded_label_limits_total', - 'prometheus_tsdb_checkpoint_deletions_failed_total', - 'prometheus_tsdb_compactions_failed_total', - 'prometheus_sd_kuma_fetch_skipped_updates_total', - 'prometheus_target_scrape_pools_failed_total', - 'prometheus_sd_file_scan_duration_seconds', - 'prometheus_tsdb_clean_start', - 'prometheus_tsdb_wal_truncations_total', - 'prometheus_target_scrapes_exceeded_sample_limit_total', - 'prometheus_target_interval_length_seconds', - 'prometheus_target_scrapes_cache_flush_forced_total', - 'prometheus_tsdb_out_of_order_samples_total', - 'prometheus_tsdb_retention_limit_bytes', - 'process_cpu_seconds_total', - 'go_memstats_heap_idle_bytes', - 'prometheus_sd_consul_rpc_failures_total', - 'prometheus_target_scrape_pool_sync_total', - 'prometheus_remote_storage_string_interner_zero_reference_releases_total', - 'prometheus_sd_dns_lookup_failures_total', - 'go_memstats_gc_sys_bytes', - 'prometheus_sd_failed_configs', - 'go_info', - 'prometheus_engine_queries', - 'go_memstats_stack_inuse_bytes', - 'prometheus_sd_consul_rpc_duration_seconds', - 'prometheus_tsdb_size_retentions_total', - 'prometheus_target_sync_length_seconds', - 'prometheus_engine_query_log_failures_total', - 'prometheus_target_scrape_pool_exceeded_target_limit_total', - 'prometheus_ready', - 'prometheus_tsdb_head_max_time_seconds', - 'go_goroutines', - 'prometheus_api_remote_read_queries', - 'prometheus_rule_group_duration_seconds', - 'prometheus_tsdb_compaction_populating_block', - 'prometheus_tsdb_reloads_failures_total', - 'prometheus_tsdb_too_old_samples_total', - 'prometheus_tsdb_head_samples_appended_total', - 'go_memstats_heap_released_bytes', - 'prometheus_tsdb_head_truncations_failed_total', - 'net_conntrack_listener_conn_accepted_total', - 'process_virtual_memory_max_bytes', - 'prometheus_template_text_expansion_failures_total', - 'prometheus_sd_kuma_fetch_failures_total', - 'prometheus_tsdb_head_chunks_created_total', - 'go_memstats_next_gc_bytes', - 'prometheus_http_response_size_bytes', - 'prometheus_tsdb_head_series_not_found_total', - ], - TABLE_TYPE: [ - 'gauge', - 'counter', - 'counter', - 'counter', - 'counter', - 'gauge', - 'gauge', - 'gauge', - 'gauge', - 'counter', - 'counter', - 'gauge', - 'gauge', - 'counter', - 'counter', - 'gauge', - 'gauge', - 'summary', - 'gauge', - 'gauge', - 'counter', - 'gauge', - 'counter', - 'counter', - 'counter', - 'counter', - 'counter', - 'counter', - 'gauge', - 'gauge', - 'counter', - 'counter', - 'counter', - 'counter', - 'gauge', - 'counter', - 'summary', - 'counter', - 'gauge', - 'gauge', - 'counter', - 'gauge', - 'histogram', - 'counter', - 'histogram', - 'counter', - 'counter', - 'gauge', - 'gauge', - 'gauge', - 'counter', - 'counter', - 'counter', - 'histogram', - 'histogram', - 'summary', - 'gauge', - 'gauge', - 'gauge', - 'gauge', - 'gauge', - 'gauge', - 'gauge', - 'counter', - 'counter', - 'gauge', - 'counter', - 'gauge', - 'counter', - 'gauge', - 'counter', - 'gauge', - 'gauge', - 'gauge', - 'counter', - 'gauge', - 'gauge', - 'summary', - 'counter', - 'counter', - 'gauge', - 'gauge', - 'counter', - 'counter', - 'histogram', - 'counter', - 'counter', - 'gauge', - 'gauge', - 'counter', - 'summary', - 'counter', - 'counter', - 'summary', - 'counter', - 'gauge', - 'counter', - 'counter', - 'counter', - 'counter', - 'counter', - 'gauge', - 'gauge', - 'gauge', - 'gauge', - 'gauge', - 'counter', - 'gauge', - 'gauge', - 'summary', - 'counter', - 'histogram', - 'counter', - 'gauge', - 'counter', - 'gauge', - 'gauge', - 'gauge', - 'counter', - 'counter', - 'gauge', - 'counter', - 'gauge', - 'counter', - 'counter', - 'counter', - 'counter', - 'counter', - 'counter', - 'counter', - 'counter', - 'counter', - 'summary', - 'gauge', - 'counter', - 'counter', - 'summary', - 'counter', - 'counter', - 'gauge', - 'counter', - 'gauge', - 'counter', - 'counter', - 'counter', - 'counter', - 'gauge', - 'gauge', - 'gauge', - 'gauge', - 'gauge', - 'summary', - 'counter', - 'summary', - 'counter', - 'counter', - 'gauge', - 'gauge', - 'gauge', - 'gauge', - 'summary', - 'gauge', - 'counter', - 'counter', - 'counter', - 'gauge', - 'counter', - 'counter', - 'gauge', - 'counter', - 'counter', - 'counter', - 'gauge', - 'histogram', - 'counter', - ], - UNIT: [ - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - ], - REMARKS: [ - 'Lowest timestamp value stored in the database.', - 'Counter of HTTP requests.', - 'Number of times the database reloaded block data from disk.', - 'Total number of page flushes.', - 'Total number snapshot replays that failed.', - 'Current number of scrapes being served.', - 'Virtual memory size in bytes.', - 'Number of bytes used for mspan structures obtained from system.', - 'Number of bytes obtained from system for stack allocator.', - 'Total number of scrapes that hit the body size limit', - 'Total number of WAL truncations that failed.', - 'State of the query log.', - 'Current number of targets in this scrape pool.', - 'Total number of compactions that were executed for the partition.', - 'Number of nomad service discovery refresh failures.', - 'Total number of exemplars the exemplar storage can store, resizeable.', - 'Number of exemplars currently in circular storage.', - 'Query timings', - 'The highest TSDB append ID that has been given out.', - 'The max number of concurrent queries.', - 'Exemplars in to remote storage, compare to exemplars out for queue managers.', - 'Time taken to replay the data on disk.', - 'The number of DNS-SD lookups.', - 'Total number of out of bound samples ingestion failed attempts with out of order support disabled.', - 'Total number of connections closed which originated from the dialer of a given name.', - 'Total number of frees.', - 'Total number of out of order exemplar ingestion failed attempts.', - 'Total number of WAL writes that failed.', - 'The number of bytes that are currently used for storing metric metadata in the cache', - 'Number of bytes used by the profiling bucket hash table.', - 'Total number of target sync failures.', - 'Total number of mallocs.', - 'Total number of memory-mapped chunk corruptions.', - 'Total number of errors that occurred while sending federation responses.', - 'Current number of discovered targets.', - 'The number of File-SD read errors.', - 'The duration of a Kuma MADS fetch call.', - 'Total number of series created in the head', - 'Number of currently active appender transactions', - 'Size of symbol table in memory for loaded blocks', - 'Total number of update events received from the SD providers.', - 'The lowest TSDB append ID that is still referenced.', - 'Final number of samples on their first compaction', - 'Total number of head truncations attempted.', - 'Histogram of latencies for HTTP requests.', - 'Total number of triggered compactions for the partition.', - 'Total number of connections successfully established by the given dialer a given name.', - 'Resident memory size in bytes.', - 'Lowest timestamp value stored in the database. The unit is decided by the library consumer.', - 'Number of heap bytes obtained from system.', - 'Total number of checkpoint creations that failed.', - 'Total number of samples rejected due to duplicate timestamps but different values.', - 'The total number of ZooKeeper failures.', - 'The time taken to recompact blocks to remove tombstones.', - 'Final size of chunks on their first compaction', - 'Runtime of garbage collection in the head block.', - 'Number of open file descriptors.', - 'Total number of metric metadata entries in the cache', - 'The current number of watcher goroutines.', - 'Maximum number of open file descriptors.', - 'Number of allocated objects.', - 'Number of bytes in use by mcache structures.', - 'Number of bytes used for other system allocations.', - 'Number of Linode service discovery refresh failures.', - 'Total number of scrape pool reloads.', - 'Number of OS threads created.', - 'Total number of appended out of order samples.', - 'Number of heap bytes that are in use.', - 'Total number of connections failed to dial by the dialer a given name.', - 'Number of bytes used for mcache structures obtained from system.', - 'Samples in to remote storage, compare to samples out for queue managers.', - 'The timestamp of the oldest exemplar stored in circular storage. Useful to check for what timerange the current exemplar buffer limit allows. This usually means the last timestampfor all exemplars for a typical setup. This is not true though if one of the series timestamp is in future compared to rest series.', - 'Whether the last configuration reload attempt was successful.', - 'Minimum time bound of the head block. The unit is decided by the library consumer.', - 'Total number of bytes allocated, even if freed.', - 'Number of series with exemplars currently in circular storage.', - 'Total number of series in the head block.', - 'A summary of the pause duration of garbage collection cycles.', - 'The number of Kubernetes events handled.', - 'Total number of samples rejected due to timestamp falling outside of the time bounds.', - 'The number of bytes that are currently used for local storage by all blocks.', - "A metric with a constant '1' value labeled by version, revision, branch, and goversion from which prometheus was built.", - 'Total number of update events sent to the SD consumers.', - 'The number of times that blocks were deleted because the maximum time limit was exceeded.', - 'Final time range of chunks on their first compaction', - 'Number of Azure service discovery refresh failures.', - 'Total number of appended exemplars.', - 'Total number of chunks in the head block.', - 'Maximum timestamp of the head block. The unit is decided by the library consumer.', - 'Total number of series removed in the head', - 'Duration of WAL truncation.', - 'Total number of WAL corruptions.', - 'Total number of connections closed that were made to the listener of a given name.', - 'Duration of WAL fsync.', - 'Total number of compactions done on overlapping blocks.', - 'WAL segment index that TSDB is currently writing to.', - 'Number of HTTP service discovery refresh failures.', - 'Total number of exemplar rejected due to not being out of the expected order.', - 'Total number of checkpoint creations attempted.', - 'Total number of connections attempted by the given dialer a given name.', - 'Total number of failed scrape pool reloads.', - 'Minimum time bound of the head block.', - 'The number of alertmanagers discovered and active.', - 'Number of currently loaded data blocks', - 'Number of seconds since 1970 of last garbage collection.', - 'The capacity of the alert notifications queue.', - 'Total number of alerts dropped due to errors when sending to Alertmanager.', - 'Timestamp of the last successful configuration reload.', - 'Highest timestamp that has come into the remote storage via the Appender interface, in seconds since epoch.', - 'The duration for a rule to execute.', - 'Total number of completed pages.', - 'Duration of compaction runs', - 'Total number of warnings that occurred while sending federation responses.', - 'Start time of the process since unix epoch in seconds.', - 'Total number of scrapes by HTTP status code.', - 'Number of heap bytes allocated and still in use.', - 'The number of alert notifications in the queue.', - 'Number of bytes in use by mspan structures.', - 'Total number of pointer lookups.', - 'Total number of checkpoint deletions attempted.', - 'Number of bytes allocated and still in use.', - 'The total number of template text expansions.', - 'Number of bytes obtained from system.', - 'Total number of samples rejected due to not being out of the expected order.', - 'Total number of scrape pool creation attempts.', - 'Total number of chunks removed in the head', - 'Total number of skipped compactions due to disabled auto compaction.', - 'Total number of times scrape pools hit the label limits, during sync or config reload.', - 'Total number of checkpoint deletions that failed.', - 'Total number of compactions that failed for the partition.', - 'The number of Kuma MADS fetch calls that result in no updates to the targets.', - 'Total number of scrape pool creations that failed.', - 'The duration of the File-SD scan in seconds.', - '-1: lockfile is disabled. 0: a lockfile from a previous execution was replaced. 1: lockfile creation was clean', - 'Total number of WAL truncations attempted.', - 'Total number of scrapes that hit the sample limit and were rejected.', - 'Actual intervals between scrapes.', - 'How many times a scrape cache was flushed due to getting big while scrapes are failing.', - 'Total number of out of order samples ingestion failed attempts due to out of order being disabled.', - 'Max number of bytes to be retained in the tsdb blocks, configured 0 means disabled', - 'Total user and system CPU time spent in seconds.', - 'Number of heap bytes waiting to be used.', - 'The number of Consul RPC call failures.', - 'Total number of syncs that were executed on a scrape pool.', - 'The number of times release has been called for strings that are not interned.', - 'The number of DNS-SD lookup failures.', - 'Number of bytes used for garbage collection system metadata.', - 'Current number of service discovery configurations that failed to load.', - 'Information about the Go environment.', - 'The current number of queries being executed or waiting.', - 'Number of bytes in use by the stack allocator.', - 'The duration of a Consul RPC call in seconds.', - 'The number of times that blocks were deleted because the maximum number of bytes was exceeded.', - 'Actual interval to sync the scrape pool.', - 'The number of query log failures.', - 'Total number of times scrape pools hit the target limit, during sync or config reload.', - 'Whether Prometheus startup was fully completed and the server is ready for normal operation.', - 'Maximum timestamp of the head block.', - 'Number of goroutines that currently exist.', - 'The current number of remote read queries being executed or waiting.', - 'The duration of rule group evaluations.', - 'Set to 1 when a block is currently being written to the disk.', - 'Number of times the database failed to reloadBlocks block data from disk.', - 'Total number of out of order samples ingestion failed attempts with out of support enabled, but sample outside of time window.', - 'Total number of appended samples.', - 'Number of heap bytes released to OS.', - 'Total number of head truncations that failed.', - 'Total number of connections opened to the listener of a given name.', - 'Maximum amount of virtual memory available in bytes.', - 'The total number of template text expansion failures.', - 'The number of Kuma MADS fetch call failures.', - 'Total number of chunks created in the head', - 'Number of heap bytes when next garbage collection will take place.', - 'Histogram of response size for HTTP requests.', - 'Total number of requests for series that were not found.', - ], - }, - metadata: { - fields: [ - { - name: 'TABLE_CATALOG', - type: 'keyword', - }, - { - name: 'TABLE_SCHEMA', - type: 'keyword', - }, - { - name: 'TABLE_NAME', - type: 'keyword', - }, - { - name: 'TABLE_TYPE', - type: 'keyword', - }, - { - name: 'UNIT', - type: 'keyword', - }, - { - name: 'REMARKS', - type: 'keyword', - }, - ], - }, - size: 175, - status: 200, - jsonData: [ - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_lowest_timestamp_seconds', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Lowest timestamp value stored in the database.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_http_requests_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Counter of HTTP requests.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_reloads_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Number of times the database reloaded block data from disk.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_wal_page_flushes_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of page flushes.', - }, - ], -}; - -const otherMetrics = { - jsonData: [ - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_snapshot_replay_error_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number snapshot replays that failed.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'promhttp_metric_handler_requests_in_flight', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Current number of scrapes being served.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'process_virtual_memory_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Virtual memory size in bytes.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_mspan_sys_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of bytes used for mspan structures obtained from system.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_stack_sys_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of bytes obtained from system for stack allocator.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_target_scrapes_exceeded_body_size_limit_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of scrapes that hit the body size limit', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_wal_truncations_failed_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of WAL truncations that failed.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_engine_query_log_enabled', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'State of the query log.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_target_scrape_pool_targets', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Current number of targets in this scrape pool.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_compactions_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of compactions that were executed for the partition.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_sd_nomad_failures_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Number of nomad service discovery refresh failures.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_exemplar_max_exemplars', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Total number of exemplars the exemplar storage can store, resizeable.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_exemplar_exemplars_in_storage', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of exemplars currently in circular storage.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_engine_query_duration_seconds', - TABLE_TYPE: 'summary', - UNIT: '', - REMARKS: 'Query timings', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_isolation_high_watermark', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'The highest TSDB append ID that has been given out.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_engine_queries_concurrent_max', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'The max number of concurrent queries.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_remote_storage_exemplars_in_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Exemplars in to remote storage, compare to exemplars out for queue managers.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_data_replay_duration_seconds', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Time taken to replay the data on disk.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_sd_dns_lookups_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'The number of DNS-SD lookups.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_out_of_bound_samples_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: - 'Total number of out of bound samples ingestion failed attempts with out of order support disabled.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'net_conntrack_dialer_conn_closed_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: - 'Total number of connections closed which originated from the dialer of a given name.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_frees_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of frees.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_exemplar_out_of_order_exemplars_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of out of order exemplar ingestion failed attempts.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_wal_writes_failed_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of WAL writes that failed.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_target_metadata_cache_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: - 'The number of bytes that are currently used for storing metric metadata in the cache', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_buck_hash_sys_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of bytes used by the profiling bucket hash table.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_target_sync_failed_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of target sync failures.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_mallocs_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of mallocs.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_mmap_chunk_corruptions_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of memory-mapped chunk corruptions.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_web_federation_errors_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of errors that occurred while sending federation responses.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_sd_discovered_targets', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Current number of discovered targets.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_sd_file_read_errors_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'The number of File-SD read errors.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_sd_kuma_fetch_duration_seconds', - TABLE_TYPE: 'summary', - UNIT: '', - REMARKS: 'The duration of a Kuma MADS fetch call.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_head_series_created_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of series created in the head', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_head_active_appenders', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of currently active appender transactions', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_symbol_table_size_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Size of symbol table in memory for loaded blocks', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_sd_received_updates_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of update events received from the SD providers.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_isolation_low_watermark', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'The lowest TSDB append ID that is still referenced.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_compaction_chunk_samples', - TABLE_TYPE: 'histogram', - UNIT: '', - REMARKS: 'Final number of samples on their first compaction', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_head_truncations_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of head truncations attempted.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_http_request_duration_seconds', - TABLE_TYPE: 'histogram', - UNIT: '', - REMARKS: 'Histogram of latencies for HTTP requests.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_compactions_triggered_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of triggered compactions for the partition.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'net_conntrack_dialer_conn_established_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: - 'Total number of connections successfully established by the given dialer a given name.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'process_resident_memory_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Resident memory size in bytes.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_lowest_timestamp', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: - 'Lowest timestamp value stored in the database. The unit is decided by the library consumer.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_heap_sys_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of heap bytes obtained from system.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_checkpoint_creations_failed_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of checkpoint creations that failed.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_target_scrapes_sample_duplicate_timestamp_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of samples rejected due to duplicate timestamps but different values.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_treecache_zookeeper_failures_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'The total number of ZooKeeper failures.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_tombstone_cleanup_seconds', - TABLE_TYPE: 'histogram', - UNIT: '', - REMARKS: 'The time taken to recompact blocks to remove tombstones.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_compaction_chunk_size_bytes', - TABLE_TYPE: 'histogram', - UNIT: '', - REMARKS: 'Final size of chunks on their first compaction', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_head_gc_duration_seconds', - TABLE_TYPE: 'summary', - UNIT: '', - REMARKS: 'Runtime of garbage collection in the head block.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'process_open_fds', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of open file descriptors.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_target_metadata_cache_entries', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Total number of metric metadata entries in the cache', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_treecache_watcher_goroutines', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'The current number of watcher goroutines.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'process_max_fds', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Maximum number of open file descriptors.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_heap_objects', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of allocated objects.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_mcache_inuse_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of bytes in use by mcache structures.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_other_sys_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of bytes used for other system allocations.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_sd_linode_failures_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Number of Linode service discovery refresh failures.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_target_scrape_pool_reloads_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of scrape pool reloads.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_threads', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of OS threads created.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_head_out_of_order_samples_appended_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of appended out of order samples.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_heap_inuse_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of heap bytes that are in use.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'net_conntrack_dialer_conn_failed_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of connections failed to dial by the dialer a given name.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_mcache_sys_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of bytes used for mcache structures obtained from system.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_remote_storage_samples_in_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Samples in to remote storage, compare to samples out for queue managers.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_exemplar_last_exemplars_timestamp_seconds', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: - 'The timestamp of the oldest exemplar stored in circular storage. Useful to check for what timerange the current exemplar buffer limit allows. This usually means the last timestampfor all exemplars for a typical setup. This is not true though if one of the series timestamp is in future compared to rest series.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_config_last_reload_successful', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Whether the last configuration reload attempt was successful.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_head_min_time', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Minimum time bound of the head block. The unit is decided by the library consumer.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_alloc_bytes_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of bytes allocated, even if freed.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_exemplar_series_with_exemplars_in_storage', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of series with exemplars currently in circular storage.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_head_series', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Total number of series in the head block.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_gc_duration_seconds', - TABLE_TYPE: 'summary', - UNIT: '', - REMARKS: 'A summary of the pause duration of garbage collection cycles.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_sd_kubernetes_events_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'The number of Kubernetes events handled.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_target_scrapes_sample_out_of_bounds_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: - 'Total number of samples rejected due to timestamp falling outside of the time bounds.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_storage_blocks_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'The number of bytes that are currently used for local storage by all blocks.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_build_info', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: - "A metric with a constant '1' value labeled by version, revision, branch, and goversion from which prometheus was built.", - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_sd_updates_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of update events sent to the SD consumers.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_time_retentions_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: - 'The number of times that blocks were deleted because the maximum time limit was exceeded.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_compaction_chunk_range_seconds', - TABLE_TYPE: 'histogram', - UNIT: '', - REMARKS: 'Final time range of chunks on their first compaction', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_sd_azure_failures_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Number of Azure service discovery refresh failures.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_exemplar_exemplars_appended_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of appended exemplars.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_head_chunks', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Total number of chunks in the head block.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_head_max_time', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Maximum timestamp of the head block. The unit is decided by the library consumer.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_head_series_removed_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of series removed in the head', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_wal_truncate_duration_seconds', - TABLE_TYPE: 'summary', - UNIT: '', - REMARKS: 'Duration of WAL truncation.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_wal_corruptions_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of WAL corruptions.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'net_conntrack_listener_conn_closed_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of connections closed that were made to the listener of a given name.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_wal_fsync_duration_seconds', - TABLE_TYPE: 'summary', - UNIT: '', - REMARKS: 'Duration of WAL fsync.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_vertical_compactions_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of compactions done on overlapping blocks.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_wal_segment_current', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'WAL segment index that TSDB is currently writing to.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_sd_http_failures_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Number of HTTP service discovery refresh failures.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_target_scrapes_exemplar_out_of_order_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of exemplar rejected due to not being out of the expected order.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_checkpoint_creations_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of checkpoint creations attempted.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'net_conntrack_dialer_conn_attempted_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of connections attempted by the given dialer a given name.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_target_scrape_pool_reloads_failed_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of failed scrape pool reloads.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_head_min_time_seconds', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Minimum time bound of the head block.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_notifications_alertmanagers_discovered', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'The number of alertmanagers discovered and active.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_blocks_loaded', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of currently loaded data blocks', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_last_gc_time_seconds', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of seconds since 1970 of last garbage collection.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_notifications_queue_capacity', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'The capacity of the alert notifications queue.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_notifications_dropped_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of alerts dropped due to errors when sending to Alertmanager.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_config_last_reload_success_timestamp_seconds', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Timestamp of the last successful configuration reload.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_remote_storage_highest_timestamp_in_seconds', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: - 'Highest timestamp that has come into the remote storage via the Appender interface, in seconds since epoch.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_rule_evaluation_duration_seconds', - TABLE_TYPE: 'summary', - UNIT: '', - REMARKS: 'The duration for a rule to execute.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_wal_completed_pages_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of completed pages.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_compaction_duration_seconds', - TABLE_TYPE: 'histogram', - UNIT: '', - REMARKS: 'Duration of compaction runs', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_web_federation_warnings_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of warnings that occurred while sending federation responses.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'process_start_time_seconds', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Start time of the process since unix epoch in seconds.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'promhttp_metric_handler_requests_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of scrapes by HTTP status code.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_heap_alloc_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of heap bytes allocated and still in use.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_notifications_queue_length', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'The number of alert notifications in the queue.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_mspan_inuse_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of bytes in use by mspan structures.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_lookups_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of pointer lookups.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_checkpoint_deletions_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of checkpoint deletions attempted.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_alloc_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of bytes allocated and still in use.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_template_text_expansions_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'The total number of template text expansions.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_sys_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of bytes obtained from system.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_target_scrapes_sample_out_of_order_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of samples rejected due to not being out of the expected order.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_target_scrape_pools_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of scrape pool creation attempts.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_head_chunks_removed_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of chunks removed in the head', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_compactions_skipped_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of skipped compactions due to disabled auto compaction.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_target_scrape_pool_exceeded_label_limits_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: - 'Total number of times scrape pools hit the label limits, during sync or config reload.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_checkpoint_deletions_failed_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of checkpoint deletions that failed.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_compactions_failed_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of compactions that failed for the partition.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_sd_kuma_fetch_skipped_updates_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'The number of Kuma MADS fetch calls that result in no updates to the targets.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_target_scrape_pools_failed_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of scrape pool creations that failed.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_sd_file_scan_duration_seconds', - TABLE_TYPE: 'summary', - UNIT: '', - REMARKS: 'The duration of the File-SD scan in seconds.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_clean_start', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: - '-1: lockfile is disabled. 0: a lockfile from a previous execution was replaced. 1: lockfile creation was clean', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_wal_truncations_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of WAL truncations attempted.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_target_scrapes_exceeded_sample_limit_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of scrapes that hit the sample limit and were rejected.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_target_interval_length_seconds', - TABLE_TYPE: 'summary', - UNIT: '', - REMARKS: 'Actual intervals between scrapes.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_target_scrapes_cache_flush_forced_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: - 'How many times a scrape cache was flushed due to getting big while scrapes are failing.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_out_of_order_samples_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: - 'Total number of out of order samples ingestion failed attempts due to out of order being disabled.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_retention_limit_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Max number of bytes to be retained in the tsdb blocks, configured 0 means disabled', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'process_cpu_seconds_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total user and system CPU time spent in seconds.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_heap_idle_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of heap bytes waiting to be used.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_sd_consul_rpc_failures_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'The number of Consul RPC call failures.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_target_scrape_pool_sync_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of syncs that were executed on a scrape pool.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_remote_storage_string_interner_zero_reference_releases_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'The number of times release has been called for strings that are not interned.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_sd_dns_lookup_failures_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'The number of DNS-SD lookup failures.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_gc_sys_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of bytes used for garbage collection system metadata.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_sd_failed_configs', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Current number of service discovery configurations that failed to load.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_info', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Information about the Go environment.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_engine_queries', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'The current number of queries being executed or waiting.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_stack_inuse_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of bytes in use by the stack allocator.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_sd_consul_rpc_duration_seconds', - TABLE_TYPE: 'summary', - UNIT: '', - REMARKS: 'The duration of a Consul RPC call in seconds.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_size_retentions_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: - 'The number of times that blocks were deleted because the maximum number of bytes was exceeded.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_target_sync_length_seconds', - TABLE_TYPE: 'summary', - UNIT: '', - REMARKS: 'Actual interval to sync the scrape pool.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_engine_query_log_failures_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'The number of query log failures.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_target_scrape_pool_exceeded_target_limit_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: - 'Total number of times scrape pools hit the target limit, during sync or config reload.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_ready', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: - 'Whether Prometheus startup was fully completed and the server is ready for normal operation.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_head_max_time_seconds', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Maximum timestamp of the head block.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_goroutines', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of goroutines that currently exist.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_api_remote_read_queries', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'The current number of remote read queries being executed or waiting.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_rule_group_duration_seconds', - TABLE_TYPE: 'summary', - UNIT: '', - REMARKS: 'The duration of rule group evaluations.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_compaction_populating_block', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Set to 1 when a block is currently being written to the disk.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_reloads_failures_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Number of times the database failed to reloadBlocks block data from disk.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_too_old_samples_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: - 'Total number of out of order samples ingestion failed attempts with out of support enabled, but sample outside of time window.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_head_samples_appended_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of appended samples.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_heap_released_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of heap bytes released to OS.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_head_truncations_failed_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of head truncations that failed.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'net_conntrack_listener_conn_accepted_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of connections opened to the listener of a given name.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'process_virtual_memory_max_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Maximum amount of virtual memory available in bytes.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_template_text_expansion_failures_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'The total number of template text expansion failures.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_sd_kuma_fetch_failures_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'The number of Kuma MADS fetch call failures.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_head_chunks_created_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of chunks created in the head', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'go_memstats_next_gc_bytes', - TABLE_TYPE: 'gauge', - UNIT: '', - REMARKS: 'Number of heap bytes when next garbage collection will take place.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_http_response_size_bytes', - TABLE_TYPE: 'histogram', - UNIT: '', - REMARKS: 'Histogram of response size for HTTP requests.', - }, - { - TABLE_CATALOG: 'prometheus_1', - TABLE_SCHEMA: 'default', - TABLE_NAME: 'prometheus_tsdb_head_series_not_found_total', - TABLE_TYPE: 'counter', - UNIT: '', - REMARKS: 'Total number of requests for series that were not found.', - }, - ], -}; \ No newline at end of file diff --git a/dashboards-observability/public/components/metrics/sidebar/search_bar.tsx b/dashboards-observability/public/components/metrics/sidebar/search_bar.tsx new file mode 100644 index 000000000..9a6781776 --- /dev/null +++ b/dashboards-observability/public/components/metrics/sidebar/search_bar.tsx @@ -0,0 +1,59 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { EuiGlobalToastList, EuiSearchBar, EuiToast } from '@elastic/eui'; +import React, { useState } from 'react'; +import { pplServiceRequestor } from '../helpers/utils'; + +interface ISearchBarProps { + allAvailableMetrics: any; + handleAddMetric: any; +} + +export const SearchBar = (props: ISearchBarProps) => { + const { allAvailableMetrics, handleAddMetric } = props; + + const [query, setQuery] = useState(''); + const [error, setError] = useState(null); + + const [toasts, setToasts] = useState([]); + const addToast = (res: string) => { + if (res === 'success') { + const toast = { + id: 'success', + title: 'Metric successfully added!!', + color: 'success', + }; + setToasts(toasts.concat(toast)); + } else { + const toast = { + id: 'fail', + title: 'Metric not found.', + color: 'danger', + }; + setToasts(toasts.concat(toast)); + } + }; + const removeToast = (removedToast: any) => { + setToasts(toasts.filter((toast: any) => toast.id !== removedToast.id)); + }; + + const onChange = ({ query }) => { + const metric = allAvailableMetrics.find((row: any) => row.name.includes(query.text)); + if (metric) { + handleAddMetric(metric); + addToast('success'); + } else { + addToast('fail'); + } + }; + + return ( +
+ + +
+ ); +}; diff --git a/dashboards-observability/public/components/metrics/sidebar/sidebar.scss b/dashboards-observability/public/components/metrics/sidebar/sidebar.scss index 92274afdd..5c6e80a4e 100644 --- a/dashboards-observability/public/components/metrics/sidebar/sidebar.scss +++ b/dashboards-observability/public/components/metrics/sidebar/sidebar.scss @@ -143,3 +143,7 @@ overflow:auto; max-height:100vh; } + +.metricsList { + overflow-x:auto; +} diff --git a/dashboards-observability/public/components/metrics/sidebar/sidebar.tsx b/dashboards-observability/public/components/metrics/sidebar/sidebar.tsx index 478d99d88..bf4a432c4 100644 --- a/dashboards-observability/public/components/metrics/sidebar/sidebar.tsx +++ b/dashboards-observability/public/components/metrics/sidebar/sidebar.tsx @@ -5,8 +5,7 @@ import './sidebar.scss'; -import React, { useEffect, useState } from 'react'; -import { cloneDeep } from 'lodash'; +import React, { useEffect } from 'react'; import { EuiTitle, EuiSpacer, EuiAccordion, EuiLink } from '@elastic/eui'; import { I18nProvider } from '@osd/i18n/react'; import { batch, useDispatch, useSelector } from 'react-redux'; @@ -16,6 +15,7 @@ import { selectMetric, loadMetrics, selectedMetricsSelector, + recentlyCreatedMetricsSelector, } from '../redux/slices/metrics_slice'; import { CoreStart } from '../../../../../../src/core/public'; import PPLService from '../../../services/requests/ppl'; @@ -31,6 +31,7 @@ export const Sidebar = (props: ISidebarProps) => { const availableMetrics = useSelector(availableMetricsSelector); const selectedMetrics = useSelector(selectedMetricsSelector); + const recentlyCreatedMetrics = useSelector(recentlyCreatedMetricsSelector); useEffect(() => { batch(() => { @@ -46,17 +47,25 @@ export const Sidebar = (props: ISidebarProps) => { return ( -
+
- Recently Created Fields + Recently Created Metrics } paddingSize="xs" - /> + > +
    + {recentlyCreatedMetrics.map((metric: any) => ( +
  • + handleAddMetric(metric)}>{metric.name} +
  • + ))} +
+
{ } paddingSize="xs" > -
    +
      {selectedMetrics.map((metric: any) => (
    • handleRemoveMetric(metric)}>{metric.name} @@ -87,13 +96,16 @@ export const Sidebar = (props: ISidebarProps) => { } paddingSize="xs" > -
        - {availableMetrics.map((metric: any) => ( +
          + {availableMetrics.slice(0, 100).map((metric: any) => (
        • handleAddMetric(metric)}>{metric.name}
        • ))}
        + {availableMetrics.length > 100 && ( +

        Use search bar for searching through all metrics.

        + )}
diff --git a/dashboards-observability/public/components/metrics/top_menu/top_menu.tsx b/dashboards-observability/public/components/metrics/top_menu/top_menu.tsx index 96c8701ec..4d10c1168 100644 --- a/dashboards-observability/public/components/metrics/top_menu/top_menu.tsx +++ b/dashboards-observability/public/components/metrics/top_menu/top_menu.tsx @@ -14,12 +14,14 @@ import { EuiButtonIcon, } from '@elastic/eui'; import { DurationRange } from '@elastic/eui/src/components/date_picker/types'; +import { useDispatch, useSelector } from 'react-redux'; import { uiSettingsService } from '../../../../common/utils'; import React, { useState } from 'react'; import { MetricType } from '../../../../common/types/metrics'; import { resolutionOptions } from '../../../../common/constants/metrics'; - import './top_menu.scss'; +import { allAvailableMetricsSelector, selectMetric } from '../redux/slices/metrics_slice'; +import { SearchBar } from '../sidebar/search_bar'; interface TopMenuProps { IsTopPanelDisabled: boolean; @@ -58,6 +60,10 @@ export const TopMenu = ({ }: TopMenuProps) => { const [originalPanelVisualizations, setOriginalPanelVisualizations] = useState([]); + const dispatch = useDispatch(); + const allAvailableMetrics = useSelector(allAvailableMetricsSelector); + const handleAddMetric = (metric: any) => dispatch(selectMetric(metric)); + // toggle between panel edit mode const editPanel = (editType: string) => { setEditMode(!editMode); @@ -82,12 +88,6 @@ export const TopMenu = ({ setResolutionValue(e.target.value); }; - const cancelButton = ( - editPanel('cancel')}> - Cancel - - ); - const saveButton = ( editPanel('save')}> Save view @@ -110,16 +110,11 @@ export const TopMenu = ({ - - - - @@ -172,7 +167,6 @@ export const TopMenu = ({ {editMode ? ( <> - {cancelButton} {saveButton} ) : (