FireHydrant
Port's FireHydrant integration brings FireHydrant resources into your context lake so people and agents can query them.
Setup
Choose one of the following installation methods: Not sure which method is right for your use case? Check the available installation methods.
The prerequisites required for installation are listed below.
-
Go to the Firehydrant Connectors page in Port.
-
Under
Select your installation method, chooseHosted by Port. -
Configure the
Installation parametersandAdvanced configurationas you wish (see below for details).
Installation parameters
Each integration requires specific parameters (such as an API token, a URL, etc.), as seen in Port's UI when installing it. Hover over the ⓘ icon next to each parameter to see more details about it.
Advanced configuration
- During the installation process each integration may have additional settings under the
Advanced configurationsection in Port's UI. Additionally, each integration has one or more settings that can be configured after installation. To do so, click on the integration's name in the Connectors page and navigate to theSettingtab. Hover over the ⓘ icon next to each setting to see more details about it.
Port secrets
Some integration settings require sensitive pieces of data, such as tokens. For these settings, Port secrets will be used, ensuring that your sensitive data is encrypted and secure.
When filling in such a setting, its value will be obscured (shown as ••••••••).
For each such setting, Port will automatically create a secret in your organization.
To see all secrets in your organization, follow these steps.
Port source IP addresses
When using this installation method, Port will make outbound calls to your 3rd-party applications from static IP addresses. You may need to add these addresses to your allowlist, in order to allow Port to interact with the integrated service:
- Europe (EU):
54.73.167.226,63.33.143.237,54.76.185.219 - United States (US):
3.234.37.33,54.225.172.136,3.225.234.99
-
Go to the Firehydrant Connectors page in the Port app.
-
Select the
Self-hostedmethod. -
A
helmcommand will be displayed, with default values already filled out (e.g. your Port client ID, client secret, etc). Copy the command, replace the placeholders with your values, then run it in your terminal to install the integration.
Live event support
Currently, live events are not supported for this integration.
Resyncs will be performed periodically (with a configurable interval), or manually triggered by you via Port's UI.
Therefore, real-time events (including GitOps) will not be ingested into Port immediately.
Live events support for this integration is WIP and will be supported in the near future.
The resync interval can be configured using the scheduledResyncInterval parameter. See the optional parameters section below for more details.
Scalable mode for large integrations
If you are deploying the integration at scale and want to decouple the resync process from the live events process (recommended for large or high-throughput environments), you can enable scalable mode by adding the following flags to your Helm install command:
--set workload.kind="CronJob" \
--set workload.cron.resyncTimeoutMinutes=60 \
--set scheduledResyncInterval="'*/60 * * * *'" \
--set liveEvents.worker.enabled=true
Required parameters:
port.clientId- Your port client id.port.clientSecret- Your port client secret.port.baseUrl- Your Port API URL -https://api.port.iofor EU,https://api.us.port.iofor US.integration.identifier- Change the identifier to describe your integration.integration.type- The integration type.integration.eventListener.type- The event listener type.integration.secrets.token- The FireHydrant API token , docs can be found here.integration.config.appHost- The host of the Port Ocean app. Used to set up the integration endpoint as the target for Webhooks created in FireHydrant.
Optional parameters (click to expand)
integration.config.apiUrl- The FireHydrant API URL. If not specified, the default will be https://api.firehydrant.io.scheduledResyncInterval- The number of minutes between each resync.initializePortResources- Default true, When set to true the integration will create default blueprints and the port App config Mapping.sendRawDataExamples- Enable sending raw data examples from the third party API to port for testing and managing the integration mapping. Default is true.
- GitHub
- Jenkins
- Azure DevOps
- GitLab
- Go to the Firehydrant Connectors page in the Port app.
- Under Select your installation method, choose your desired CI/CD platform.
- Copy the workflow and replace the placeholders with your values.
Below are the available parameters and their descriptions.
| Parameter | Description | Required? | Secret?Store this value as a GitHub Actions secret |
|---|---|---|---|
port_client_id | Your Port client ID (How to get the credentials). | ✓ | ✓ |
port_client_secret | Your Port client secret (How to get the credentials). | ✓ | ✓ |
port_base_url | Your Port API URL (https://api.port.io for EU, https://api.us.port.io for US). | ✓ | ✗ |
token | The FireHydrant API token. | ✓ | ✓ |
api_url | The FireHydrant API URL. If not specified, the default will be https://api.firehydrant.io. | ✗ | ✗ |
initialize_port_resources | Default true. When set to true, the integration will create default blueprints and the Port app config mapping. | ✗ | ✗ |
integration_identifier | The identifier of the integration that will be installed. | ✗ | ✗ |
send_raw_data_examples | Enable sending raw data examples from the third-party API to Port for testing and managing the integration mapping. Default is true. | ✗ | ✗ |
Your Jenkins agent must be able to run Docker commands.
Below are the available parameters and their descriptions.
| Parameter | Description | Required? | Secret?Store this value as a Jenkins credential (Secret Text) |
|---|---|---|---|
OCEAN__ | Your Port client ID (How to get the credentials). | ✓ | ✓ |
OCEAN__ | Your Port client secret (How to get the credentials). | ✓ | ✓ |
OCEAN__ | Your Port API URL (https://api.port.io for EU, https://api.us.port.io for US). | ✓ | ✗ |
OCEAN__ | The FireHydrant API token. | ✓ | ✓ |
OCEAN__ | The FireHydrant API URL. If not specified, the default will be https://api.firehydrant.io. | ✗ | ✗ |
OCEAN__ | Default true. When set to true, the integration will create default blueprints and the Port app config mapping. | ✗ | ✗ |
OCEAN__ | The identifier of the integration that will be installed. | ✗ | ✗ |
OCEAN__ | Enable sending raw data examples from the third-party API to Port for testing and managing the integration mapping. Default is true. | ✗ | ✗ |
Here is an example for a Jenkinsfile pipeline file:Jenkins pipeline (click to expand)
Prerequisites
- Your Azure Devops agent should be able to run docker commands. Learn more about agents here.
- You must have permissions to create and manage Azure DevOps variable groups for storing credentials.
Set up your credentials
- Create a Variable Group: Name it port-ocean-credentials.
- Store the required variables (see the table below).
- Authorize Your Pipeline:
-
Go to "Library" -> "Variable groups."
-
Find port-ocean-credentials and click on it.
-
Select "Pipeline Permissions" and add your pipeline to the authorized list.
-
Below are the available parameters and their descriptions.
| Parameter | Description | Required? | Secret?Store this value as an Azure DevOps pipeline variable |
|---|---|---|---|
OCEAN__ | Your Port client ID (How to get the credentials). | ✓ | ✓ |
OCEAN__ | Your Port client secret (How to get the credentials). | ✓ | ✓ |
OCEAN__ | Your Port API URL (https://api.port.io for EU, https://api.us.port.io for US). | ✓ | ✗ |
OCEAN__ | The FireHydrant API token. | ✓ | ✓ |
OCEAN__ | The FireHydrant API URL. If not specified, the default will be https://api.firehydrant.io. | ✗ | ✗ |
OCEAN__ | Default true. When set to true, the integration will create default blueprints and the Port app config mapping. | ✗ | ✗ |
OCEAN__ | The identifier of the integration that will be installed. | ✗ | ✗ |
OCEAN__ | Enable sending raw data examples from the third-party API to Port for testing and managing the integration mapping. Default is true. | ✗ | ✗ |
Here is an example for a azure-pipeline.yml pipeline file:Azure pipeline (click to expand)
- Go to the Firehydrant Connectors page in the Port app.
- Under Select your installation method, choose your desired CI/CD platform.
- Copy the workflow and replace the placeholders with your values.
Below are the available parameters and their descriptions.
| Parameter | Description | Required? | Secret?Store this value as a GitLab CI/CD variable |
|---|---|---|---|
OCEAN__ | Your Port client ID (How to get the credentials). | ✓ | ✓ |
OCEAN__ | Your Port client secret (How to get the credentials). | ✓ | ✓ |
OCEAN__ | Your Port API URL (https://api.port.io for EU, https://api.us.port.io for US). | ✓ | ✗ |
OCEAN__ | The FireHydrant API token. | ✓ | ✓ |
OCEAN__ | The FireHydrant API URL. If not specified, the default will be https://api.firehydrant.io. | ✗ | ✗ |
OCEAN__ | Default true. When set to true, the integration will create default blueprints and the Port app config mapping. | ✗ | ✗ |
OCEAN__ | The identifier of the integration that will be installed. | ✗ | ✗ |
OCEAN__ | Enable sending raw data examples from the third-party API to Port for testing and managing the integration mapping. Default is true. | ✗ | ✗ |
Configuration
Port integrations use a YAML mapping block to ingest data from the third-party api into Port.
The mapping makes use of the JQ JSON processor to select, modify, concatenate, transform and perform other operations on existing fields and values from the integration API.
Default mapping configuration
This is the default mapping configuration for this integration:
Default mapping configuration (click to expand)
createMissingRelatedEntities: true
deleteDependentEntities: true
resources:
- kind: environment
selector:
query: 'true'
port:
entity:
mappings:
blueprint: '"firehydrantEnvironment"'
identifier: .id
title: .name
properties:
description: .description
activeIncidents: .active_incidents | length
createdAt: .created_at
updatedAt: .updated_at
- kind: service
selector:
query: 'true'
port:
entity:
mappings:
blueprint: '"firehydrantService"'
identifier: .id
title: .name
properties:
description: .description
slug: .slug
links: .links[].href_url
labels: .labels
owner: .owner.name
activeIncidents: .active_incidents | length
meanTimeToAcknowledge: '[(.__incidents.milestones[] | map(select(.type == "started" or .type == "acknowledged")) | sort_by(.occurred_at) | group_by(.type) | map(.[0].occurred_at) | select(length == 2) | ([.[1], .[0]] | map(sub("\\.\\d+Z$"; "Z") | fromdate)) | .[1] - .[0] // null)] | add / length / 3600 | floor'
meanTimeToDetect: '[(.__incidents.milestones[] | map(select(.type == "started" or .type == "detected")) | sort_by(.occurred_at) | group_by(.type) | map(.[0].occurred_at) | select(length == 2) | ([.[1], .[0]] | map(sub("\\.\\d+Z$"; "Z") | fromdate)) | .[1] - .[0] // null)] | add / length / 3600 | floor'
meanTimeToMitigate: '[(.__incidents.milestones[] | map(select(.type == "started" or .type == "mitigated")) | sort_by(.occurred_at) | group_by(.type) | map(.[0].occurred_at) | select(length == 2) | ([.[1], .[0]] | map(sub("\\.\\d+Z$"; "Z") | fromdate)) | .[1] - .[0] // null)] | add / length / 3600 | floor'
meanTimeToResolve: '[(.__incidents.milestones[] | map(select(.type == "started" or .type == "resolved")) | sort_by(.occurred_at) | group_by(.type) | map(.[0].occurred_at) | select(length == 2) | ([.[1], .[0]] | map(sub("\\.\\d+Z$"; "Z") | fromdate)) | .[1] - .[0] // null)] | add / length / 3600 | floor'
createdAt: .created_at
updatedAt: .updated_at
- kind: incident
selector:
query: 'true'
port:
entity:
mappings:
blueprint: '"firehydrantIncident"'
identifier: .id
title: .name
properties:
url: .incident_url
priority: .priority
severity: .severity
tags: .tag_list
currentMilestone: .current_milestone
functionalities: .functionalities[].name
description: .description
customerImpact: .customers_impacted
commander: .role_assignments[] | select(.incident_role.name == "Commander") | .user.email
createdBy: .created_by.email
createdAt: .created_at
relations:
environment: .environments | map(.id)
service: .services | map(.id)
- kind: retrospective
selector:
query: .incident.current_milestone == "postmortem_completed"
port:
entity:
mappings:
blueprint: '"firehydrantRetrospective"'
identifier: .id
title: .name
properties:
url: .incident.incident_url
tags: .tag_list
services: .incident.services[].name
environments: .incident.environments[].name
functionalities: .incident.functionalities[].name
description: .incident.description
customerImpact: .incident.customers_impacted
commander: .incident.role_assignments[] | select(.incident_role.name == "Commander") | .user.email
createdBy: .incident.created_by.email
resolvedAt: .incident.milestones[] | select(.type == "resolved") | .created_at
createdAt: .incident.created_at
publishedAt: .incident.milestones[] | select(.type == "postmortem_completed") | .created_at
duration: (.incident.milestones | map(select(.type == "started" or .type == "resolved")) | sort_by(.occurred_at) | group_by(.type) | map(.[0].occurred_at) | select(length == 2) | ([.[1], .[0]] | map(sub("\\.\\d+Z$"; "Z") | fromdate)) | .[1] - .[0] // null) | ./3600 | floor
completedTasks: .__incident.tasks | map(select(.state == "done")) | length
incompletedTasks: .__incident.tasks | map(select(.state != "done")) | length
questions: '.questions | map({question: .title, answer: .body})'
relations:
incident: .incident.id
Mapping & selectors per resource
- kind: environment
selector:
query: 'true'
port:
entity:
mappings:
blueprint: '"firehydrantEnvironment"'
identifier: .id
title: .name
properties:
description: .description
activeIncidents: .active_incidents | length
createdAt: .created_at
updatedAt: .updated_at
{
"id": "21011924-215e-4aa4-abbf-6155ecf237ae",
"name": "Production",
"slug": "production",
"description": "",
"updated_at": "2023-09-05T17:01:48.348Z",
"created_at": "2023-09-05T17:01:48.348Z",
"active_incidents": [
"71bdfd6f-4ee7-4222-a9a3-832637174ae7",
"fcd05e8b-e66b-46b7-9210-d6607fdc8894"
],
"external_resources": []
}
{
"identifier": "21011924-215e-4aa4-abbf-6155ecf237ae",
"title": "Production",
"icon": "FireHydrant",
"blueprint": "firehydrantEnvironment",
"team": [],
"properties": {
"description": "",
"activeIncidents": 2,
"createdAt": "2023-09-05T17:01:48.348Z",
"updatedAt": "2023-09-05T17:01:48.348Z"
},
"relations": {},
"createdAt": "2023-11-01T11:42:52.458Z",
"createdBy": "hBx3VFZjqgLPEoQLp7POx5XaoB0cgsxW",
"updatedAt": "2023-11-01T11:42:52.458Z",
"updatedBy": "hBx3VFZjqgLPEoQLp7POx5XaoB0cgsxW"
}
Monitoring and sync status
To learn more about how to monitor and check the sync status of your integration, see the relevant documentation.