You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Learn how to sync your Port service entities into incident.io catalog.
4
+
description: Learn how to sync your Port service entities into incident.io catalog for better visibility.
5
5
---
6
6
7
7
import Tabs from "@theme/Tabs"
@@ -12,110 +12,28 @@ import PortApiRegionTip from "/docs/generalTemplates/_port_region_parameter_expl
12
12
# Sync Port Services to incident.io
13
13
This guide demonstrates how to set up a GitHub workflow that periodically syncs service entities from Port into incident.io's catalog, ensuring better visibility and context for your services during incident management.
14
14
15
-
16
15
## Prerequisites
17
16
18
-
-You need a Port account and should have completed the [onboarding process](/getting-started/overview)
19
-
- A GitHub repository where you can trigger a workflow for this guide
20
-
- An [incident.io](https://app.incident.io/) account and an API key
21
-
22
-
## Set up required secrets and permissions
17
+
-Complete the [onboarding process](/getting-started/overview).
18
+
- A GitHub repository where you can trigger a workflow for this guide.
19
+
- An [incident.io](https://app.incident.io/) account with **admin access** to create API keys.
20
+
-[Port's GitHub app](https://github.com/apps/getport-io) needs to be installed (required for GitHub Actions implementation)
21
+
- A `Service` blueprint in Port to represent the service entities you want to sync to incident.io. You should already have one installed during the [onboarding process](/getting-started/overview).
23
22
24
-
- In your GitHub repository, [go to **Settings > Secrets**](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository) and add the following secrets:
25
-
-`PORT_CLIENT_ID` - Port Client ID [learn more](/build-your-software-catalog/custom-integration/api/#get-api-token)
26
-
-`PORT_CLIENT_SECRET` - Port Client Secret [learn more](/build-your-software-catalog/custom-integration/api/#get-api-token)
27
-
-`INCIDENT_IO_API_KEY` - [API key](https://app.incident.io/settings/api-keys) from your incident.io dashboard with the following permissions:
28
-
-`Can manage catalog types and edit catalog data`
29
-
-`Can view catalog types and entries`
30
-
-`INCIDENT_IO_CATALOG_TYPE_ID` - Incident.io catalog type ID. To be created in [this section](#create-a-catalog-item-in-incident-io)
23
+
:::info Admin Access Required
24
+
You need admin access to your incident.io organization to create API keys. If you don't have admin access, contact your incident.io administrator to create the API key for you.
25
+
:::
31
26
27
+
## Set up required secrets and permissions
32
28
33
-
Below is the JSON for the `Service` blueprint that represents the service entities you will sync from Port to incident.io:
29
+
In your GitHub repository, [go to **Settings > Secrets**](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository) and add the following secrets:
30
+
-`PORT_CLIENT_ID` - Port Client ID [learn more](/build-your-software-catalog/custom-integration/api/#get-api-token).
31
+
-`PORT_CLIENT_SECRET` - Port Client Secret [learn more](/build-your-software-catalog/custom-integration/api/#get-api-token).
32
+
-`INCIDENT_IO_API_KEY` - [API key](https://app.incident.io/settings/api-keys) from your incident.io dashboard with the following permissions:
33
+
-`Can manage catalog types and edit catalog data`
34
+
-`Can view catalog types and entries`
35
+
-`INCIDENT_IO_CATALOG_TYPE_ID` - Incident.io catalog type ID. To be created in [this section](#create-a-catalog-type-in-incident-io).
34
36
35
-
<details>
36
-
<summary><b>Service blueprint (click to expand)</b></summary>
37
-
38
-
```json showLineNumbers
39
-
{
40
-
"identifier": "service",
41
-
"title": "Service",
42
-
"icon": "Github",
43
-
"schema": {
44
-
"properties": {
45
-
"readme": {
46
-
"title": "README",
47
-
"type": "string",
48
-
"format": "markdown",
49
-
"icon": "Book"
50
-
},
51
-
"url": {
52
-
"title": "URL",
53
-
"format": "url",
54
-
"type": "string",
55
-
"icon": "Link"
56
-
},
57
-
"language": {
58
-
"icon": "Git",
59
-
"type": "string",
60
-
"title": "Language",
61
-
"enum": [
62
-
"GO",
63
-
"Python",
64
-
"Node",
65
-
"React"
66
-
],
67
-
"enumColors": {
68
-
"GO": "red",
69
-
"Python": "green",
70
-
"Node": "blue",
71
-
"React": "yellow"
72
-
}
73
-
},
74
-
"type": {
75
-
"title": "Type",
76
-
"description": "This service's type",
77
-
"type": "string",
78
-
"enum": [
79
-
"Backend",
80
-
"Frontend",
81
-
"Library"
82
-
],
83
-
"enumColors": {
84
-
"Backend": "purple",
85
-
"Frontend": "pink",
86
-
"Library": "green"
87
-
},
88
-
"icon": "DefaultProperty"
89
-
},
90
-
"lifecycle": {
91
-
"title": "Lifecycle",
92
-
"type": "string",
93
-
"enum": [
94
-
"Production",
95
-
"Experimental",
96
-
"Deprecated"
97
-
],
98
-
"enumColors": {
99
-
"Production": "green",
100
-
"Experimental": "yellow",
101
-
"Deprecated": "red"
102
-
},
103
-
"icon": "DefaultProperty"
104
-
}
105
-
},
106
-
"required": []
107
-
},
108
-
"mirrorProperties": {},
109
-
"calculationProperties": {},
110
-
"aggregationProperties": {},
111
-
"relations": {}
112
-
}
113
-
```
114
-
</details>
115
-
116
-
:::note Adding More Blueprint Properties
117
-
While this example shows a standard service schema, you can easily add new properties to the blueprint JSON schema to represent additional details about your services and sync them to incident.io.
118
-
:::
119
37
120
38
## Create a catalog type in incident.io
121
39
@@ -135,30 +53,41 @@ To sync your Port services into incident.io, you first need to create a catalog
135
53
-`lifecycle`: Select `string` as the data type
136
54
-`type`: Select `string` as the data type
137
55
138
-
5. Once successful, click on the newly created type and take note of the ID from the browser's URL. For example, the ID might be something like `01J5RB95K5NNDE1CRQ7ZQ24YH5` for this browser URL (https://app.incident.io/organization/catalog/01J5RB95K5NNDE1CRQ7ZQ24YH5). Create a GitHub secret (`INCIDENT_IO_CATALOG_TYPE_ID`) in the repository with the value of this ID.
56
+
5.**Save the changes** by clicking the **Save** button
57
+
6. Once successful, click on the newly created type and take note of the ID from the browser's URL. For example, the ID might be something like `01J5RB95K5NNDE1CRQ7ZQ24YH5` for this browser URL (https://app.incident.io/organization/catalog/01J5RB95K5NNDE1CRQ7ZQ24YH5)
58
+
7. Create a GitHub secret (`INCIDENT_IO_CATALOG_TYPE_ID`) in the repository with the value of this ID
139
59
140
60
141
61
## Create GitHub workflow
142
62
143
-
Let's go ahead and create a GitHub workflow file in a GitHub repository meant for the incident.io integration:
63
+
Let's create a GitHub workflow file in a GitHub repository for the incident.io integration:
144
64
145
65
- Create a GitHub repository (or use an existing one)
146
66
- Create a `.github` directory and `workflows` sub directory
147
67
148
68
Inside the `.github/workflows` directory create a file called `sync-port-services-to-incident-io.yml` with the following content:
149
69
150
70
<details>
151
-
<summary><b>GitHub workflow configuration (click to expand)</b></summary>
71
+
<summary><b>GitHub workflow configuration (click to expand)</b></summary>
152
72
153
-
:::tip schedule interval
154
-
The default syncing interval is set to 2 hours. Adjust it to suit your use case
73
+
:::info Blueprint Schema Matching
74
+
Make sure the property names in your Port Service blueprint match the attribute names in your incident.io catalog type. The workflow maps these properties:
75
+
-`url` → `url` attribute
76
+
-`readme` → `readme` attribute
77
+
-`language` → `language` attribute
78
+
-`lifecycle` → `lifecycle` attribute
79
+
-`type` → `type` attribute
80
+
81
+
If you have different property names, update the mapping in step 4 of the workflow.
155
82
:::
156
83
157
84
```yml showLineNumbers
158
85
name: Sync Data to incident.io
159
86
on:
160
87
schedule:
161
88
- cron: "0 */2 * * *"# every two hours. Adjust this value
echo "Response from Incident.io API for entity $name"
194
+
echo "Incident.io API response for entity $name:"
195
+
echo "$response"
196
+
197
+
# Check if the response indicates success
198
+
if echo "$response" | grep -q "201\|200"; then
199
+
echo "✅ Successfully synced entity $name to incident.io"
200
+
else
201
+
echo "❌ Failed to sync entity $name to incident.io"
202
+
echo "Response: $response"
203
+
fi
266
204
done
267
205
```
268
206
269
207
<PortApiRegionTip/>
270
208
</details>
271
209
272
210
273
-
## Results
211
+
## Let's test it!
274
212
275
-
Once the scheduled GitHub workflow is triggered, the service entities from Port will be automatically synced into your incident.io catalog. To view the ingested catalog items:
213
+
1. **Manual Testing**: Go to your GitHub repository's **Actions** tab and manually trigger the `Sync Data to incident.io` workflow to test it immediately.
214
+
2. **Check the logs**: Review the workflow logs to ensure all entities are being synced successfully.
215
+
3. **Verify in incident.io**:
216
+
- Log in to your incident.io account.
217
+
- Navigate to the **Catalog** section in the left navigation bar.
218
+
- Search for the `Port Services` catalog type or any custom name you provided.
219
+
- You should now see the synced service entities from Port listed under this catalog type.
276
220
277
-
1. Log in to your incident.io account.
278
-
2. Navigate to the **Catalog** section in the left navigation bar.
279
-
3. Search for the `Port Services` catalog type or any custom name you provided.
280
-
4. You should now see the synced service entities from Port listed under this catalog type, giving you improved visibility and context for managing incidents.
Once the GitHub workflow runs (either manually or on schedule), the service entities from Port will be automatically synced into your incident.io catalog, giving you improved visibility and context for managing incidents.
283
224
225
+
With this integration in place, you'll have real-time access to your Port services within incident.io, streamlining your incident response and management processes.
284
226
285
-
With this integration in place, you’ll have real-time access to your Port services within incident.io, streamlining your incident response and management processes.
0 commit comments