Skip to content

[qualys_vmdr] Update data collection to get unique identifiers for each interval of ingestion #13840

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

Merged
merged 9 commits into from
May 29, 2025

Conversation

brijesh-elastic
Copy link
Contributor

@brijesh-elastic brijesh-elastic commented May 8, 2025

Proposed commit message

qualys_vmdr: use unique identifiers for each asset_host_detection collection interval

This will help to debug if there is any issue in data ingestion.

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.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

How to test this PR locally

  • Clone integrations repo.
  • Install elastic package locally.
  • Start elastic stack using elastic-package.
  • Move to integrations/packages/qualys_vmdr directory.
  • Run the following command to run tests.

elastic-package test

Related issues

…o generate unique identifiers for each interval of ingestion
@brijesh-elastic brijesh-elastic self-assigned this May 8, 2025
@brijesh-elastic brijesh-elastic added enhancement New feature or request Integration:qualys_vmdr Qualys VMDR Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] Team:Sit-Crest Crest developers on the Security Integrations team [elastic/sit-crest-contractors] labels May 8, 2025
@elastic-vault-github-plugin-prod
Copy link

elastic-vault-github-plugin-prod bot commented May 8, 2025

🚀 Benchmarks report

Package qualys_vmdr 👍(2) 💚(0) 💔(1)

Expand to view
Data stream Previous EPS New EPS Diff (%) Result
user_activity 11494.25 9259.26 -2234.99 (-19.44%) 💔

To see the full report comment with /test benchmark fullreport

@brijesh-elastic brijesh-elastic marked this pull request as ready for review May 12, 2025 12:46
@brijesh-elastic brijesh-elastic requested a review from a team as a code owner May 12, 2025 12:46
@elasticmachine
Copy link

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

Copy link
Contributor

@efd6 efd6 left a comment

Choose a reason for hiding this comment

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

Suggested commit message:

qualys_vmdr: use unique identifiers for each asset_host_detection collection interval

This will help to debug if there is any issue in data ingestion.

Comment on lines 29 to 32
state.with({
?"interval_start": state.?want_more.orValue(false) ? optional.none() : optional.of(now),
?"interval_id": state.?want_more.orValue(false) ? optional.none() : optional.of(uuid()),
}).as(state,
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems to me that these should be always generated if they do not exist and they should not be included in the returned state in the cases that there is an error or want_more is unset or false.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should generate a UUID for the initial call when want_more is set to false. For the remaining calls within that interval, where want_more is true, we should not generate a new UUID but instead preserve the existing one.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, but what you are doing is using want_more as a proxy for the reality. The behaviour that you describe can also be achieved by generating the UUID and storing it in state if it is not present, and removing it from state in the case that want_more is set to false or is remove from state. The difference is that the latter implementation is easier to reason about and follow in logs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I understand your point and will update the PR. However, this will add a considerable amount of code since there are many instances where we set want_more: false

Copy link
Contributor

@efd6 efd6 May 14, 2025

Choose a reason for hiding this comment

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

I'm not convinced that it does. If these two fields are put into a subobject, say interval, then at the bottom of the program you can have

.as(state, state.with(state.want_more ? {"interval": {}} : {}))

or (probably nicer)

.as(state, state.want_more ? state : state.drop("interval"))

and rename the fields to interval.id and interval.start throughout.

@brijesh-elastic brijesh-elastic requested a review from efd6 May 15, 2025 05:42
Copy link

@elasticmachine
Copy link

💚 Build Succeeded

History

cc @brijesh-elastic

@kcreddy kcreddy merged commit 299c5ed into elastic:main May 29, 2025
7 of 8 checks passed
@elastic-vault-github-plugin-prod

Package qualys_vmdr - 6.7.0 containing this change is available at https://epr.elastic.co/package/qualys_vmdr/6.7.0/

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:qualys_vmdr Qualys VMDR Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] Team:Sit-Crest Crest developers on the Security Integrations team [elastic/sit-crest-contractors]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Qualys VMDR]: Generate unique identifiers for each interval ingestion
4 participants