Skip to main content

Streaming logs to external systems

Introduction

The workflow logs described in the previous page in this section are a powerful tool to enable seeing the context of current & past runs for a given workflow. This can be vital in providing key insights into the health of given workflows.

It is also possible to enable the streaming of workflow logs information to an external endpoint. This means you could use a system such as Datadog, Sentry, Redshift, New Relic or Kibana in order to conduct further analysis and display statistics in a meaningful dashboard, as is offered by these services.

This opens up all sorts of possibilities in terms of what you can do with filtering and visualizing your logs, to help identify patterns of success and failure, time taken and processing efficiency, across workflows and individual connectors (both third-party service and core/helpers), as illustrated by the following example dashboard:

The following shows an example of a graphic dashboard you could render with filters of log data:

datadog-example-graphs

And the following shows an example Datadog dashboard with a basic list of events and specific columns:

datadog-dashboard-1

And an individual event:

datadog2

Log event types

There are three main log event types in Tray:

  • Execution

  • Step

  • Audit

info

Data payloads are subject to change with subsequent releases

The 'Execution' event type

An Execution event gives the details on the status of a workflow run. A key piece of info here being eventType`` which can be: created | started | retrying | failed | created_failed | manually_retried | successful | terminated``

Execution payload format

The execution log payload format is:

{
"header": {
"payloadSize": 773,
"version": 1
},
"logType": "execution_event",
"eventType": "<created | started | retrying | failed | created_failed | manually_retried | successful | terminated>",
"created": "<iso timestamp>",
"executionCreated": "<iso timestamp>",
"executionId": "<uuid>",
"workflowId": "<uuid>",
"organizationId": "<uuid>",
// fields present in case of error
"errorMessage": "<string | undefined>",
"errorStepName": "<string | undefined>",
"errorStepTitle": "<string | undefined>",
"errorId": "<uuid | undefined>",
"errorType": "<internal | input | connector | external>"
}

Execution example payload

And the following screenshot shows an example execution log payload:

execution-payload-example

Execution payload format (including Solution Instances)

For Enterprise package customers using the Embedded bundle to build integrations for multiple End Users, the Execution event (which gives details on the status of a workflow run) includes solutionId, solutionInstanceId and sourceWorkflowId:

{
"header": {
"payloadSize": 773,
"version": 1
},
"logType": "execution_event",
"eventType": "<created | started | retrying | failed | created_failed | manually_retried | successful | terminated>",
"created": "<iso timestamp>",
"executionCreated": "<iso timestamp>",
"executionId": "<uuid>",
"workflowId": "<uuid>",
"organizationId": "<uuid>",

// embedded only
"solutionId": "<uuid>",
"solutionInstanceId": "<uuid>",
"sourceWorkflowId": "<uuid>",

// fields present in case of error
"errorMessage": "<string | undefined>",
"errorStepName": "<string | undefined>",
"errorStepTitle": "<string | undefined>",
"errorId": "<uuid | undefined>",
"errorType": "<internal | input | connector | external>"
}

The 'Step' event type

A Step event gives details about the status of a specific step in a workflow. A key piece of info here being stepState which can be running | failure | success

It can be of logType 'input' or 'output' (as explained in the Intro to Logs and Debugging)

Step payload format

The standard step payload format is:

{
"header": {
"payloadSize": 773,
"version": 1
},
"logType": "<step_input | step_output>",
"created": "<iso timestamp>",
"executionCreated": "<iso timestamp>",
"executionId": "<uuid>",
"workflowId": "<uuid>",
"organizationId": "<uuid>",
"stepName": "<string>",
"stepState": "<running | failure | success>",
"connectorName": "<string>",
"connectorVersion": "<string>",
"operation": "<string>",
"executionStepUuid": "<uuid>",
"correlationId": "<uuid>",
// if enabled
"data": "<object>",
// fields present in case of error
"errorMessage": "<string | undefined>",
"errorId": "<uuid | undefined>",
"errorType": "<internal | input | connector | external>"
}

Step payload example

And the following screenshot shows an example step log step_input payload:

step-payload-example

And a step_output payload:

step-payload-example-output

Enhanced error alerting payloads

Note that it is possible to turn on enhanced payloads for your error handling workflows.

This will mean that payloads coming through to your workflows using the Alerting Trigger will contain more detailed information on workflow errors, as they will have parsed the information directly from the third-party service which returned the error.

Please see our Error Handling documentation for full details.

The 'Audit' event type

Audit events inside of Tray.io are a powerful tool to be able to see the user and system generated actions performed on Workflows, Users and Authentications. Context given from these events can be vital to providing key insights into the usage of the Tray platform and also to provide a historical trail of user or system actioned events that took place in the Tray platform.

This allows customers to run their own real time analysis using the tooling of their choice and also have a copy of the logs for batch analysis later and also monitor the usage of the platform for auditing purposes.

Audit payload format

Each audit event has slightly different details, but the following is a sample format:

{
"eventType": "string",
"details": {"stepName": "string", "workflowId": "<uuid>"},
"organizationId": "<uuid>",
"timestamp": "<iso datetime>",
"impersonatedBy": {"userId": "string", "email": "string"},
"calledBy": {"userId": "string", "email": "string"}
}

Audit payload example

And the following screenshot shows an example audit log payload:

audit-payload-example

Please see the appendix below for a table which gives a list of all the Audit events available.

Audit payload example (including Solution Instances)

For Enterprise customers with the Embedded bundle, there are several Embedded-specific Audit event types.

These are solutionInstanceWorkflowCreated, solutionInstanceWorkflowUpdated and solutionInstanceWorkflowDeleted

The following screenshot shows an example log for solutionInstanceWorkflowCreated:

instance-created-datadog

Saving filters in your dashboard

The external service you are streaming your logs to will likely have the ability to filter data according to your needs.

There are obviously huge possibilities in terms of what filtering can be done. But some ways in which you might wish to filter are:

  • By connectorName so you can have a dashboard which shows all information on how Salesforce connectors are running across all your workflows

  • By stepState = retrying to get a view on all step events which are currently retrying

  • By eventType = failed to monitor failing workflows

Setting up logs streaming

To begin the setup process please either:

  • Contact your account manager

Or

  • Click on 'Submit a ticket' in the 'Getting Help' section of the builder:

submit-a-ticket

When creating a ticket you will be presented with the Log Streaming form:

log-streaming-form

The following table lists the basic required information we need to begin the setup process:

RequirementDescriptionExample
Secure Endpoint (https)URL that we'll be streaming the given log information to (This might not be required - i.e. when an API key is needed instead)https://customer.logservice.endpoint/
API keySome services will require an API key
Organization or Email(s) to be enabled onThe Username(s) or Organization/Domain to enable log streaming onEmail(s): support@acme.com Organization: "acme.com"
Content-Type of Requests"applicaton/json" or "application/ndjson"application/json
Log Type"Execution", "step logs" , or "everything"Step Logs

Once set up you can then validate that your service is receiving the correct log types.

info

For whitelisting purposes Tray.io will be sending logs from the following IPs

52.8.7.130

18.144.153.142

Example setup - Datadog

In order to set up Datadog for logs streaming you will need to go to the 'Integrations' section of your dashboard to retrieve both your API key and Application Key which you have configured for use with Tray.io:

datadog-api-keys

Then simply provide us with your Organization/Email, Content type and Logs Type info as above.

Questions & Feedback

In order to improve this feature, we'd like to hear from your experience in using Logs Streaming. To do so, navigate to the "Product Feedback" section of your Tray.io dashboard and mention 'Logs Streaming' in your message.

Appendix - Table of Audit log event types

CategoryName
AuthenticationAuthenticationCreated
AuthenticationAuthenticationUpdated
AuthenticationAuthenticationDeleted
AuthenticationAuthenticationRefreshFailed
AuthenticationAuthenticationRefreshSuccessful
AuthenticationAuthenticationCreationFailed
AuthenticationAuthenticationSharingChanged
AuthenticationAuthenticationUsed
Authentication/WorkflowServiceChanged
Authentication/WorkflowServiceCreated
OrganizationOrganizationUserInvited
OrganizationOrganizationDetailsUpdated
OrganizationOrganizationSettingsUpdated
UserUserInternalRoleChanged
User2FALoginFailed
User2FADisabled
User2FAEnabled
UserUserLoginSucceeded
UserUserLoginFailed
UserUserDeleted
UserUserOrganizationRoleChanged
WorkflowWorkflowUpdated
WorkflowWorkflowCreated
WorkflowWorkflowDeleted
WorkflowWorkflowViewed
WorkflowWorkflowTagsUpdated
WorkflowWorkflowDisabled
WorkflowWorkflowStepTitleUpdated
WorkflowWorkflowStepSettingsUpdated
WorkflowWorkflowStepOperationUpdated
WorkflowWorkflowStepAuthenticationSet
WorkflowWorkflowAlertingWorkflowSet
WorkflowWorkflowStepMoved
WorkflowWorkflowStepDescriptionRemoved
WorkflowWorkflowDescriptionRemoved
WorkflowWorkflowStepDeleted
WorkflowWorkflowVersionRolledBack
WorkflowWorkflowEnabled
WorkflowWorkflowStepCreated
WorkflowWorkflowStepAuthenticationRemoved
WorkflowWorkflowStepDescriptionSet
WorkflowWorkflowCloned
WorkflowWorkflowDescriptionSet
WorkflowWorkflowAlertingWorkflowRemoved
WorkflowWorkflowNameUpdated
WorkflowWorkflowDebugLogViewed
WorkflowWorkflowDetachedFromProject
Solution InstancesolutionInstanceWorkflowCreated
Solution InstancesolutionInstanceWorkflowUpdated
Solution InstancesolutionInstanceWorkflowDeleted