Skip to content
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

[Feature][MDS] Add data source support to Timeline visualization #6009

Closed
bandinib-amzn opened this issue Mar 4, 2024 · 0 comments · Fixed by #6385
Closed

[Feature][MDS] Add data source support to Timeline visualization #6009

bandinib-amzn opened this issue Mar 4, 2024 · 0 comments · Fixed by #6385
Assignees
Labels
enhancement New feature or request multiple datasource multiple datasource project

Comments

@bandinib-amzn
Copy link
Member

Problem Statement

As of today, timeline visualization does not support remote data connections, which can be established using the data source feature

Background

OpenSearch Dashboards Timeline is a visualization tool used to create time-series charts and analyze time-series data in OpenSearch. Timeline uses a unique syntax to create time-series visualizations. The syntax includes a chain of commands that are executed in a particular order. More information can be found here

The .opensearch() function in Timeline is one of the most fundamental functions used to query data from OpenSearch indices. It is primarily used to retrieve time series data for visualization. As other functions, .opensearch() function also have multiple parameters. Considering scope of this issue(feature), we will only discuss about index parameter.

Params
index: Specify the OpenSearch index to retrieve data from.

example:

.opensearch(index=opensearch_dashboards_sample_data_logs)

Proposed Solution:
1] Add an additional parameter to the .opensearch() function to specify the data source from which to retrieve the index.

.opensearch(index=opensearch_dashboards_sample_data_logs,datasource: some_datasource_id)

2] Modify /api/timeline/run API

The Timeline expression language allows users to define complex time series calculations and visualizations. The /api/timeline/run endpoint could be used to generate these expressions dynamically based on user input or other parameters. Once a Timeline expression is defined, it needs to be executed to retrieve the time series data and generate the visualization. The /api/timeline/run endpoint likely handles the execution of these expressions and returns the results in a format that can be consumed by client applications.

/api/timeline/run uses data plugin for search and query OpenSearch. Data plugin already have capability to accept dataSourceID and decide client based on context and request.

We need to implement the logic to retrieve data source id from function parameter and pass that data source id while building request before calling search API.

so the above code would become

export default function buildRequest(config, tlConfig, scriptedFields, timeout) {
.
.
.
return {
    params: request,
    dataSourceId: 'some_datasource_id',
  };
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request multiple datasource multiple datasource project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants