Tray Platform / Logs and Troubleshooting / Streaming logs to external systems

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:

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

And an individual event:

Log event types

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:

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:

And a step_output payload:

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": "..",
"details": { ... },
"organizationId": "<uuid>",
"timestamp": "<iso datetime>",
"impersonatedBy": {
"userId": "string",
"email": "string"
} | undefined,
"calledBy": {
"userId": "string",
"email": "string"
}
}

Audit payload example

And the following screenshot shows an example audit log payload:

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

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 process you should make a request to your Customer Success representative for log streaming to be set up.

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

We will then follow up with confirmation that the log streaming has been set up.

You can then validate that your service is receiving the correct log types.

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:

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