How to customize tags for Elastic Agent Instances in Bamboo Data Center
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
This article provides guidance on how to customize the tags for Elastic Agent instances in Bamboo Data Center. By following the instructions provided, users can ensure that their Elastic Agent instances have meaningful and identifiable tags.
Environment
The solution has been validated in Bamboo Data Center 9.2 but may be applicable to other versions.
Solution
Bamboo employs a specific method to assign tags to Elastic Agent instances. Understanding this logic helps in customizing these tags effectively:
Custom Instance Name: If you specify a custom instance name and it is not empty, Bamboo will utilize this name as the tag. Instructions for setting a custom instance name can be found in the Setting a Custom Instance Name for Elastic Instances section below.
Default Tagging Mechanism: In the absence of a custom name, Bamboo automatically generates a tag using the local hostname and the current username, formatted as bam::hostname::username.
Fallback Option: If Bamboo is unable to determine the hostname, it defaults to ???, resulting in a tag like bam::???::username.
Setting a Custom Instance Name for Elastic Instances
To assign a custom name to Elastic Instances created by Bamboo, perform the following steps:
Stop Bamboo: Ensure Bamboo is not running before making changes.
Configure System Properties: Add the following property to your system properties:
-Delastic.agent.instance.name="custom_name"
Restart Bamboo: After modifying the properties, restart Bamboo to apply the changes.
Persistent Configuration in Docker Containers
When running Bamboo in a Docker container, note that changes made via setenv.sh will not persist across container restarts. To ensure configuration persistence, recreate the container while passing the necessary options as a space-separated list within the JVM_SUPPORT_RECOMMENDED_ARGS="" environment variable. This can be specified directly in the docker run command using the -e, --env, or --env-file options. For example:
docker run [...] --name="bamboo" -e JVM_SUPPORT_RECOMMENDED_ARGS="-Delastic.agent.instance.name=custom_name" atlassian/bamboo:9.2.17
For additional details on setting environment variables, or for scenarios using Docker File or Docker Compose, please refer to the Docker documentation: Set environment variables (-e, --env, --env-file).
Was this helpful?