How to view more details on Bamboo Elastic agent history
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
In order to view more details on Bamboo Elastic agent history, please use the solutions mentioned below.
Environment
Bamboo 8+
Solution
Solution 1
You can use the Bamboo user interface to view your Elastic agent usage history. From the top navigation bar, select > Elastic Bamboo > Agent history.
Solution 2
Use the below SQL query to run it against the Bamboo database to get the Elastic agent's history. This SQL is tested against a Postgres Database.
SELECT EI.NAME AS IMAGE,
Q.ELASTIC_INSTANCE_ID,
Q.CREATED_DATE,
Q.LAST_START_TIME,
Q.LAST_STOP_TIME
FROM QUEUE Q
JOIN ELASTIC_IMAGE EI
ON Q.ELASTIC_IMAGE = EI.ELASTIC_IMAGE_ID
ORDER BY Q.CREATED_DATE DESC
Example output:
image | elastic_instance_id | created_date | last_start_time | last_stop_time |
---|---|---|---|---|
XXXX-bamboo-agent-linux | i-0ce472cb9bc4dbf10 | 2022-11-09 01:20:03.56 | 2022-11-09 01:20:03.559 | 2022-11-09 04:12:35.76 |
XXXX-bamboo-agent-linux | i-0f15154fbddb8e392 | 2022-11-08 23:22:34.602 | 2022-11-09 00:56:59.189 | 2022-11-09 01:12:35.764 |
XXXX-bamboo-agent-windows | i-05ab4de2bdea73661 | 2022-11-05 00:05:34.785 | 2022-11-05 00:05:34.783 | 2022-11-05 01:05:47.982 |
Solution 3
To get more details about the IP addresses of the Elastic agent that has been created, you can get the information from the Bamboo application logs <BAMBOO_HOME>/logs/atlassian-bamboo.log files.
$grep -i 'Bamboo has detected that EC2 instance' logs/atlassian-bamboo*
logs/atlassian-bamboo.log:2022-11-17 14:12:30,794 INFO [elastic-pool-2-thread-1] [RemoteEC2InstanceImpl] Bamboo has detected that EC2 instance i-0bcc14a5b3ed2739d is now running at XX.XXX.XX.XXX.XXX
logs/atlassian-bamboo.log:2022-11-17 14:50:05,324 INFO [elastic-pool-2-thread-1] [RemoteEC2InstanceImpl] Bamboo has detected that EC2 instance i-09a5a5bbfa643fb2c is now running at XX.XXX.XX.XXX.XXX
logs/atlassian-bamboo.log:2022-11-17 14:50:05,324 INFO [elastic-pool-2-thread-5] [RemoteEC2InstanceImpl] Bamboo has detected that EC2 instance i-03cef9363944f1d95 is now running at XX.XXX.XX.XXX.XXX