Table: buildkite_agent - Query Buildkite Agents using SQL
Buildkite Agents are small, reliable, and powerful execution units that run Buildkite jobs. They are responsible for running the actual build jobs, reporting the log output, and capturing the exit status code of the command that is run. Buildkite Agents can run on multiple platforms including Linux, macOS, Windows, FreeBSD, and Docker.
Table Usage Guide
The buildkite_agent
table provides insights into the individual agents within the Buildkite platform. As a DevOps engineer, explore agent-specific details through this table, including their status, version, and configuration. Utilize it to monitor the performance and health of your Buildkite Agents, and to ensure they are configured correctly and running the latest versions.
Examples
Most recent 3 agents registered
Explore the most recently registered agents within your system. This can help you to quickly identify new agents and ensure they are set up correctly.
select id, name, hostname, ip_address, created_atfrom buildkite_agentorder by created_at desclimit 3;
select id, name, hostname, ip_address, created_atfrom buildkite_agentorder by created_at desclimit 3;
Agents by connection state
Analyze the distribution of Buildkite agents based on their connection states to better manage resources and troubleshoot connection issues. This can help optimize agent usage and ensure seamless operation of the Buildkite platform.
select connection_state, count(*)from buildkite_agentgroup by connection_stateorder by count desc;
select connection_state, count(*)from buildkite_agentgroup by connection_stateorder by count(*) desc;
Agents by org
Analyze the distribution of Buildkite agents across various organizations. This can help in understanding which organizations have the most agents, aiding in resource allocation and management strategies.
select organization_slug, count(*)from buildkite_agentgroup by organization_slugorder by count desc;
select organization_slug, count(*)from buildkite_agentgroup by organization_slugorder by count(*) desc;
Agents that haven't run any jobs in the last 24 hours
Explore which agents have been inactive in the last 24 hours. This can be useful to identify any underutilized resources and optimize your system's efficiency.
select id, name, hostname, ip_address, last_job_finished_atfrom buildkite_agentwhere last_job_finished_at < now() - interval '24 hours'order by name;
select id, name, hostname, ip_address, last_job_finished_atfrom buildkite_agentwhere last_job_finished_at < datetime('now', '-24 hours')order by name;
Schema for buildkite_agent
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
connection_state | text | State of the connection to the agent. | |
created_at | timestamp with time zone | Time when the agent was created. | |
creator | jsonb | User that created the agent. | |
hostname | text | = | Hostname for the agent. |
id | text | = | ID of the agent. |
ip_address | inet | IP address for the agent. | |
job | jsonb | Job running on the agent. | |
last_job_finished_at | timestamp with time zone | Time when the agent finished it's last job. | |
member_id | text | =, !=, ~~, ~~*, !~~, !~~* | Unique identifier for the organization. |
meta_data | jsonb | Metadata for the agent. | |
name | text | = | Name of the agent. |
organization_slug | text | = | Organization of the agent. |
priority | bigint | Priority of the agent. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
url | text | URL for the agent. | |
user_agent | text | User agent of the agent. | |
version | text | = | Version of the agent. |
web_url | text | Web URL for the agent. |
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)" -- buildkite
You can pass the configuration to the command with the --config
argument:
steampipe_export_buildkite --config '<your_config>' buildkite_agent