Skip to content

Commit

Permalink
Updating data sources docs # 7680 (#7800)
Browse files Browse the repository at this point in the history
* Updating data sources docs # 7680

Signed-off-by: AntonEliatra <[email protected]>

* Update connect-prometheus.md

Signed-off-by: AntonEliatra <[email protected]>

* Update data-sources.md

Signed-off-by: AntonEliatra <[email protected]>

* removing the screenshot from data sources

Signed-off-by: AntonEliatra <[email protected]>

* Revise text for accuracy and readability

Signed-off-by: Melissa Vagi <[email protected]>

* Copy edits to headings

Signed-off-by: Melissa Vagi <[email protected]>

* Revise lines 39-42

Signed-off-by: Melissa Vagi <[email protected]>

* Update connect-prometheus.md

Copy edits

Signed-off-by: Melissa Vagi <[email protected]>

* Update _dashboards/management/connect-prometheus.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update _dashboards/management/connect-prometheus.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update _dashboards/management/connect-prometheus.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update connect-prometheus.md

revised text for conciseness and clarity

Signed-off-by: Melissa Vagi <[email protected]>

* Update _dashboards/management/data-sources.md

Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: Melissa Vagi <[email protected]>

* Update _dashboards/management/data-sources.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update data-sources.md

address editorial feedback

Signed-off-by: Melissa Vagi <[email protected]>

* Update _dashboards/management/connect-prometheus.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update _dashboards/management/connect-prometheus.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update _dashboards/management/connect-prometheus.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update _dashboards/management/connect-prometheus.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update _dashboards/management/connect-prometheus.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update data-sources.md

add prometheus in next steps

Signed-off-by: Melissa Vagi <[email protected]>

* Address editorial feedback

Signed-off-by: Melissa Vagi <[email protected]>

* Update connect-prometheus.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update connect-prometheus.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update data-sources.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update _dashboards/management/connect-prometheus.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update _dashboards/management/connect-prometheus.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update connect-prometheus.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update connect-prometheus.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update connect-prometheus.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update connect-prometheus.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update _dashboards/management/data-sources.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update connect-prometheus.md

address editorial feedback

Signed-off-by: Melissa Vagi <[email protected]>

---------

Signed-off-by: AntonEliatra <[email protected]>
Signed-off-by: Melissa Vagi <[email protected]>
Co-authored-by: Heather Halter <[email protected]>
Co-authored-by: Naarcha-AWS <[email protected]>
Co-authored-by: Melissa Vagi <[email protected]>
Co-authored-by: Nathan Bower <[email protected]>
  • Loading branch information
5 people committed Aug 28, 2024
1 parent ba56c07 commit fd709a1
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 44 deletions.
53 changes: 53 additions & 0 deletions _dashboards/management/connect-prometheus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
layout: default
title: Connecting Prometheus to OpenSearch
parent: Data sources
nav_order: 20
---

# Connecting Prometheus to OpenSearch
Introduced 2.16
{: .label .label-purple }

This documentation covers the key steps to connect Prometheus to OpenSearch using the OpenSearch Dashboards interface, including setting up the data source connection, modifying the connection details, and creating an index pattern for the Prometheus data.

## Prerequisites and permissions

Before connecting a data source, ensure you have met the [Prerequisites]({{site.url}}{{site.baseurl}}/dashboards/management/data-sources/#prerequisites) and have the necessary [Permissions]({{site.url}}{{site.baseurl}}/dashboards/management/data-sources/#permissions).

## Create a Prometheus data source connection

A data source connection specifies the parameters needed to connect to a data source. These parameters form a connection string for the data source. Using OpenSearch Dashboards, you can add new **Prometheus** data source connections or manage existing ones.

Follow these steps to connect your data source:

1. From the OpenSearch Dashboards main menu, go to **Management** > **Data sources** > **New data source** > **Prometheus**.

2. From the **Configure Prometheus data source** section:

- Under **Data source details**, provide a title and optional description.
- Under **Prometheus data location**, enter the Prometheus URI.
- Under **Authentication details**, select the appropriate authentication method from the dropdown list and enter the required details:
- **Basic authentication**: Enter a username and password.
- **AWS Signature Version 4**: Specify the **Region**, select the OpenSearch service from the **Service Name** list (**Amazon OpenSearch Service** or **Amazon OpenSearch Serverless**), and enter the **Access Key** and **Secret Key**.
- Under **Query permissions**, choose the role needed to search and index data. If you select **Restricted**, an additional field will become available to configure the required role.

3. Select **Review Configuration** > **Connect to Prometheus** to save your settings. The new connection will appear in the list of data sources.

### Modify a data source connection

To modify a data source connection, follow these steps:

1. Select the desired connection from the list on the **Data sources** main page. This will open the **Connection Details** window.
2. Within the **Connection Details** window, edit the **Title** and **Description** fields. Select the **Save changes** button to apply the changes.
3. To update the **Authentication Method**, choose the method from the dropdown list and enter any necessary credentials. Select **Save changes** to apply the changes.
- To update the **Basic authentication** authentication method, select the **Update stored password** button. Within the pop-up window, enter the updated password and confirm it and select **Update stored password** to save the changes. To test the connection, select the **Test connection** button.
- To update the **AWS Signature Version 4** authentication method, select the **Update stored AWS credential** button. Within the pop-up window, enter the updated access and secret keys and select **Update stored AWS credential** to save the changes. To test the connection, select the **Test connection** button.

### Delete a data source connection

Tondelete the data source connection, select the {::nomarkdown}<img src="{{site.url}}{{site.baseurl}}/images/dashboards/trash-can-icon.png" class="inline-icon" alt="delete icon"/>{:/} icon.

## Creating an index pattern

After creating a data source connection, the next step is to create an index pattern for that data source. For more information and a tutorial on index patterns, refer to [Index patterns]({{site.url}}{{site.baseurl}}/dashboards/management/index-patterns/).
58 changes: 14 additions & 44 deletions _dashboards/management/data-sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,67 +13,37 @@ This documentation focuses on using the OpenSeach Dashboards interface to connec

## Prerequisites

The first step in connecting your data sources to OpenSearch is to install OpenSearch and OpenSearch Dashboards on your system. You can follow the installation instructions in the [OpenSearch documentation]({{site.url}}{{site.baseurl}}/install-and-configure/index/) to install these tools.
The first step in connecting your data sources to OpenSearch is to install OpenSearch and OpenSearch Dashboards on your system. Refer to the [installation instructions]({{site.url}}{{site.baseurl}}/install-and-configure/index/) for information.

Once you have installed OpenSearch and OpenSearch Dashboards, you can use Dashboards to connect your data sources to OpenSearch and then use Dashboards to manage data sources, create index patterns based on those data sources, run queries against a specific data source, and combine visualizations in one dashboard.

Configuration of the [YAML files]({{site.url}}{{site.baseurl}}/install-and-configure/configuring-opensearch/#configuration-file) and installation of the `dashboards-observability` and `opensearch-sql` plugins is necessary. For more information, see [OpenSearch plugins]({{site.url}}{{site.baseurl}}/install-and-configure/plugins/).

## Permissions

To work with data sources in OpenSearch Dashboards, make sure that the user has been assigned the correct cluster-level [data source permission]({{site.url}}{{site.baseurl}}/security/access-control/permissions#data-source-permissions).



## Create a data source connection

A data source connection specifies the parameters needed to connect to a data source. These parameters form a connection string for the data source. Using Dashboards, you can add new data source connections or manage existing ones.

The following steps guide you through the basics of creating a data source connection:

1. From the OpenSearch Dashboards main menu, select **Management** > **Data sources** > **Create data source connection**. The UI is shown in the following image.
To securely store and encrypt data source connections in OpenSearch, you must add the following configuration to the `opensearch.yml` file on all the nodes:

<img src="{{site.url}}{{site.baseurl}}/images/dashboards/data-source-UI.png" alt="Connecting a data source UI" width="700"/>
`plugins.query.datasources.encryption.masterkey: "YOUR_GENERATED_MASTER_KEY_HERE"`

2. Create the data source connection by entering the appropriate information into the **Connection Details** and **Authentication Method** fields.

- Under **Connection Details**, enter a title and endpoint URL. For this tutorial, use the URL `http://localhost:5601/app/management/opensearch-dashboards/dataSources`. Entering a description is optional.
The key must be 16, 24, or 32 characters. You can use the following command to generate a 24-character key:

- Under **Authentication Method**, select an authentication method from the dropdown list. Once an authentication method is selected, the applicable fields for that method appear. You can then enter the required details. The authentication method options are:
- **No authentication**: No authentication is used to connect to the data source.
- **Username & Password**: A basic username and password are used to connect to the data source.
- **AWS SigV4**: An AWS Signature Version 4 authenticating request is used to connect to the data source. AWS Signature Version 4 requires an access key and a secret key.
- For AWS Signature Version 4 authentication, first specify the **Region**. Next, select the OpenSearch service in the **Service Name** list. The options are **Amazon OpenSearch Service** and **Amazon OpenSearch Serverless**. Lastly, enter the **Access Key** and **Secret Key** for authorization.
`openssl rand -hex 12`

After you have populated the required fields, the **Test connection** and **Create data source** buttons become active. You can select **Test connection** to confirm that the connection is valid.
Generating 12 bytes results in a hexadecimal string that is 12 * 2 = 24 characters.
{: .note}

3. Select **Create data source** to save your settings. The connection is created. The active window returns to the **Data sources** main page, and the new connection appears in the list of data sources.

4. To delete a data source connection, select the checkbox to the left of the data source **Title** and then select the **Delete 1 connection** button. Selecting multiple checkboxes for multiple connections is supported. An example UI is shown in the following image.

<img src="{{site.url}}{{site.baseurl}}/images/dashboards/delete-data-source.png" alt="Deleting a data source UI" width="700"/>

### Modify a data source connection

To make changes to a data source connection, select a connection in the list on the **Data sources** main page. The **Connection Details** window opens.

To make changes to **Connection Details**, edit one or both of the **Title** and **Description** fields and select **Save changes** in the lower-right corner of the screen. You can also cancel changes here. To change the **Authentication Method**, choose a different authentication method, enter your credentials (if applicable), and then select **Save changes** in the lower-right corner of the screen. The changes are saved.

When **Username & Password** is the selected authentication method, you can update the password by choosing **Update stored password** next to the **Password** field. In the pop-up window, enter a new password in the first field and then enter it again in the second field to confirm. Select **Update stored password** in the pop-up window. The new password is saved. Select **Test connection** to confirm that the connection is valid.
## Permissions

When **AWS SigV4** is the selected authentication method, you can update the credentials by selecting **Update stored AWS credential**. In the pop-up window, enter a new access key in the first field and a new secret key in the second field. Select **Update stored AWS credential** in the pop-up window. The new credentials are saved. Select **Test connection** in the upper-right corner of the screen to confirm that the connection is valid.
To work with data sources in OpenSearch Dashboards, you must be assigned the correct cluster-level [data source permissions]({{site.url}}{{site.baseurl}}/security/access-control/permissions#data-source-permissions).

To delete the data source connection, select the delete icon ({::nomarkdown}<img src="{{site.url}}{{site.baseurl}}/images/dashboards/trash-can-icon.png" class="inline-icon" alt="delete icon"/>{:/}).
## Types of data streams

## Create an index pattern
To configure data sources through OpenSearch Dashboards, go to **Management** > **Dashboards Management** > **Data sources**. This flow can be used for OpenSearch data stream connections. See [Configuring and using multiple data sources]({{site.url}}{{site.baseurl}}/dashboards/management/multi-data-sources/).

Once you've created a data source connection, you can create an index pattern for the data source. An _index pattern_ is a template that OpenSearch uses to create indexes for data from the data source. See [Index patterns]({{site.url}}{{site.baseurl}}/dashboards/management/index-patterns/) for more information and a tutorial.
Alternatively, if you are running OpenSearch Dashboards 2.16 or later, go to **Management** > **Data sources**. This flow can be used to connect Amazon Simple Storage Service (Amazon S3) and Prometheus. See [Connecting Amazon S3 to OpenSearch]({{site.url}}{{site.baseurl}}/dashboards/management/S3-data-source/) and [Connecting Prometheus to OpenSearch]({{site.url}}{{site.baseurl}}/dashboards/management/connect-prometheus/) for more information.

## Next steps

- Learn about [managing index patterns]({{site.url}}{{site.baseurl}}/dashboards/management/index-patterns/) through OpenSearch Dashboards.
- Learn about [indexing data using Index Management]({{site.url}}{{site.baseurl}}/dashboards/im-dashboards/index/) through OpenSearch Dashboards.
- Learn about how to connect [multiple data sources]({{site.url}}{{site.baseurl}}/dashboards/management/multi-data-sources/).
- Learn about how to [connect OpenSearch and Amazon S3 through OpenSearch Dashboards]({{site.url}}{{site.baseurl}}/dashboards/management/S3-data-source/).
- Learn about the [Integrations]({{site.url}}{{site.baseurl}}/integrations/index/) tool, which gives you the flexibility to use various data ingestion methods and connect data from the Dashboards UI.

- Learn about how to connect [OpenSearch and Amazon S3]({{site.url}}{{site.baseurl}}/dashboards/management/S3-data-source/) and [OpenSearch and Prometheus]({{site.url}}{{site.baseurl}}/dashboards/management/connect-prometheus/) using the OpenSearch Dashboards interface.
- Learn about the [Integrations]({{site.url}}{{site.baseurl}}/integrations/index/) plugin, which gives you the flexibility to use various data ingestion methods and connect data to OpenSearch Dashboards.
Binary file removed images/dashboards/data-source-UI.png
Binary file not shown.
Binary file removed images/dashboards/delete-data-source.png
Binary file not shown.

0 comments on commit fd709a1

Please sign in to comment.