Skip to content

packages/salesforce: Revamp Salesforce integration - #9629

Merged
kush-elastic merged 48 commits into
elastic:mainfrom
kush-elastic:1278_revamp_salesforce_integration
Jun 27, 2024
Merged

packages/salesforce: Revamp Salesforce integration#9629
kush-elastic merged 48 commits into
elastic:mainfrom
kush-elastic:1278_revamp_salesforce_integration

Conversation

@kush-elastic

@kush-elastic kush-elastic commented Apr 17, 2024

Copy link
Copy Markdown
Contributor

Description

This PR introduces a new input method for our Salesforce integration and related changes, designed to overcome the limitations of HTTPJSON input in handling large data volumes from Salesforce Event Log Files (ELF) and real-time event monitoring. The new approach utilizes SOQL queries to directly collect data from Salesforce, offering improved performance, reliability, and scalability. This change addresses several issues with the current implementation and enables more efficient processing of Salesforce data, enhancing our overall integration capabilities.

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.

Related issues

Screenshots

Configurations

Before
before

After
image

- remove login_stream and logout_stream
- update config for login, logout, apex and setupaudittrail data-stream
- update configurations
- Update handlebar files for all the datastreams.
- Update pipelines for all the datastreams
- Update field mappings
- update dashboards
@kush-elastic
kush-elastic requested a review from a team as a code owner April 17, 2024 06:32
@kush-elastic kush-elastic self-assigned this Apr 17, 2024
@kush-elastic kush-elastic added breaking change Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations] Integration:salesforce Salesforce labels Apr 17, 2024
@shmsr shmsr added the enhancement New feature or request label Apr 17, 2024
@shmsr shmsr changed the title integrations/packages/salesforce: Revamp Salesforce integration May 7, 2024
@kush-elastic

Copy link
Copy Markdown
Contributor Author

Updates:

  • Enhanced Authentication Configuration Flexibility
    Discussions are underway to offer users a more flexible approach to configuring the authentication mechanism. Several issues have been identified in relation to supporting new configuration methods. After assessing the current situation and challenges, the decision has been made to continue with the existing method for now. Future plans include transitioning to support the new configuration method.

  • System Test Status
    Currently, system tests are encountering failures due to the absence of the new Salesforce input in the latest elastic-agent images. The resolution is pending the availability of this input in the updated images.

Comment thread packages/salesforce/data_stream/apex/manifest.yml Outdated
@shmsr
shmsr requested a review from a team June 11, 2024 10:15
@shmsr

shmsr commented Jun 11, 2024

Copy link
Copy Markdown
Member

@kush-elastic @aliabbas-elastic I have made a lot of changes to login data stream. Do have a look: 8c805a8

Changes include:

  • Fixed types
  • Fixed field names and groupings
  • Fixed descriptions
  • Use the correct processors
  • Updated the sample logs to get the correct UA
  • Use match_only_text for AdditionalInfo (space-optimized, no scoring)
  • etc.
Comment thread packages/salesforce/manifest.yml Outdated
Comment thread packages/salesforce/manifest.yml Outdated
Comment thread packages/salesforce/manifest.yml Outdated
ali786XI and others added 4 commits June 24, 2024 12:27
Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>
Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>
Comment thread packages/salesforce/data_stream/login/fields/fields.yml Outdated
@ali786XI

Copy link
Copy Markdown
Contributor

We found this during testing that some of the values (especially for Apex data stream) a re received as -1 in response. For example attaching one field for which this is encountered

image

There was one more field with this value json.REQUEST_SIZE mapped to http.request.bytes. We don't have any documentation for these -1 values encountered currently as they are received from the logs only. If it would be given in Salesforce documentation somewhere that gives confidence over dropping/ignoring these field values then we would have ideally done that.

kush-elastic and others added 2 commits June 24, 2024 14:09
Co-authored-by: Aliabbas Attarwala <124054599+aliabbas-elastic@users.noreply.github.com>
unit: ms
type: long
description: The time in nanoseconds for the database round trip during login, including time spent in the JDBC driver, network, and database CPU time.
unit: nanos

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.

nice find.

@kush-elastic
kush-elastic requested review from ali786XI and shmsr June 25, 2024 06:16
Comment thread packages/salesforce/data_stream/setupaudittrail/manifest.yml
@muthu-mps

muthu-mps commented Jun 25, 2024

Copy link
Copy Markdown
Contributor

@shmsr - As I see this is a breaking change based on the field rename and the dashboard removal. We consider making this change as the integration is still in BETA and I am just looking into the comment in the meta issue.

@lalit-satapathy - I hope this is fine.

To be honest, this seems like the way to go. I personally don't have an example to compare with to weigh the pros and cons here. But for beta (0.x) stuff, it's understandable that there could be breaking changes. I think that's why it seems like a fair decision. Anyway, we're just merging this pull request. Kush isn't going to push the CHANGELOG changes. We will do it after dashboard PR is also merged; it is nearing completion. So, we still have some time. If we find a better alternative, we'll go with that instead.

@kush-elastic Removing changelog right as we discussed?

@kush-elastic

Copy link
Copy Markdown
Contributor Author

To be honest, this seems like the way to go. I personally don't have an example to compare with to weigh the pros and cons here. But for beta (0.x) stuff, it's understandable that there could be breaking changes. I think that's why it seems like a fair decision. Anyway, we're just merging this pull request. Kush isn't going to push the CHANGELOG changes. We will do it after dashboard PR is also merged; it is nearing completion. So, we still have some time. If we find a better alternative, we'll go with that instead.

@kush-elastic Removing changelog right as we discussed?

Yes @muthu-mps,
I have updated the change log to use next tag and we will release integration once all the PRs are merged.

Comment thread packages/salesforce/changelog.yml Outdated
@elasticmachine

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @kush-elastic

@milan-elastic milan-elastic 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

@ali786XI ali786XI 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

@kush-elastic
kush-elastic merged commit 3177699 into elastic:main Jun 27, 2024
@elasticmachine

Copy link
Copy Markdown

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

stefans-elastic added a commit that referenced this pull request Jun 23, 2026
…a streams (#19717)

* [salesforce] Re-expose Request Timeout (resource.timeout) for all data streams

The Request Timeout setting was dropped in the v0.15.0 revamp (#9629) when
the integration moved from the httpjson input to the dedicated salesforce
Filebeat input. Since then there was no way to override the input's default
30s HTTP client timeout, so large EventLogFile downloads (notably Apex logs)
could fail with "context deadline exceeded" with no available remedy.

Re-expose it as a `resource_timeout` variable (default 30s, in Advanced
options) across all four data streams (apex, login, logout, setupaudittrail),
wiring it to `resource.timeout` in each stream template. Update the
troubleshooting docs to reflect the current error signature and bump the
package version to 1.8.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* [salesforce] Point changelog link to the PR

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change enhancement New feature or request Integration:salesforce Salesforce Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations]

7 participants