Skip to content

Commit

Permalink
Remove host tsvb fields and change types
Browse files Browse the repository at this point in the history
  • Loading branch information
jennypavlova committed Oct 29, 2024
1 parent 75040cd commit 7274b6f
Show file tree
Hide file tree
Showing 20 changed files with 6 additions and 1,270 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ export const getFilteredMetrics = (
.filter((data) => data && data.source === 'metrics')
.map((data) => data && data.name);
return requiredMetrics.filter((metric) => {
const metricModelCreator = metrics.tsvb[metric];
const metricModelCreator = metrics?.tsvb[metric] ?? null;

// We just need to get a dummy version of the model so we can filter
// using the `requires` attribute.
const metricModel = metricModelCreator(TIMESTAMP_FIELD, 'test', '>=1m');
return metricMetadata.some((m) => m && metricModel.requires.includes(m));
const metricModel = metricModelCreator
? metricModelCreator(TIMESTAMP_FIELD, 'test', '>=1m')
: { requires: [''] }; // when tsvb is not defined (host & container)
return metricMetadata.some((m) => m && metricModel?.requires?.includes(m));
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* 2.0.
*/
import { snapshot } from './snapshot';
import { tsvb } from './tsvb';
import { InventoryMetricsWithCharts } from '../../types';
import type { HostFormulas } from './formulas';
import type { HostCharts } from './charts';
Expand All @@ -18,7 +17,6 @@ export const hostSnapshotMetricTypes = Object.keys(exposedHostSnapshotMetrics) a
>;

export const metrics: InventoryMetricsWithCharts<HostFormulas, HostCharts> = {
tsvb,
snapshot,
getFormulas: async () => await import('./formulas').then(({ formulas }) => formulas),
getCharts: async () => await import('./charts').then(({ charts }) => charts),
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 7274b6f

Please sign in to comment.