-
Notifications
You must be signed in to change notification settings - Fork 894
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Add support for otel sample data - logs, traces and metrics (#8587
) * add support for otel sample data - traces and services Signed-off-by: Shenoy Pratik <[email protected]> * Changeset file for PR #8587 created/updated * upload gz otel data Signed-off-by: Eric <[email protected]> * add mappings Signed-off-by: Eric <[email protected]> * correct mappings Signed-off-by: Eric <[email protected]> * Fix the time mismatch for otel sample data Signed-off-by: Ryan Liang <[email protected]> * adjust time maker Signed-off-by: Eric <[email protected]> * create index name tests Signed-off-by: Eric <[email protected]> * add indexName field to DataIndexSchema, move nested field functions to utils Signed-off-by: Shenoy Pratik <[email protected]> * add button for app redirection, resolve comments Signed-off-by: Shenoy Pratik <[email protected]> * adjust id field to be as keyword Signed-off-by: Eric <[email protected]> * remove redundant keyword declaration Signed-off-by: Eric <[email protected]> * move to use correct format sample suffix Signed-off-by: Eric <[email protected]> * update text and one log index name/id Signed-off-by: Eric <[email protected]> * fix sample data test Signed-off-by: Eric <[email protected]> --------- Signed-off-by: Shenoy Pratik <[email protected]> Signed-off-by: Eric <[email protected]> Signed-off-by: Ryan Liang <[email protected]> Signed-off-by: Eric Wei <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Co-authored-by: Eric <[email protected]> Co-authored-by: Ryan Liang <[email protected]> (cherry picked from commit c8b5318) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
dff25a9
commit fddbda2
Showing
28 changed files
with
2,241 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
feat: | ||
- Add support for otel sample data - logs, traces and metrics ([#8587](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8587)) |
2 changes: 1 addition & 1 deletion
2
...ome/public/application/components/__snapshots__/sample_data_view_data_button.test.js.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+365 KB
src/plugins/home/public/assets/sample_data_resources/otel/otel_traces.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+286 KB
src/plugins/home/public/assets/sample_data_resources/otel/otel_traces_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+286 KB
src/plugins/home/public/assets/sample_data_resources/otel/otel_traces_dark_new.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+365 KB
src/plugins/home/public/assets/sample_data_resources/otel/otel_traces_new.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
101 changes: 101 additions & 0 deletions
101
src/plugins/home/server/services/sample_data/data_sets/otel/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { i18n } from '@osd/i18n'; | ||
import path from 'path'; | ||
import { AppLinkSchema, SampleDatasetSchema } from '../../lib/sample_dataset_registry_types'; | ||
import { | ||
appendDataSourceId, | ||
getSavedObjectsWithDataSource, | ||
overwriteSavedObjectsWithWorkspaceId, | ||
} from '../util'; | ||
import { logsFieldMappings } from './logs_field_mappings'; | ||
import { metricsFieldMappings } from './metrics_field_mappings'; | ||
import { servicesFieldMappings } from './services_field_mappings'; | ||
import { tracesFieldMappings } from './traces_field_mappings'; | ||
|
||
const otelDataName = i18n.translate('home.sampleData.otelSpecTitle', { | ||
defaultMessage: 'Sample Observability Logs, Traces, and Metrics', | ||
}); | ||
const otelDataDescription = i18n.translate('home.sampleData.otelSpecDescription', { | ||
defaultMessage: | ||
'Correlated observability signals for an e-commerce application in OpenTelemetry standard.', | ||
}); | ||
const initialAppLinks: AppLinkSchema[] = [ | ||
{ | ||
path: 'observability-traces#/traces', | ||
icon: 'apmTrace', | ||
label: 'View traces', | ||
newPath: 'observability-traces-nav#/traces', | ||
appendDatasourceToPath: true, | ||
}, | ||
{ | ||
path: 'observability-traces#/services', | ||
icon: 'graphApp', | ||
label: 'View services', | ||
newPath: 'observability-services-nav#/services', | ||
appendDatasourceToPath: true, | ||
}, | ||
]; | ||
|
||
export const otelSpecProvider = function (): SampleDatasetSchema { | ||
return { | ||
id: 'otel', | ||
name: otelDataName, | ||
description: otelDataDescription, | ||
previewImagePath: '/plugins/home/assets/sample_data_resources/otel/otel_traces.png', | ||
darkPreviewImagePath: '/plugins/home/assets/sample_data_resources/otel/otel_traces_dark.png', | ||
hasNewThemeImages: true, | ||
overviewDashboard: '', | ||
getDataSourceIntegratedDashboard: appendDataSourceId(''), | ||
appLinks: initialAppLinks, | ||
defaultIndex: '', | ||
getDataSourceIntegratedDefaultIndex: appendDataSourceId(''), | ||
savedObjects: [], | ||
getDataSourceIntegratedSavedObjects: (dataSourceId?: string, dataSourceTitle?: string) => | ||
getSavedObjectsWithDataSource([], dataSourceId, dataSourceTitle), | ||
getWorkspaceIntegratedSavedObjects: (workspaceId) => | ||
overwriteSavedObjectsWithWorkspaceId([], workspaceId), | ||
dataIndices: [ | ||
{ | ||
id: 'otel-v1-apm-span-sample', | ||
dataPath: path.join(__dirname, './sample_traces.json.gz'), | ||
fields: tracesFieldMappings, | ||
timeFields: ['startTime', 'endTime', 'traceGroupFields.endTime'], // TODO: add support for 'events.time' | ||
currentTimeMarker: '2024-10-16T19:00:01', | ||
preserveDayOfWeekTimeOfDay: false, | ||
indexName: 'otel-v1-apm-span-sample', | ||
}, | ||
{ | ||
id: 'otel-v1-apm-service-map-sample', | ||
dataPath: path.join(__dirname, './sample_service_map.json.gz'), | ||
fields: servicesFieldMappings, | ||
timeFields: [], | ||
currentTimeMarker: '2024-10-16T19:00:01', | ||
preserveDayOfWeekTimeOfDay: false, | ||
indexName: 'otel-v1-apm-service-map-sample', | ||
}, | ||
{ | ||
id: 'ss4o_metrics-otel-sample', | ||
dataPath: path.join(__dirname, './sample_metrics.json.gz'), | ||
fields: metricsFieldMappings, | ||
timeFields: ['@timestamp', 'exemplar.time', 'startTime', 'time', 'observedTimestamp'], | ||
currentTimeMarker: '2024-10-16T19:00:01', | ||
preserveDayOfWeekTimeOfDay: false, | ||
indexName: 'ss4o_metrics-otel-sample', | ||
}, | ||
{ | ||
id: 'ss4o_logs-otel-sample', | ||
dataPath: path.join(__dirname, './sample_logs.json.gz'), | ||
fields: logsFieldMappings, | ||
timeFields: ['time', 'observedTime'], | ||
currentTimeMarker: '2024-10-16T19:00:01', | ||
preserveDayOfWeekTimeOfDay: false, | ||
indexName: 'ss4o_logs-otel-sample', | ||
}, | ||
], | ||
status: 'not_installed', | ||
}; | ||
}; |
Oops, something went wrong.