Salesforce Insights enables Salesforce administrators and IT operation teams to monitor their Salesforce environment.
Get started
Learn how to set up Salesforce Insights and find out what kind of data it can capture.
Make sure to meet the following requirements to use the extension.
Salesforce account
The Salesforce extension can capture four types of Salesforce data. Select each configuration for more details.
The Event Streaming configuration allows you to monitor the usage of your Salesforce CRM account.
The EventLogFile configuration allows you to ingest log files from Salesforce into Dynatrace.
The API Queries configuration allows you to ingest Salesforce Object Query Language (SOQL) data into Dynatrace. The data is ingested into Dynatrace as log events or Business Events.
The Platform Events configuration allows you to subscribe to custom Salesforce Platform Events and ingest them as Business Events into Dynatrace.
Authentication
Choose one of the three authentication methods that best suits your needs.
Both OAuth methods use a Salesforce external client app. External client apps replace the legacy connected apps.
Under Setup > App Manager, select New External Client App.
Enter a Name and set Distribution State to Local.
Under API (Enable OAuth Settings), check Enable OAuth.
If the Callback URL is not used, you can put in https://localhost.
In Selected OAuth Scopes, add these scopes:
Manage user data via APIs (API)
Perform requests at any time (refresh_token, offline_access)
Under the authentication flow settings, check Enable Client Credentials Flow.
Leave all other settings as default and select Save.
Configure policies
On the external client app page, under Policies, select Edit.
Under App Policies > Profiles, add a profile that has the permissions listed in Approved users.
Under OAuth Policies > Permitted Users, select Admin approved users are pre-authorized.
Under OAuth Flows and External Client App Enhancements, enable Client Credentials Flow and set Run As to a username that belongs to the profile selected above.
Select Save.
Approved users
Profiles need the following permissions for event streaming:
Under Setup > App Manager (External Client App Managers), select the external client app, then go to Settings > OAuth Settings to find the Consumer Key and Consumer Secret.
The Private Key (key.pem) matching the certificate uploaded to the external client app.
The Subject of the JWT token. This is the username of a user that is part of a Profile added to the external client app.
Requirements
openssl for generating the certificate. This is not needed if you already have a certificate and a private key.
Note: on Windows, if you have git installed, you should also have a copy of openssl.
You should find it in a directory such as C:\Program Files\Git\mingw64\bin depending on your installation.
Certificate
The external client app must have a certificate that Dynatrace later uses to authenticate with Salesforce through this certificate's private key.
This command generates a certificate and a private key:
The cert.pem file will be later added to the external client app.
The key.pem file will be used by Dynatrace to authenticate with Salesforce.
Create the external client app
Follow the same steps as in the Client Credentials Flow to create the external client app, with one difference: under the authentication flow settings, check Enable JWT Bearer Flow and upload the cert.pem file generated above instead of enabling the Client Credentials Flow.
Configure policies
On the external client app page, under Policies, select Edit.
Under App Policies > Profiles, add a profile that has the permissions listed in Approved users.
Under OAuth Policies > Permitted Users, select Admin approved users are pre-authorized.
Select Save.
Any username from a profile added to the external client app can be used as the Subject when configuring the extension.
Get the Consumer Key
Under Setup > App Manager (External Client App Managers), select the external client app, then go to Settings > OAuth Settings to find the Consumer Key.
A regular Salesforce user with the permissions for the desired configuration (Event Streaming, Event Log File or SOQL).
Choose from Global Endpoint or Europe (Frankfurt) Endpoint
Reporting Mode
Business Events, Logs, OpenKit (RUM)
Custom Application ID
The Dynatrace Custom Application ID for the app you created before(only needed if a managed environment is used and OpenKit is used as reporting mode.)
Authentication type
Choose from Client Credentials Flow, JWT Bearer Flow, or username and password. See Authentication.
Events filtering
Choose which real-time events you'd like to send to Dynatrace, by default all are enabled
Usernames Blocklist
Optional list of Usernames to ignore; use this to block automation/API users from reporting
Proxy
Optional proxy; in case the ActiveGate cannot connect to the Salesforce URLs
OpenKit
If you use OpenKit, we recommend starting with the Custom Application setup.
Details
Salesforce data ingest
Choose one of the four data ingest methods based on your monitoring needs.
RUM ingest should only be used on Managed Environments.
Enable Real-time event Streaming.
In Setup > Event Manager, enable Streaming Data for the events you want to capture.
Obtain the credentials needed for the extension to connect to Salesforce.
Enable use cases such as:
Track Session Hijack, Credential Stuffing and Anomaly Events
Track important permission sets and changes
What are the slowest Lightning or Classic pages response times?
What files are being uploaded, downloaded, and by which user?
What are the most used reports, who is running them, what queries are being used?
What are the top API Queries being made?
What browsers are users using?
Where is Salesforce being accessed from?
How many users are using the platform currently, what is the user experience?
The extension uses the Salesforce Pub/Sub API to list for Event Streaming Events. These events are captured and sent as Business events, or in case of OpenKit as User Actions, with all their respective properties sent as Action Properties.
Track when a user creates, accesses, updates, or deletes a record in Salesforce Classic.
The extension is limited to events that Salesforce produces as Real-Time Events.
Choose your reporting mode for Event Streaming data:
Business Events
For business events, all data is ingested using the business events API.
It can be queried using DQL:
fetch bizevents
|filter event.type == "salesforce.ApiEventStream"
Visualization of a query result
img.png
Each of the events of type salesforce.NameOfTheEvent will have all properties documented by Salesforce.
For instance, see the properties for an ApiEventStream.
So we can create visualizations using all of these properties.
The user must have set permissions to read event log files.
Details
Create a new EventLogFile configuration by selecting Configure EventLogFile.
Note that under Events to capture all the different Log Files will be disabled by default.
Select which log files you would like to ingest.
Do not expect real-time data out of this configuration. Event Log data is delayed by several hours in Salesforce.
Visualization
The events are sent as Log Events to Dynatrace, and can be queries using DQL:
Run SOQL queries against Salesforce and ingest the data as logs or Business Events.
The user must have permissions to query the Salesforce API, and read the Objects that are being queried.
Details
To ingest Salesforce Object Query Language (SOQL) data into Dynatrace,
Select Configure API queries.
Add up to 100 SOQL queries to be executed at the specified interval.
Each query has the following parameters:
Query Name—A name for the query that will help you locate this query data later in Dynatrace Logs.
Query—The SOQL query to be executed.
The query must contain at least one datetime field.
The placeholder {last_execution_timestamp}must be used to filter the query results and deduplicate the data.
Example: SELECT Id, CreatedDate, Field, NewValue, OldValue FROM OpportunityFieldHistory WHERE CreatedDate > {last_execution_timestamp}
Frequency
The frequency can be of type Interval or Cron.
Interval—The query will be every X minutes.
Cron—The query will be executed based on the cron expression provided, you can use crontab guru to generate the cron expression.
Visualization
Let's consider this query configuration:
Query Name: Logins
Query: SELECT UserId, COUNT(Id) from LoginHistory WHERE LoginTime > {last_execution_timestamp} GROUP BY UserId
Platform Events provide a powerful way to send and receive custom event notifications within Salesforce and to external systems. This configuration allows you to capture real-time event data from custom platform events, standard platform events, and change data capture events.
Details
To ingest Salesforce Platform Events into Dynatrace:
Select Configure Platform Events.
Add the topics you want to subscribe to. Topics follow these formats:
Custom Platform Events: /event/YourCustomEvent__e
Standard Platform Events: /event/LoginEventStream, /event/LogoutEventStream
Change Data Capture: /data/ChangeEvents, /data/AccountChangeEvent
Configure authentication using one of the supported methods (Client Credentials Flow, JWT Bearer Flow, or User and Password).
Use Cases
Enable use cases such as:
Monitor custom business processes and workflows
Track changes to critical Salesforce objects with Change Data Capture
Integrate with external systems using custom Platform Events
Build real-time dashboards and alerts based on Salesforce events
Correlate Salesforce events with other observability data
Visualization
Platform Events are sent as Business Events to Dynatrace and can be queried using DQL:
Each Platform Event will include all custom fields defined on the event, making them available for filtering, grouping, and visualization.
Extend the retention period for Salesforce Insights data
By default, your ingested data is stored for 30 days. You can adjust the retention time by creating a custom bucket.
To create a custom bucket for a Salesforce event
In Dynatrace, go to Settings > Business Observability > Bucket assignment.
On the Business event bucket assignment page, select Add rule and name your rule.
In the Bucket field, choose your retention period.
Add a Matcher to your rule by typing or pasting your matcher-specific DQL query. Events that match your rule will be assigned to your selected bucket. If no rules match, events will be assigned to the default bucket. To assign all your Salesforce events to your bucket, you need to use the matcher containing the matchesValue function and your Salesforce URL, as in the example below.