Workflow Events
- Updated On 27 Jan 2021
- 5 Minutes To Read
-
DarkLight
The CTO.ai Lifecycle Events are predefined events that track common points in most team's delivery lifecycle. You can send us some or all of these events and we will generate insight-rich visualizations on the CTO.ai Dashboard. The more events you send us, the deeper the insights we can surface.
We're releasing new Lifecycle Events as we hear of demand for them. Let us know if there is something you'd like us to add!
You can also create your own custom events, which will also show up on the dashboard, can be filtered or searched on, or can be queried directly from our API.
Skip to the Custom LifeCycle Events in the Table of Contents.
Change Events (abstract)
Change events are abstract. Your team can choose where to instrument them into your pipeline, based on what is most meaningful for you. How do you want to measure your change process?
Change Initiated
- CTO.ai recommends that you send this event either when a feature branch is created, or when a ticket is created.
Change Succeeded
- CTO.ai recommends that you send this event either when code is deployed, or when code is merged to a master branch.
Change Failed
- CTO.ai recommends that you send this event either when an incident is created, or when a pipeline fails.
Change Recovered
- CTO.ai recommends that you send this event when an incident is resolved, or, alternatively, don’t send this event at all and let CTO.ai detect recovery based on Deployment Succeeded events.
Example:
POST /events
{
"event_name": "change",
"event_action": "initiated",
"commit": "298673a9-a40f-4717-b288-060be948831b",
"branch": "main",
"repo": "api",
"team_id": "02f71e12-fa48-45aa-a1f2-956b425e5bee"
}
Ticket Events
Ticket events integrate into your project management software.
POST /events
{
"event_name": "ticket",
"event_action": "initiated",
"commit": "298673a9-a40f-4717-b288-060be948831b",
"repo": "api",
"team_id": "02f71e12-fa48-45aa-a1f2-956b425e5bee"
}
Action values: Initiated, Todo, InProgress, ReadyForReview, Done
Commit Events
Commit events track commit activity in your version control system.
POST /events
{
"event_name": "commit",
"event_action": "succeeded",
"commit": "298673a9-a40f-4717-b288-060be948831b",
"team_id": "02f71e12-fa48-45aa-a1f2-956b425e5bee"
}
Action values
Initiated could represent the creation of a feature branch or the creation of a pull request.
Succeeded could represent any successful commit or a merging to master.
Failed could represent a rejected pull request or a failed merge.
Pipeline Events
If your system has a concept of linear pipelines with defined starting points and ending points, you could make use of pipeline events.
POST /events
{
"event_name": "pipeline",
"event_action": "initiated",
"commit": "298673a9-a40f-4717-b288-060be948831b",
"team_id": "02f71e12-fa48-45aa-a1f2-956b425e5bee"
}
Action values: Initiated, Succeeded, Failed
Review Events
Version control systems sometimes emit review events, which can be captured here.
POST /events
{
"event_name": "review",
"event_action": "succeeded",
"commit": "298673a9-a40f-4717-b288-060be948831b",
"team_id": "02f71e12-fa48-45aa-a1f2-956b425e5bee"
}
Action values: Initiated, Succeeded, Failed
Approval Events
Approval events emitted by your version control system.
POST /events
{
"event_name": "approval",
"event_action": "succeeded",
"commit": "298673a9-a40f-4717-b288-060be948831b",
"team_id": "02f71e12-fa48-45aa-a1f2-956b425e5bee"
}
Action values: Initiated, Succeeded, Failed
Clone Events
Typically used to track clone events that happen at the beginning of a CICD run.
POST /events
{
"event_name": "clone",
"event_action": "initiated",
"commit": "298673a9-a40f-4717-b288-060be948831b",
"repo": "api",
"team_id": "02f71e12-fa48-45aa-a1f2-956b425e5bee"
}
Action values: Initiated, Succeeded, Failed
Build Events
The build step in a CICD pipeline.
POST /events
{
"event_name": "build",
"event_action": "initiated",
"commit": "298673a9-a40f-4717-b288-060be948831b",
"repo": "api",
"team_id": "02f71e12-fa48-45aa-a1f2-956b425e5bee"
}
Action values: Initiated, Succeeded, Failed
Lint Events
The lint step in a CICD pipeline.
POST /events
{
"event_name": "lint",
"event_action": "initiated",
"commit": "298673a9-a40f-4717-b288-060be948831b",
"repo": "api",
"team_id": "02f71e12-fa48-45aa-a1f2-956b425e5bee"
}
Action values: Initiated, Warning, Succeeded, Failed
Test Events (generic)
This could apply to any kind of test, or to all tests if you do not need to distinguish between them.
POST /events
{
"event_name":" "test",
"event_action": "initiated",
"commit": "298673a9-a40f-4717-b288-060be948831b",
"repo": "api",
"team_id": "02f71e12-fa48-45aa-a1f2-956b425e5bee"
}
Action values: Initiated, Succeeded, Failed
Unit Test Events
The unit test step in a CICD pipeline.
POST /events
{
"event_name":" "unittest",
"event_action": "initiated",
"commit": "298673a9-a40f-4717-b288-060be948831b",
"repo": "api",
"team_id": "02f71e12-fa48-45aa-a1f2-956b425e5bee"
}
Action values: Initiated, Succeeded, Failed
End-to-End Test Events
The end-to-end test step in a CICD pipeline, or in a production end-to-end testing environment.
POST /events
{
"event_name":" "e2e_test",
"event_action": "initiated",
"commit": "298673a9-a40f-4717-b288-060be948831b",
"repo": "api",
"team_id": "02f71e12-fa48-45aa-a1f2-956b425e5bee"
}
Action values: Initiated, Succeeded, Failed
Performance Test Events
The performance test event in a CICD pipeline, or in a production performance testing environment.
POST /events
{
"event_name":" "performance_test",
"event_action": "initiated",
"commit": "298673a9-a40f-4717-b288-060be948831b",
"repo": "api",
"team_id": "02f71e12-fa48-45aa-a1f2-956b425e5bee"
}
Action values: Initiated, Succeeded, Failed
Security Audit Events
Scan for known or potential vulnerabilities.
POST /events
{
"event_name":" "security_audit",
"event_action": "initiated",
"commit": "298673a9-a40f-4717-b288-060be948831b",
"repo": "api",
"team_id": "02f71e12-fa48-45aa-a1f2-956b425e5bee"
}
Action values: Initiated, Succeeded, Failed
Licensing Audit Events
Licensing audits check for incorporated third-party code that may have an incompatible license.
POST /events
{
"event_name":" "licensing_audit",
"event_action": "initiated",
"commit": "298673a9-a40f-4717-b288-060be948831b",
"repo": "api",
"team_id": "02f71e12-fa48-45aa-a1f2-956b425e5bee"
}
Action values: Initiated, Succeeded, Failed
Artifact Storage Events
Send an artifact storage event if your pipelines uses a separate step to store built artifacts for later use.
POST /events
{
"event_name":" "artifact_storage",
"event_action": "initiated",
"commit": "298673a9-a40f-4717-b288-060be948831b",
"repo": "api",
"team_id": "02f71e12-fa48-45aa-a1f2-956b425e5bee"
}
Action values: Initiated, Succeeded, Failed
Deployment Events
A deployment event in a CICD pipeline.
POST /events
{
"event_name": "deployment",
"event_action": "initiated",
"commit": "298673a9-a40f-4717-b288-060be948831b",
"repo": "api",
"team_id": "02f71e12-fa48-45aa-a1f2-956b425e5bee"
}
Release Events
A release event in the software delivery process.
POST /events
{
"event_name": "release",
"event_action": "initiated",
"commit": "298673a9-a40f-4717-b288-060be948831b",
"repo": "api",
"team_id": "02f71e12-fa48-45aa-a1f2-956b425e5bee"
}
Action values: Initiated, Succeeded, Failed
Support Request Events
Support Request events integrate into your customer support software.
POST /events
{
"event_name": "support_request",
"event_action": "opened",
"team_id": "02f71e12-fa48-45aa-a1f2-956b425e5bee"
}
Action values: Opened, Updated, Resolved
Incident Events
Integrate this event into your incident management process to gather detailed data on your incident response maturity.
POST /events
{
"event_name": "incident",
"event_action": "initiated",
"commit": "298673a9-a40f-4717-b288-060be948831b",
"repo": "api",
"team_id": "02f71e12-fa48-45aa-a1f2-956b425e5bee"
}
Action values
Initiated represents when an incident is detected and the incident response procedure is initialized.
Succeeded represents an incident that has been resolved.
Failed could represent an incident that has failed to be resolved and abandoned, or that has taken too long to resolve.
Recovery Events
When a pipeline or test succeeds after a failure, or when an incident is resolved.
POST /events
{
"event_name": "recovery",
"event_action": "initiated",
"commit": "298673a9-a40f-4717-b288-060be948831b",
"repo": "api",
"team_id": "02f71e12-fa48-45aa-a1f2-956b425e5bee"
}
Action values: Initiated, Succeeded, Failed
Custom Lifecycle Events
A custom lifecycle event is something you define. When you store custom events, you can query them using our API and build your own tools or metrics based on those events. You can also search, sort, and filter these events on our dashboard, as well as visualize some of them. The built-in visualizations for custom events are not as rich as for CTO.ai lifecycle events, but custom events give you infinite flexibility—The Ops Platform works alongside your tools, not against them.
Send a Custom Event
POST /events
{
"event_name": "custom_event_name1",
"event_action": "custom_action1",
"commit": "298673a9-a40f-4717-b288-060be948831b",
"repo": "api",
"team_id": "02f71e12-fa48-45aa-a1f2-956b425e5bee"
}
Retrieve Events
Read Events through HTTP
curl "https://api.cto.sh/api/v1/events?team_id=aaaa"
Sort your API results by timestamp or any other field in the result body.
curl "https://api.cto.sh/api/v1/events?team_id=aaaa&$sort[timestamp]=-1"
Limit your API results.
curl "https://api.cto.sh/api/v1/events?team_id=aaaa&$limit=10"
🚀 What's next?
📞 Need help? No problem!
-
📧 If you have questions, we are happy to help, please contact support
-
👉 Join our Slack Community to get help or share your ideas.