Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
c890396
feat(fields-metadata): add server and client services
May 20, 2024
cfcada8
feat(io-ts-utils): add arrayToString util
May 20, 2024
93fb2fb
chore(fields-metadata): update plugin aliases
May 20, 2024
3f59e8f
chore(fields-metadata): add code ownership
May 20, 2024
d46a0dd
refactor(unified-doc-viewer): use fieldsMetadata for flyout descriptions
May 20, 2024
89ebdfb
feat(fields-metadata): add client service caching layer
May 20, 2024
c5c8726
feat(fields-metadata): add attributes filtering
May 20, 2024
4e18dd8
Merge branch 'main' into spacetime/fields-metadata-plugin
tonyghiani May 20, 2024
8d1d6f6
chore(fields-metadata): update tsconfig
May 20, 2024
9b7b72a
feat(fields-metadata): add source attribute
May 21, 2024
7ee8810
feat(fleet): mvp integration fields extractor
May 21, 2024
23b9e80
refactor(fields-metadata): renaming and update exports
May 21, 2024
fd3dd53
Merge branch 'main' into spacetime/fields-metadata-plugin
tonyghiani May 21, 2024
6775428
feat(fields-metadata): get to work integration fields mvp
May 21, 2024
1b23ef4
refactor(fields-metadata): update cache key
May 21, 2024
2167cec
refactor(fleet): move implementation to package service and add smoke…
May 22, 2024
5c8cd73
refactor(fields-metadata): update FieldMetadata defaults
May 22, 2024
2a214aa
refactor(fields-metadata): update custom errors
May 22, 2024
cc79b37
Merge branch 'main' into spacetime/fields-metadata-plugin
tonyghiani May 22, 2024
1940bbd
refactor(fields-metadata): update typing issues
May 22, 2024
065918e
test(fields-metadata): add first useFieldsMetadata test
May 22, 2024
8caf30b
test(fields-metadata): update useFieldsMetadata test
May 23, 2024
2771b81
test(fields-metadata): update FieldsMetadataClient test
May 23, 2024
77e28f7
refactor(fields-metadata): remove stop lifecycle
May 23, 2024
0b891f6
chore(fields-metadata): add bundle limits
May 23, 2024
4b2ebe3
refactor(fields-metadata): update start contracts
May 23, 2024
81992fe
Merge branch 'main' into spacetime/fields-metadata-plugin
tonyghiani May 23, 2024
ce75a67
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine May 23, 2024
3702350
refactor(io-ts-utils): update test
May 23, 2024
d30179a
Merge branch 'spacetime/fields-metadata-plugin' of github.com:tonyghi…
May 23, 2024
e923f54
[CI] Auto-commit changed files from 'node scripts/generate codeowners'
kibanamachine May 23, 2024
70039b6
refactor(unified-doc-viewer): remove multiple optional chaining apply…
May 23, 2024
891c0db
[CI] Auto-commit changed files from 'node scripts/build_plugin_list_d…
kibanamachine May 23, 2024
e6ac4c0
refactor(unified-doc-viewer): lift conditional to render field descri…
May 23, 2024
dc0a04a
Merge branch 'spacetime/fields-metadata-plugin' of github.com:tonyghi…
May 23, 2024
3950d42
chore(kbn-optimizer): update limits file
May 23, 2024
71946c5
refactor(fields-metadata): minor types changes
May 23, 2024
cf34cb4
refactor(fields-metadata): cleanup unnecessary code
May 23, 2024
8107ded
refactor(fields-metadata): improve client error handling
May 23, 2024
bf78af0
refactor(fields-metadata): minor mocks adjustments
May 23, 2024
ee9412b
refactor(fields-metadata): improve integration service readability
May 23, 2024
abb0477
refactor(fields-metadata): update type
May 23, 2024
57aa072
refactor(fields-metadata): improve typing readability for fleet
May 23, 2024
93754ca
refactor(fleet): improve comments
May 23, 2024
d73c010
Merge branch 'main' into spacetime/fields-metadata-plugin
tonyghiani May 23, 2024
f86c2fe
refactor(fields-metadata): fix useFieldsMetadata mocks
May 23, 2024
2f3aa2b
Merge branch 'main' into spacetime/fields-metadata-plugin
tonyghiani May 23, 2024
3a738de
docs(fields-metadata): add readme
May 24, 2024
aa9a11a
Merge branch 'main' into spacetime/fields-metadata-plugin
tonyghiani May 24, 2024
0a3356f
[CI] Auto-commit changed files from 'node scripts/build_plugin_list_d…
kibanamachine May 24, 2024
d586714
Merge branch 'main' into spacetime/fields-metadata-plugin
tonyghiani May 24, 2024
6c1944f
Merge branch 'main' into spacetime/fields-metadata-plugin
tonyghiani May 27, 2024
65f00ea
refactor(io-ts-utils): consistently use isRight for assertions
May 27, 2024
169b68c
refactor(fields-metadata): update serialization for unordered arrays
May 28, 2024
9a28766
refactor(fields-metadata): optimize first bundle load
May 28, 2024
4f3eeb2
refactor(fields-metadata): remove commented import
May 28, 2024
e55bf02
refactor(fields-metadata): further bundle optimization
May 28, 2024
c2f3716
Merge branch 'main' into spacetime/fields-metadata-plugin
tonyghiani May 28, 2024
0817162
refactor(fields-metadata): revert change to dataViewFieldEditor bundl…
May 29, 2024
9b13221
refactor(fields-metadata): make dataset parameter required if integra…
May 29, 2024
a5d291b
Merge branch 'main' into spacetime/fields-metadata-plugin
tonyghiani May 29, 2024
b065506
tests(fleet): add tests for data stream fields resolution
May 30, 2024
3972423
Merge branch 'main' into spacetime/fields-metadata-plugin
tonyghiani Jun 3, 2024
b2b7118
refactor(fields-metadata): address comments
Jun 4, 2024
d09df45
Merge branch 'main' into spacetime/fields-metadata-plugin
tonyghiani Jun 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ examples/field_formats_example @elastic/kibana-data-discovery
src/plugins/field_formats @elastic/kibana-data-discovery
packages/kbn-field-types @elastic/kibana-data-discovery
packages/kbn-field-utils @elastic/kibana-data-discovery
x-pack/plugins/fields_metadata @elastic/obs-ux-logs-team
x-pack/plugins/file_upload @elastic/kibana-gis
examples/files_example @elastic/appex-sharedux
src/plugins/files_management @elastic/appex-sharedux
Expand Down
4 changes: 4 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,10 @@ activities.
|The features plugin enhance Kibana with a per-feature privilege system.


|{kib-repo}blob/{branch}/x-pack/plugins/fields_metadata/README.md[fieldsMetadata]
|The @kbn/fields-metadata-plugin is designed to provide a centralized and asynchronous way to consume field metadata across Kibana. This plugin addresses the need for on-demand retrieval of field metadata from static ECS definitions and integration manifests, with the flexibility to extend to additional resolution sources in the future.


|{kib-repo}blob/{branch}/x-pack/plugins/file_upload[fileUpload]
|WARNING: Missing README.

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@
"@kbn/field-formats-plugin": "link:src/plugins/field_formats",
"@kbn/field-types": "link:packages/kbn-field-types",
"@kbn/field-utils": "link:packages/kbn-field-utils",
"@kbn/fields-metadata-plugin": "link:x-pack/plugins/fields_metadata",
"@kbn/file-upload-plugin": "link:x-pack/plugins/file_upload",
"@kbn/files-example-plugin": "link:examples/files_example",
"@kbn/files-management-plugin": "link:src/plugins/files_management",
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-io-ts-utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
export type { IndexPattern } from './src/index_pattern_rt';
export type { NonEmptyString, NonEmptyStringBrand } from './src/non_empty_string_rt';

export { arrayToStringRt } from './src/array_to_string_rt';
export { deepExactRt } from './src/deep_exact_rt';
export { indexPatternRt } from './src/index_pattern_rt';
export { jsonRt } from './src/json_rt';
Expand Down
52 changes: 52 additions & 0 deletions packages/kbn-io-ts-utils/src/array_to_string_rt/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import * as rt from 'io-ts';
import { arrayToStringRt } from '.';
import { isRight, Either, fold } from 'fp-ts/lib/Either';
import { identity } from 'fp-ts/lib/function';

function getValueOrThrow(either: Either<unknown, any>) {
return fold(() => {
throw new Error('Cannot get right value of left');
}, identity)(either);
}

describe('arrayToStringRt', () => {
it('should validate strings', () => {
expect(isRight(arrayToStringRt.decode(''))).toBe(true);
expect(isRight(arrayToStringRt.decode('message'))).toBe(true);
expect(isRight(arrayToStringRt.decode('message,event.original'))).toBe(true);
expect(isRight(arrayToStringRt.decode({}))).toBe(false);
expect(isRight(arrayToStringRt.decode(true))).toBe(false);
});

it('should return array of strings when decoding', () => {
expect(getValueOrThrow(arrayToStringRt.decode(''))).toEqual(['']);
expect(getValueOrThrow(arrayToStringRt.decode('message'))).toEqual(['message']);
expect(getValueOrThrow(arrayToStringRt.decode('message,event.original'))).toEqual([
'message',
'event.original',
]);
});

it('should be pipable', () => {
const piped = arrayToStringRt.pipe(rt.array(rt.string));

const validInput = ['message', 'event.original'];
const invalidInput = {};

const valid = piped.decode(validInput.join(','));
const invalid = piped.decode(invalidInput);

expect(isRight(valid)).toBe(true);
expect(getValueOrThrow(valid)).toEqual(validInput);

expect(isRight(invalid)).toBe(false);
});
});
24 changes: 24 additions & 0 deletions packages/kbn-io-ts-utils/src/array_to_string_rt/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { either } from 'fp-ts/lib/Either';
import * as rt from 'io-ts';

export const arrayToStringRt = new rt.Type<unknown[], string, unknown>(
'arrayToString',
rt.array(rt.unknown).is,
(input, context) =>
either.chain(rt.string.validate(input, context), (str) => {
try {
return rt.success(str.split(','));
} catch (e) {
return rt.failure(input, context);
}
}),
(arr) => arr.join(',')
);
1 change: 1 addition & 0 deletions packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ pageLoadAssetSize:
expressionXY: 45000
features: 21723
fieldFormats: 65209
fieldsMetadata: 21885
files: 22673
filesManagement: 18683
fileUpload: 25664
Expand Down
1 change: 1 addition & 0 deletions src/plugins/unified_doc_viewer/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"browser": true,
"requiredBundles": ["kibanaUtils"],
"requiredPlugins": ["data", "discoverShared", "fieldFormats"],
"optionalPlugins": ["fieldsMetadata"]
}
}
2 changes: 2 additions & 0 deletions src/plugins/unified_doc_viewer/public/__mocks__/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { analyticsServiceMock } from '@kbn/core-analytics-browser-mocks';
import { dataPluginMock } from '@kbn/data-plugin/public/mocks';
import { discoverSharedPluginMock } from '@kbn/discover-shared-plugin/public/mocks';
import { fieldFormatsMock } from '@kbn/field-formats-plugin/common/mocks';
import { fieldsMetadataPluginPublicMock } from '@kbn/fields-metadata-plugin/public/mocks';
import { uiSettingsServiceMock } from '@kbn/core-ui-settings-browser-mocks';
import type { UnifiedDocViewerServices, UnifiedDocViewerStart } from '../types';
import { Storage } from '@kbn/kibana-utils-plugin/public';
Expand All @@ -24,6 +25,7 @@ export const mockUnifiedDocViewerServices: jest.Mocked<UnifiedDocViewerServices>
data: dataPluginMock.createStartContract(),
discoverShared: discoverSharedPluginMock.createStartContract(),
fieldFormats: fieldFormatsMock,
fieldsMetadata: fieldsMetadataPluginPublicMock.createStartContract(),
storage: new Storage(localStorage),
uiSettings: uiSettingsServiceMock.createStartContract(),
unifiedDocViewer: mockUnifiedDocViewer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { i18n } from '@kbn/i18n';
import { DataTableRecord, LogDocumentOverview, fieldConstants } from '@kbn/discover-utils';
import { HighlightField } from './sub_components/highlight_field';
import { HighlightSection } from './sub_components/highlight_section';
import { getUnifiedDocViewerServices } from '../../plugin';

export function LogsOverviewHighlights({
formattedDoc,
Expand All @@ -21,6 +22,30 @@ export function LogsOverviewHighlights({
formattedDoc: LogDocumentOverview;
flattenedDoc: DataTableRecord['flattened'];
}) {
const {
fieldsMetadata: { useFieldsMetadata },
} = getUnifiedDocViewerServices();

const { fieldsMetadata = {} } = useFieldsMetadata({
attributes: ['flat_name', 'short', 'type'],
fieldNames: [
fieldConstants.SERVICE_NAME_FIELD,
fieldConstants.HOST_NAME_FIELD,
fieldConstants.TRACE_ID_FIELD,
fieldConstants.ORCHESTRATOR_CLUSTER_NAME_FIELD,
fieldConstants.ORCHESTRATOR_RESOURCE_ID_FIELD,
fieldConstants.CLOUD_PROVIDER_FIELD,
fieldConstants.CLOUD_REGION_FIELD,
fieldConstants.CLOUD_AVAILABILITY_ZONE_FIELD,
fieldConstants.CLOUD_PROJECT_ID_FIELD,
fieldConstants.CLOUD_INSTANCE_ID_FIELD,
fieldConstants.LOG_FILE_PATH_FIELD,
fieldConstants.DATASTREAM_DATASET_FIELD,
fieldConstants.DATASTREAM_NAMESPACE_FIELD,
fieldConstants.AGENT_NAME_FIELD,
],
});

const getHighlightProps = (field: keyof LogDocumentOverview) => ({
field,
formattedValue: formattedDoc[field],
Expand All @@ -38,34 +63,39 @@ export function LogsOverviewHighlights({
<HighlightField
data-test-subj="unifiedDocViewLogsOverviewService"
label={serviceLabel}
fieldMetadata={fieldsMetadata[fieldConstants.SERVICE_NAME_FIELD]}
{...getHighlightProps(fieldConstants.SERVICE_NAME_FIELD)}
/>
)}
{formattedDoc[fieldConstants.HOST_NAME_FIELD] && (
<HighlightField
data-test-subj="unifiedDocViewLogsOverviewHostName"
label={hostNameLabel}
fieldMetadata={fieldsMetadata[fieldConstants.HOST_NAME_FIELD]}
{...getHighlightProps(fieldConstants.HOST_NAME_FIELD)}
/>
)}
{formattedDoc[fieldConstants.TRACE_ID_FIELD] && (
<HighlightField
data-test-subj="unifiedDocViewLogsOverviewTrace"
label={traceLabel}
fieldMetadata={fieldsMetadata[fieldConstants.TRACE_ID_FIELD]}
{...getHighlightProps(fieldConstants.TRACE_ID_FIELD)}
/>
)}
{formattedDoc[fieldConstants.ORCHESTRATOR_CLUSTER_NAME_FIELD] && (
<HighlightField
data-test-subj="unifiedDocViewLogsOverviewClusterName"
label={orchestratorClusterNameLabel}
fieldMetadata={fieldsMetadata[fieldConstants.ORCHESTRATOR_CLUSTER_NAME_FIELD]}
{...getHighlightProps(fieldConstants.ORCHESTRATOR_CLUSTER_NAME_FIELD)}
/>
)}
{formattedDoc[fieldConstants.ORCHESTRATOR_RESOURCE_ID_FIELD] && (
<HighlightField
data-test-subj="unifiedDocViewLogsOverviewResourceId"
label={orchestratorResourceIdLabel}
fieldMetadata={fieldsMetadata[fieldConstants.ORCHESTRATOR_RESOURCE_ID_FIELD]}
{...getHighlightProps(fieldConstants.ORCHESTRATOR_RESOURCE_ID_FIELD)}
/>
)}
Expand All @@ -79,6 +109,7 @@ export function LogsOverviewHighlights({
<HighlightField
data-test-subj="unifiedDocViewLogsOverviewCloudProvider"
label={cloudProviderLabel}
fieldMetadata={fieldsMetadata[fieldConstants.CLOUD_PROVIDER_FIELD]}
icon={
<CloudProviderIcon
cloudProvider={first(
Expand All @@ -93,27 +124,31 @@ export function LogsOverviewHighlights({
<HighlightField
data-test-subj="unifiedDocViewLogsOverviewCloudRegion"
label={cloudRegionLabel}
fieldMetadata={fieldsMetadata[fieldConstants.CLOUD_REGION_FIELD]}
{...getHighlightProps(fieldConstants.CLOUD_REGION_FIELD)}
/>
)}
{formattedDoc[fieldConstants.CLOUD_AVAILABILITY_ZONE_FIELD] && (
<HighlightField
data-test-subj="unifiedDocViewLogsOverviewCloudAz"
label={cloudAvailabilityZoneLabel}
fieldMetadata={fieldsMetadata[fieldConstants.CLOUD_AVAILABILITY_ZONE_FIELD]}
{...getHighlightProps(fieldConstants.CLOUD_AVAILABILITY_ZONE_FIELD)}
/>
)}
{formattedDoc[fieldConstants.CLOUD_PROJECT_ID_FIELD] && (
<HighlightField
data-test-subj="unifiedDocViewLogsOverviewCloudProjectId"
label={cloudProjectIdLabel}
fieldMetadata={fieldsMetadata[fieldConstants.CLOUD_PROJECT_ID_FIELD]}
{...getHighlightProps(fieldConstants.CLOUD_PROJECT_ID_FIELD)}
/>
)}
{formattedDoc[fieldConstants.CLOUD_INSTANCE_ID_FIELD] && (
<HighlightField
data-test-subj="unifiedDocViewLogsOverviewCloudInstanceId"
label={cloudInstanceIdLabel}
fieldMetadata={fieldsMetadata[fieldConstants.CLOUD_INSTANCE_ID_FIELD]}
{...getHighlightProps(fieldConstants.CLOUD_INSTANCE_ID_FIELD)}
/>
)}
Expand All @@ -127,20 +162,23 @@ export function LogsOverviewHighlights({
<HighlightField
data-test-subj="unifiedDocViewLogsOverviewLogPathFile"
label={logPathFileLabel}
fieldMetadata={fieldsMetadata[fieldConstants.LOG_FILE_PATH_FIELD]}
{...getHighlightProps(fieldConstants.LOG_FILE_PATH_FIELD)}
/>
)}
{formattedDoc[fieldConstants.DATASTREAM_DATASET_FIELD] && (
<HighlightField
data-test-subj="unifiedDocViewLogsOverviewDataset"
label={datasetLabel}
fieldMetadata={fieldsMetadata[fieldConstants.DATASTREAM_DATASET_FIELD]}
{...getHighlightProps(fieldConstants.DATASTREAM_DATASET_FIELD)}
/>
)}
{formattedDoc[fieldConstants.DATASTREAM_NAMESPACE_FIELD] && (
<HighlightField
data-test-subj="unifiedDocViewLogsOverviewNamespace"
label={namespaceLabel}
fieldMetadata={fieldsMetadata[fieldConstants.DATASTREAM_NAMESPACE_FIELD]}
useBadge
{...getHighlightProps(fieldConstants.DATASTREAM_NAMESPACE_FIELD)}
/>
Expand All @@ -149,6 +187,7 @@ export function LogsOverviewHighlights({
<HighlightField
data-test-subj="unifiedDocViewLogsOverviewLogShipper"
label={shipperLabel}
fieldMetadata={fieldsMetadata[fieldConstants.AGENT_NAME_FIELD]}
{...getHighlightProps(fieldConstants.AGENT_NAME_FIELD)}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ import { css } from '@emotion/react';
import React, { ReactNode } from 'react';
import { dynamic } from '@kbn/shared-ux-utility';
import { euiThemeVars } from '@kbn/ui-theme';
import { PartialFieldMetadataPlain } from '@kbn/fields-metadata-plugin/common';
import { HoverActionPopover } from './hover_popover_action';

const HighlightFieldDescription = dynamic(() => import('./highlight_field_description'));

interface HighlightFieldProps {
field: string;
fieldMetadata?: PartialFieldMetadataPlain;
formattedValue?: string;
icon?: ReactNode;
label: string;
Expand All @@ -26,20 +28,23 @@ interface HighlightFieldProps {

export function HighlightField({
field,
fieldMetadata,
formattedValue,
icon,
label,
useBadge = false,
value,
...props
}: HighlightFieldProps) {
const hasFieldDescription = !!fieldMetadata?.short;

return formattedValue && value ? (
<div {...props}>
<EuiFlexGroup responsive={false} alignItems="center" gutterSize="xs">
<EuiTitle css={fieldNameStyle} size="xxxs">
<span>{label}</span>
</EuiTitle>
<HighlightFieldDescription fieldName={field} />
{hasFieldDescription ? <HighlightFieldDescription fieldMetadata={fieldMetadata} /> : null}
</EuiFlexGroup>
<HoverActionPopover title={value} value={value} field={field}>
<EuiFlexGroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
*/

import { EuiFlexGroup, EuiIconTip } from '@elastic/eui';
import { EcsFlat } from '@elastic/ecs';
import { PartialFieldMetadataPlain } from '@kbn/fields-metadata-plugin/common';
import { FieldIcon } from '@kbn/react-field';
import React from 'react';

export function HighlightFieldDescription({ fieldName }: { fieldName: string }) {
const { short, type } = EcsFlat[fieldName as keyof typeof EcsFlat] ?? {};

if (!short) return null;
export function HighlightFieldDescription({
fieldMetadata,
}: {
fieldMetadata: PartialFieldMetadataPlain;
}) {
const { flat_name: fieldName, short, type } = fieldMetadata;

const title = (
<EuiFlexGroup alignItems="center" gutterSize="s">
Expand Down
5 changes: 4 additions & 1 deletion src/plugins/unified_doc_viewer/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { FieldFormatsStart } from '@kbn/field-formats-plugin/public';
import { CoreStart } from '@kbn/core/public';
import { dynamic } from '@kbn/shared-ux-utility';
import { DiscoverSharedPublicStart } from '@kbn/discover-shared-plugin/public';
import { FieldsMetadataPublicStart } from '@kbn/fields-metadata-plugin/public';
import type { UnifiedDocViewerServices } from './types';

export const [getUnifiedDocViewerServices, setUnifiedDocViewerServices] =
Expand Down Expand Up @@ -50,6 +51,7 @@ export interface UnifiedDocViewerStartDeps {
data: DataPublicPluginStart;
discoverShared: DiscoverSharedPublicStart;
fieldFormats: FieldFormatsStart;
fieldsMetadata: FieldsMetadataPublicStart;
}

export class UnifiedDocViewerPublicPlugin
Expand Down Expand Up @@ -118,7 +120,7 @@ export class UnifiedDocViewerPublicPlugin

public start(core: CoreStart, deps: UnifiedDocViewerStartDeps) {
const { analytics, uiSettings } = core;
const { data, discoverShared, fieldFormats } = deps;
const { data, discoverShared, fieldFormats, fieldsMetadata } = deps;
const storage = new Storage(localStorage);
const unifiedDocViewer = {
registry: this.docViewsRegistry,
Expand All @@ -128,6 +130,7 @@ export class UnifiedDocViewerPublicPlugin
data,
discoverShared,
fieldFormats,
fieldsMetadata,
storage,
uiSettings,
unifiedDocViewer,
Expand Down
Loading