-
Notifications
You must be signed in to change notification settings - Fork 884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Home] Add support for otel sample data - logs, traces and metrics #8587
Merged
+2,241
−68
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c7aa30c
add support for otel sample data - traces and services
ps48 dbe89bc
Changeset file for PR #8587 created/updated
opensearch-changeset-bot[bot] 4811d32
upload gz otel data
mengweieric bfdbfcd
add mappings
mengweieric 8049e71
correct mappings
mengweieric b9e9130
Fix the time mismatch for otel sample data
RyanL1997 b55bcdb
adjust time maker
mengweieric 1a191e3
create index name tests
mengweieric f22be8e
Merge branch 'main' into otel_sample_data
mengweieric b01ec49
add indexName field to DataIndexSchema, move nested field functions t…
ps48 c6949c4
add button for app redirection, resolve comments
ps48 66efe4c
adjust id field to be as keyword
mengweieric 6dc07c1
remove redundant keyword declaration
mengweieric cc01c94
move to use correct format sample suffix
mengweieric 6c95400
update text and one log index name/id
mengweieric 28f5548
fix sample data test
mengweieric File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is needed for
events.time
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parsing array field needs to be added to search for the timefield inside the array and then update it in the doc. My understanding is this is not needed for P0 and can be fine if taken up later and trace queries use
startTime
andendTime