Skip to content

Sql Input Package - #5167

Merged
ishleenk17 merged 10 commits into
elastic:mainfrom
ishleenk17:sql_input_ishleen
Feb 15, 2023
Merged

Sql Input Package#5167
ishleenk17 merged 10 commits into
elastic:mainfrom
ishleenk17:sql_input_ishleen

Conversation

@ishleenk17

@ishleenk17 ishleenk17 commented Feb 2, 2023

Copy link
Copy Markdown
Member
  • Enhancement

What does this PR do?

This PR creates the SQL Input Package which can be used to retrieve metrics by querying any SQL database.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

How to test this PR locally

Install the input package through Kibana. Bring up any SQL database. Specify the configurations as mentioned in the README. The metrics should be visible in Kibana

Related issues

Screenshots

Configuration for Input Package
Screenshot 2023-02-09 at 1 20 10 PM

Metrics Retrieval for Mysql database using SQL input Package

Screenshot 2023-02-09 at 1 21 23 PM

@ishleenk17
ishleenk17 requested a review from a team February 2, 2023 06:11
@ishleenk17 ishleenk17 self-assigned this Feb 2, 2023
@elasticmachine

elasticmachine commented Feb 2, 2023

Copy link
Copy Markdown

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-02-15T07:13:15.795+0000

  • Duration: 13 min 42 sec

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@lalit-satapathy lalit-satapathy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An ideal scenario for generic sql input is driver is selected by a drop-down list and it provides a sample DSN notation for the driver pre-populated. May be our UI does not support such selections for now?

Comment thread packages/sql_input/docs/README.md
Comment thread packages/sql_input/docs/README.md Outdated
Comment thread packages/sql_input/docs/README.md Outdated
@ishleenk17
ishleenk17 marked this pull request as ready for review February 6, 2023 10:52
Comment thread packages/sql_input/docs/README.md
Comment thread packages/sql_input/docs/README.md
@agithomas

Copy link
Copy Markdown
Contributor

Can you please verify if the below test case is passed? This is because, i do not find any test cases attached with this PR.

  • Queries having special characters such as quotes, double quotes, special characters. Please verify if the query is fetching results.

Can there be preconditions / troubleshooting section added such as

  • Ensure that query does not end with semi colon

  • Ensure correctness of the query before executing

  • Ensure the database user executing the database query has the required permissions

  • For oracle, you can consider adding a link to the Oracle integration documentation to find out the pre-requisite. This includes setting of certain environment variables, installation of client

  • Recommend to change the text Hosts in Manifest.yml to Host / Connection String

Comment thread packages/sql_input/manifest.yml
Comment thread packages/sql_input/docs/README.md Outdated
Comment thread packages/sql_input/docs/README.md

@agithomas agithomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review comments added

@agithomas

Copy link
Copy Markdown
Contributor

In the screenshot, the name sql_ishleen is found. Please change it to a more appropriate name suiting the documentation bestpractices

@agithomas

Copy link
Copy Markdown
Contributor

Are there plans to include system testing and it's files & configs as part of this PR?

@ishleenk17

Copy link
Copy Markdown
Member Author

Can you please verify if the below test case is passed? This is because, i do not find any test cases attached with this PR.

  • Queries having special characters such as quotes, double quotes, special characters. Please verify if the query is fetching results.

Can there be preconditions / troubleshooting section added such as

  • Ensure that query does not end with semi colon
  • Ensure correctness of the query before executing
  • Ensure the database user executing the database query has the required permissions
  • For oracle, you can consider adding a link to the Oracle integration documentation to find out the pre-requisite. This includes setting of certain environment variables, installation of client
  • Recommend to change the text Hosts in Manifest.yml to Host / Connection String

This will basically use the SQL beats module. So if we are claiming support doe special characters for our DB's using SQL as input then that holds true for the input package. Whatever SQL module supports, SQL input package will support.

We can point out the specific DB's Integrations to provide the complete way of configuring and prerequisites. I don't think we should write details about all the individual DB's here. Linking to the specific DB readme would be better

@ishleenk17

Copy link
Copy Markdown
Member Author

Are there plans to include system testing and it's files & configs as part of this PR?

System Tests are in plan to be added for Input packages. They are not currently available.

@agithomas agithomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review feedback shared.

Comment thread packages/sql_input/docs/README.md
@elastic elastic deleted a comment from lalit-satapathy Feb 14, 2023
Comment thread packages/sql_input/docs/README.md Outdated
@lalit-satapathy

Copy link
Copy Markdown
Contributor

LGTM for the first release.

@agithomas agithomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feedback shared.

Expects a two-column table that looks like a key/value result. The left column is considered a key and the right column the value. This mode generates a single event on each fetch operation.

table:
Expects any number of columns. This mode generates a single event for each row.

@agithomas agithomas Feb 15, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not generate when query does not return any rows. So, suggest to clearly state this.

@agithomas

Copy link
Copy Markdown
Contributor

Suggestion: It may be best to replace or add additional screenshot that shows how to include multiple queries.

@agithomas agithomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review comments updated

@agithomas agithomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@ishleenk17
ishleenk17 merged commit b723d42 into elastic:main Feb 15, 2023
@elasticmachine

Copy link
Copy Markdown

Package sql - 0.0.1 containing this change is available at https://epr.elastic.co/search?package=sql

bhapas pushed a commit to bhapas/integrations that referenced this pull request Feb 16, 2023
* Change cpu and memory calculation in vsphere

* SQL Input Package: Draft version

* Revert "Change cpu and memory calculation in vsphere"

This reverts commit 94487c3.

* Update Codeowners

* Update README

* Update README.md

* Update README.md

* Update README.md

* Update README.md
@andrewkroh andrewkroh added Integration:sql SQL Input New Integration Issue or pull request for creating a new integration package. labels Aug 13, 2024
@ishleenk17
ishleenk17 deleted the sql_input_ishleen branch February 7, 2025 03:44
orestisfl pushed a commit to orestisfl/integrations that referenced this pull request May 15, 2026
* Change cpu and memory calculation in vsphere

* SQL Input Package: Draft version

* Revert "Change cpu and memory calculation in vsphere"

This reverts commit e4dd5a341b7f66066762bbd1aab265f64b849244.

* Update Codeowners

* Update README

* Update README.md

* Update README.md

* Update README.md

* Update README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Integration:sql SQL Input New Integration Issue or pull request for creating a new integration package.

5 participants