Skip to main content

Check out Port for yourself ➜ 

Sentry

Loading version...

Port's Sentry integration allows you to model Sentry resources in your software catalog and ingest data into them.

Setup

Choose one of the following installation methods: Not sure which method is right for your use case? Check the available installation methods.

Live events

In order for the Sentry integration to update the data in Port on real-time changes in Sentry, you need to create a webhook in Sentry.

Create a webhook in Sentry

  1. Log in to Sentry with your organization's credentials.
  2. Click the gear icon (Setting) at the left sidebar of the page.
  3. Choose Developer Settings.
  4. At the upper corner of this page, click on Create New Integration.
  5. Sentry provides two types of integrations: Internal and Public. For the purpose of this guide, choose Internal Integration and click on the Next button.
  6. Input the following details:
    • Name - use a meaningful name such as "Port Webhook".
    • Webhook URL - enter the appropriate URL.
    • Overview - enter a description for the webhook. -Permissions - Grant your webhook Read permissions for the Issue & Event category.
    1. Webhooks - Under this section, enable the issues checkbox to allow Sentry to report issue events to Port.
  7. Click Save Changes at the bottom of the page.
Update the webhook secret in your integration configuration

Now that the webhook is created, you can take the secret value generated by Sentry and use it to update the sentryWebhookSecret in your integration configuration. For more details on setting up internal integrations in Sentry, see the Sentry documentation.

Webhook URL configuration

Depending on your installation method, the webhook URL will be different:

  • Hosted by Port: The webhook URL is provided in the Port UI after you created the integration.
  • Self-hosted: The webhook URL is the address where your integration instance is reachable, followed by /ingress. For example: https://sentry-integration.yourdomain.com/ingress.

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)
deleteDependentEntities: true
createMissingRelatedEntities: true
enableMergeEntity: true
resources:
- kind: user
selector:
query: 'true'
port:
entity:
mappings:
identifier: .email
title: .user.name
blueprint: '"sentryUser"'
properties:
username: .user.username
isActive: .user.isActive
dateJoined: .user.dateJoined
lastLogin: .user.lastLogin
orgRole: .orgRole
inviteStatus: .inviteStatus
- kind: user
selector:
query: 'true'
port:
entity:
mappings:
identifier: .email
blueprint: '"_user"'
relations:
sentry_user: .email
- kind: project-tag
selector:
query: 'true'
tag: environment
port:
entity:
mappings:
identifier: .slug + "-" + .__tags.name
title: .name + "-" + .__tags.name
blueprint: '"sentryProjectEnvironment"'
properties:
dateCreated: .dateCreated
platform: .platform
status: .status
link: .organization.links.organizationUrl + "/projects/" + .name
- kind: issue-tag
selector:
query: 'true'
tag: environment
port:
entity:
mappings:
identifier: .id + "-" + .item.name
title: .title + " -" + " " + .item.name
blueprint: '"sentryIssue"'
properties:
link: .permalink + "?environment=" + .item.name
status: .status
isUnhandled: .isUnhandled
relations:
projectEnvironment: (.project.slug as $slug | .item | "\($slug)-\(.name)")
assignee:
combinator: '"and"'
rules:
- operator: '"="'
property: '"$identifier"'
value: .assignedTo.email
- kind: team
selector:
query: 'true'
includeMembers: true
port:
entity:
mappings:
identifier: .slug
title: .name
blueprint: '"sentryTeam"'
properties:
dateCreated: .dateCreated
memberCount: .memberCount
roles: .teamRole
projects: .projects | map (.slug)
relations:
members: if .__members != null then .__members | map(.user.email) | map(select(. != null)) else [] end

Mapping & examples per resource

Examples of blueprints and the relevant integration configurations:

Monitoring and sync status

To learn more about how to monitor and check the sync status of your integration, see the relevant documentation.