Skip to content

[microsoft_sqlserver] Add transaction log DataStream - #3395

Merged
muthu-mps merged 42 commits into
elastic:mainfrom
muthu-mps:mssql_transaction_log_data_stream
Jun 14, 2022
Merged

[microsoft_sqlserver] Add transaction log DataStream#3395
muthu-mps merged 42 commits into
elastic:mainfrom
muthu-mps:mssql_transaction_log_data_stream

Conversation

@muthu-mps

@muthu-mps muthu-mps commented May 20, 2022

Copy link
Copy Markdown
Contributor

What does this PR do?

Collects the transaction log metrics for Microsoft Sql server.

Please refer this PR for performance datastream.

  • Added a data stream (transaction_log) under microsoft_sqlserver integration package
  • Added support to collect metrics from Named Instance.
  • Added data collection logic for the data streams.
  • Added fields metadata in the appropriate yaml files.
  • Added dashboards and visualisations.
  • Updated documentation for the datastreams

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.

MSSQL server integration using generic sql, as per the design doc

How to test this PR locally

Install the MSSQL

  • Go to Integration UI in Kibana
  • Add the Microsoft SQL Server Integration
  • Enroll the new elastic-agent
  • Test named Instance by providing the named instance port in the Microsoft Sqlserver integration config.
  • In the asset -> Transaction Log dashboard you should be able to see the default visualisation.

Screenshots

@muthu-mps muthu-mps added enhancement New feature or request Team:Integrations Label for the Integrations team labels May 20, 2022
@muthu-mps
muthu-mps requested a review from a team May 20, 2022 05:49
@muthu-mps muthu-mps self-assigned this May 20, 2022
@elasticmachine

elasticmachine commented May 20, 2022

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: 2022-06-14T11:50:47.035+0000

  • Duration: 15 min 20 sec

Test stats 🧪

Test Results
Failed 0
Passed 12
Skipped 0
Total 12

🤖 GitHub comments

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

  • /test : Re-trigger the build.
@elasticmachine

elasticmachine commented May 20, 2022

Copy link
Copy Markdown

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (1/1) 💚
Files 100.0% (1/1) 💚 3.432
Classes 100.0% (1/1) 💚 3.432
Methods 90.476% (19/21) 👍 1.587
Lines 100.0% (1198/1198) 💚 10.104
Conditionals 100.0% (0/0) 💚
@rameshelastic rameshelastic added the Team:Service-Integrations Label for the Observability Service Integrations team label May 20, 2022
@muthu-mps
muthu-mps marked this pull request as ready for review May 20, 2022 09:16
@muthu-mps
muthu-mps requested a review from a team as a code owner May 20, 2022 09:16
@elasticmachine

Copy link
Copy Markdown

Pinging @elastic/integrations (Team:Integrations)

@muthu-mps
muthu-mps marked this pull request as draft May 20, 2022 09:19
Comment thread packages/microsoft_sqlserver/data_stream/transaction_log/fields/fields.yml Outdated
Comment thread packages/microsoft_sqlserver/data_stream/transaction_log/fields/fields.yml Outdated

@ishleenk17 ishleenk17 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add ecs.yml file

@elasticmachine

Copy link
Copy Markdown

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@lalit-satapathy

Copy link
Copy Markdown
Contributor

@ManojS-shetty @muthu-mps,
Do we have any changes pending or all the feedbacks are resolved now?

@ruflin @jsoriano @r00tu53r, tar-getting the merge of this PR, need your approval for the same.

@muthu-mps

Copy link
Copy Markdown
Contributor Author

The changes are done!

@jsoriano jsoriano 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.

It looks good in general, but I am concerned about some changes in versions.

Comment thread packages/microsoft_sqlserver/_dev/build/build.yml Outdated
Comment thread packages/microsoft_sqlserver/data_stream/transaction_log/fields/base-fields.yml Outdated
Comment thread packages/microsoft_sqlserver/data_stream/transaction_log/fields/fields.yml Outdated
- name: driver
type: keyword
description: Driver used to execute the query.
- name: query

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.

Actually, do we need the query at all in the final document? This is an implementation detail of the integration, I think that it could be removed.

But, if we are storing metrics coming from different queries in different documents we may need some dimension to distinguish between queries. So we may need to index the query to use it as dimension, or find some other field that could cover this.

We can also wait to have some way to join events (elastic/beats#31806 (comment)), then database_id will be probably enough as dimension.

Comment thread packages/microsoft_sqlserver/manifest.yml Outdated
Comment thread packages/microsoft_sqlserver/manifest.yml Outdated
Comment thread .github/CODEOWNERS Outdated
@muthu-mps

Copy link
Copy Markdown
Contributor Author

/test

@jsoriano jsoriano 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.

Looks good, thanks for addressing all comments.

The main concern I would have now is about mssql.query. It is not clear to me if we are keeping it at the end or not.

Also I think that this data stream would benefit of elastic/beats#31806, to store all the metrics in the same document. And if we end up storing the results of the queries in the same document, what would we store in mssql.query? Would we remove it? This would be a breaking change.

The more I think about storing the query, the more I think that we shouldn't store it. And it is easier in any case to add it later if I am wrong, than to remove it if needed later.

@jsoriano
jsoriano dismissed their stale review June 8, 2022 15:54

Main concerns addressed, unblocking PR.

@jsoriano jsoriano 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.

LGTM, please remember to add pipeline tests at some moment

@muthu-mps
muthu-mps requested a review from efd6 June 14, 2022 05:42
Comment thread packages/microsoft_sqlserver/_dev/build/docs/README.md Outdated
Comment thread packages/microsoft_sqlserver/_dev/build/docs/README.md Outdated
Comment thread packages/microsoft_sqlserver/_dev/build/docs/README.md Outdated
Comment thread packages/microsoft_sqlserver/_dev/build/docs/README.md Outdated
Comment thread packages/microsoft_sqlserver/_dev/build/docs/README.md Outdated
@muthu-mps
muthu-mps merged commit 2ddf051 into elastic:main Jun 14, 2022
orestisfl pushed a commit to orestisfl/integrations that referenced this pull request May 15, 2026
* new changes for transaction datastream

* codeowner and format changes

* Naming changes for dashboard, updated img file

* Name changes updated

* kibana version upgraded to latest

* Updated fields and added documentation

* Added Readme file

* Added Readme file

* Added Readme file

* Revert "Added Readme file"

This reverts commit 13fbb8f6514e7ecfe533a426a3ed90c5da000095.

ReadMe file changes

* Revert "Updated fields and added documentation"

This reverts commit ea08dd6e66f0b9b6139b68c78c6d187107c8c0c2.

* Revert "Added Readme file"

This reverts commit 53106e7c470a69562b94372c0576d381e97238b2.

* Revert "Added Readme file"

This reverts commit 67a2c59241ce976ee866adfbf58e7c7431ff0cda.

* Updated the fields and dashboard names

* document update

* transaction datastream testing

* Format changes and ECS version change

* doc update

* Updated the database name

* updated manifest and changelog entreies

* renamed sql to mssql & updated 60s

* events updated

* dashboard changes

* Dashboards By Value & updated  mb to bytes

* Dashboards By Value & updated  mb to bytes

* visualization by value

* visualization by value

* updated fields

* added dimensions and updated ECS reference

* added dimensions and updated ECS reference

* Added reference to ECS fields & removed query, driver fields

* formating events

* pipeline update

* Added co-owners

* renaming to audit_log

* removed query field

* updated pipeline

* Update stream.yml.hbs

* Readme file updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Integration:microsoft_sqlserver Microsoft SQL Server Team:Integrations Label for the Integrations team Team:Service-Integrations Label for the Observability Service Integrations team