Latest Dynatrace
Salesforce Insights enables Salesforce administrators and IT operation teams to monitor their Salesforce environment.
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.
The Salesforce extension can capture three 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.
In this mode the extension connects as a connected app. This is the recommended method of authentication and no user password is required.
Technically, the app implements the OAuth 2.0 JWT Bearer Flow.
Dynatrace will ask for:
openssl
—for generating the certificate, 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.
The connected app must have a certificate that we later authenticate with Salesforce using this certificate's private key.
This command generates a certificate and a private key:
openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out cert.pem
cert.pem
file will be later added to the connected app.key.pem
file will be used by Dynatrace to authenticate with Salesforce.In Salesforce Lightning
Name the app and add the contact email. Under API (Enable OAuth Settings):
http://localhost
cert.pem
file generated above under Use digital signatures
.Identify users that can use the app. You can do it by adding Profiles to the Application Profile Assignment list.
Profiles need the following permissions for event streaming:
View Real-Time Event Monitoring Data
Customize Application
View All Data
To check the needed permissions documentation, see how to Enable Access to Real-Time Event Monitoring.
For Client ID authentication, create an API Only user in Salesforce, and provide the Client ID
and Client Secret
.
To enable the Salesforce Extension, you must have an Environment ActiveGate.
https://login.salesforce.com
or https://test.salesforce.com
api.pubsub.salesforce.com:7443
or api.deu.pubsub.salesforce.com:7443
If you use OpenKit, we recommend starting with the Custom Application setup.
Capture real-time events from Salesforce and send them as Business Events to Dynatrace.
RUM ingest should only be used on Managed Environments.
Enable use cases such as:
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.
For a detailed description of every event and their properties, see the Salesforce documentation.
The extension is limited to events that Salesforce produces as Real-Time 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"
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.
fetch bizevents| filter event.type == "salesforce.ApiEventStream"| summarize count(), by: {SourceIp}
You can get a list of all event types with DQL:
fetch bizevents| filter event.provider == "https://dynatrace--staging.sandbox.my.salesforce.com"| summarize count(), by: {event.type}
fetch bizevents| filter event.type == "salesforce.LoginEventStream"| makeTimeseries logins=count(), by:{Username}, interval: 5m| sort logins desc
To create a custom application to receive the data:
Application ID
for later.The data is sent to the Frontend application that you created, so you can access:
To use these properties in User Sessions Query Language:
Example: Capture the rows number
Querying the property:
SELECT useraction.name, SUM(longProperties.rowsprocessed) FROM useraction WHERE useraction.name STARTSWITH "Report" GROUP BY useraction.name
Capture event log files from Salesforce and ingest them as logs to Dynatrace.
Do not expect real-time data out of this configuration. Event Log data is delayed by several hours in Salesforce.
The events are sent as Log Events to Dynatrace, and can be queries using DQL:
fetch logs| filter query.type == "EventLogFile"
Every property for a certain Event Log File will be available.
To find fields details, see EventLogFile Supported Event Types.
Get details about ApexExecution
events:
fetch logs| filter EVENT_TYPE == "ApexExecution"| fields TIMESTAMP_DERIVED, ENTRY_POINT, EXEC_TIME, CPU_TIME, DB_TOTAL_TIME, NUMBER_SOQL_QUERIES
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.
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:
{last_execution_timestamp}
must be used to filter the query results and deduplicate the data.SELECT Id, CreatedDate, Field, NewValue, OldValue FROM OpportunityFieldHistory WHERE CreatedDate > {last_execution_timestamp}
Let's consider this query configuration:
Query Name: LoginsQuery: SELECT UserId, COUNT(Id) from LoginHistory WHERE LoginTime > {last_execution_timestamp} GROUP BY UserId
The results can be obtained with the DQL:
fetch logs| filter query.name == "Logins"
And a chart could be created with:
fetch logs| filter query.name == "Logins"| makeTimeseries sum(toDouble(expr0)), by: {UserId}, interval: 5m
You can also fetch all the queries and their text configured for this Salesforce instance:
fetch logs| filter event.provider == "https://dynatrace--staging.sandbox.my.salesforce.com"| summarize count(), by: {query.name}
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 Analytics > 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.
matchesValue(event.provider, "https://environment.my.salesforce.com")
Select Save changes.
Error logs can be obtained via Dynatrace, by navigating to the Extension page, and selecting Status for each monitoring configuration.
Detailed logs can be obtained by creating an ActiveGate Diagnosis.