The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
grafana/public/app/core/utils/standardTransformers.ts

27 lines
1.6 KiB

import { TransformerRegistyItem } from '@grafana/data';
import { reduceTransformRegistryItem } from '../components/TransformersUI/ReduceTransformerEditor';
import { filterFieldsByNameTransformRegistryItem } from '../components/TransformersUI/FilterByNameTransformerEditor';
import { filterFramesByRefIdTransformRegistryItem } from '../components/TransformersUI/FilterByRefIdTransformerEditor';
import { organizeFieldsTransformRegistryItem } from '../components/TransformersUI/OrganizeFieldsTransformerEditor';
import { seriesToFieldsTransformerRegistryItem } from '../components/TransformersUI/SeriesToFieldsTransformerEditor';
import { calculateFieldTransformRegistryItem } from '../components/TransformersUI/CalculateFieldTransformerEditor';
import { labelsToFieldsTransformerRegistryItem } from '../components/TransformersUI/LabelsToFieldsTransformerEditor';
Transformations: Adding group by and aggregate on multiple fields transformation * Adding Occurences transformer * Adding test for Occurences Transformer * Cleanup. Adding a test. * Adding doc * Modifying UI to support custom calculations options * Implementing data transformation * Finalizing calculations implementation * Cleanup * Using Fields instead of arrays in data grouping * Renaming transformation to GroupBy * Adding some doc * Apply suggestions (solving TS typing errors) Co-authored-by: Marcus Andersson <systemvetaren@gmail.com> * Tweaking UI * Preventing of selecting twice the same field name. * Removing console print. No calculations by default. * Forgot to add the current value to the GroupBy selector * Solving some typing issues and prettyfier errors * Cleanup * Updating test * Ensure proper copy of options (solves some issues) * Check if the fields exist in the data before processing * Adding missing import in test file * If group by field not specified, return all data untouched. * Adding another missing import in test * Minor updates * Implementing GroupBy multiple fields + Improve field typing * Removing console prints * Allowing the exact number of fields to be added as aggregation * Centering remove button icon * Cleanup * Correcting TS error * Chaging transformer options structure * Sorting so GroupBy fields appear on top * Cleanup * Simplifying some operations. Adding curly brackets. * Changing some labels on the UI * Updating test * Cleanup * Updating doc * Fixed field list. Storing options as Record instead of Array. * Update test * Cleaned up the group by editor UI code. * changed the transform to a table layout instead of a flexbox layout. * cleaned up group by transformer. * removed unused imports. * Added some more tests. * Added one more test and cleaned up code. * fixed failing test. * Fixed so we we have the proper casing on naming. * fixed so we don't wrap on the first row. Co-authored-by: Marcus Andersson <systemvetaren@gmail.com> Co-authored-by: Torkel Ödegaard <torkel@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
5 years ago
import { groupByTransformRegistryItem } from '../components/TransformersUI/GroupByTransformerEditor';
import { mergeTransformerRegistryItem } from '../components/TransformersUI/MergeTransformerEditor';
import { seriesToRowsTransformerRegistryItem } from '../components/TransformersUI/SeriesToRowsTransformerEditor';
export const getStandardTransformers = (): Array<TransformerRegistyItem<any>> => {
return [
reduceTransformRegistryItem,
filterFieldsByNameTransformRegistryItem,
filterFramesByRefIdTransformRegistryItem,
organizeFieldsTransformRegistryItem,
seriesToFieldsTransformerRegistryItem,
seriesToRowsTransformerRegistryItem,
calculateFieldTransformRegistryItem,
labelsToFieldsTransformerRegistryItem,
Transformations: Adding group by and aggregate on multiple fields transformation * Adding Occurences transformer * Adding test for Occurences Transformer * Cleanup. Adding a test. * Adding doc * Modifying UI to support custom calculations options * Implementing data transformation * Finalizing calculations implementation * Cleanup * Using Fields instead of arrays in data grouping * Renaming transformation to GroupBy * Adding some doc * Apply suggestions (solving TS typing errors) Co-authored-by: Marcus Andersson <systemvetaren@gmail.com> * Tweaking UI * Preventing of selecting twice the same field name. * Removing console print. No calculations by default. * Forgot to add the current value to the GroupBy selector * Solving some typing issues and prettyfier errors * Cleanup * Updating test * Ensure proper copy of options (solves some issues) * Check if the fields exist in the data before processing * Adding missing import in test file * If group by field not specified, return all data untouched. * Adding another missing import in test * Minor updates * Implementing GroupBy multiple fields + Improve field typing * Removing console prints * Allowing the exact number of fields to be added as aggregation * Centering remove button icon * Cleanup * Correcting TS error * Chaging transformer options structure * Sorting so GroupBy fields appear on top * Cleanup * Simplifying some operations. Adding curly brackets. * Changing some labels on the UI * Updating test * Cleanup * Updating doc * Fixed field list. Storing options as Record instead of Array. * Update test * Cleaned up the group by editor UI code. * changed the transform to a table layout instead of a flexbox layout. * cleaned up group by transformer. * removed unused imports. * Added some more tests. * Added one more test and cleaned up code. * fixed failing test. * Fixed so we we have the proper casing on naming. * fixed so we don't wrap on the first row. Co-authored-by: Marcus Andersson <systemvetaren@gmail.com> Co-authored-by: Torkel Ödegaard <torkel@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
5 years ago
groupByTransformRegistryItem,
mergeTransformerRegistryItem,
];
};