Table: sentry_team - Query Sentry Teams using SQL
A Sentry Team is a collection of members working on a set of projects. Teams are associated with organizations and are used to manage access to projects. Teams can be managed through the Sentry web UI, the Sentry CLI, or programmatically through the Sentry API.
Table Usage Guide
The sentry_team
table provides insights into teams within Sentry. As a DevOps engineer, explore team-specific details through this table, including team id, name, slug, and associated project details. Utilize it to manage access to projects and to understand the team structure within your organization.
Examples
Basic info
Assess the elements within your team by reviewing their access rights, roles, and membership status. This query can be used to gain insights into team dynamics and ensure appropriate access levels are maintained for each team member.
select id, name, has_access, slug, has_access, is_member, member_count, team_rolefrom sentry_team;
select id, name, has_access, slug, has_access, is_member, member_count, team_rolefrom sentry_team;
List teams with admin access
Explore which teams have administrative access to better manage security and user permissions within your organization. This can be particularly useful for auditing purposes or when planning access control strategies.
select id, name, has_access, slug, has_access, is_member, member_count, team_rolefrom sentry_teamwhere team_role = 'admin';
select id, name, has_access, slug, has_access, is_member, member_count, team_rolefrom sentry_teamwhere team_role = 'admin';
List your teams
Explore which teams you are a member of, along with their respective roles and member count. This is useful to understand your team's dynamics and your role within it.
select id, name, has_access, slug, has_access, is_member, member_count, team_rolefrom sentry_teamwhere is_member;
select id, name, has_access, slug, has_access, is_member, member_count, team_rolefrom sentry_teamwhere is_member = 1;
List teams without any members
Determine the teams that lack members to assess potential areas for team reorganization or resource allocation. This query can be useful in identifying unused teams and optimizing team structures.
select id, name, has_access, slug, has_access, is_member, member_count, team_rolefrom sentry_teamwhere member_count = 0;
select id, name, has_access, slug, has_access, is_member, member_count, team_rolefrom sentry_teamwhere member_count = 0;
List teams without an assigned role
Identify teams that have not been assigned a role. This is useful for ensuring all teams have the necessary permissions to perform their tasks.
select id, name, has_access, slug, has_access, is_member, member_count, team_rolefrom sentry_teamwhere team_role is null;
select id, name, has_access, slug, has_access, is_member, member_count, team_rolefrom sentry_teamwhere team_role is null;
List teams which are not assigned to any project
Determine the teams that are currently unassigned to any projects. This query is useful in identifying potential resources that could be allocated to new or existing projects.
select id, name, has_access, slug, has_access, is_member, member_count, team_rolefrom sentry_teamwhere id not in ( select t ->> 'id' from sentry_project, jsonb_array_elements(teams) as t );
select id, name, has_access, slug, has_access, is_member, member_count, team_rolefrom sentry_teamwhere id not in ( select json_extract(t.value, '$.id') from sentry_project, json_each(teams) as t );
Schema for sentry_team
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
avatar | jsonb | Represents an avatar. | |
date_created | timestamp with time zone | The creation timestamp of the team. | |
has_access | boolean | Check if the team has access. | |
id | text | The ID of the team. | |
is_member | boolean | Check if the team is member. | |
is_pending | boolean | Check if the team is pending. | |
member_count | bigint | The total member count of the team. | |
name | text | The name of the team. | |
organization_slug | text | = | The slug of the organization the team belongs to. |
slug | text | = | The slug of the team. |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
team_role | text | The team role. | |
title | text | Title of the resource. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- sentry
You can pass the configuration to the command with the --config
argument:
steampipe_export_sentry --config '<your_config>' sentry_team