Skip to content

Conversation

@cgbautista
Copy link
Contributor

Added a feature to support an open source APM for the tomcat process: glowroot.
There are 3 new parameters to the start function:

  • --glowroot: it downloads the latest version of glowroot and deploys it under /opt/glowroot. Activates the APM in tomcat and allos incoming connections.
  • --glowroot-zip=_FILE_: instead of allowing to dectect and download the latest version available, it can specify a zip file with any custom version of glowroot, in case the latest version wouldn't work with the tomcat version running or had any issues. It is ignored if --glowroot is specified.
  • --glowroot-port=_PORT_: it allows to modify the default glowroot port exposed from 4000 to the desired one. Will not do anything if neither --glowroot nor --glowroot-zip are specified.

When enabled, the exposed endpoint can be reached at http://localhost:4000 by default.

Ramon-Jimenez and others added 3 commits June 10, 2025 12:59
…service. It downloads the latest version (--glowroot) or you can specify an specific zip file that you already have downloaded (--glowroot-zip), by default it will listen on port 4000, but you can change it with --glowroot-port (only if glowroot is enabled by any of the other two ways). Latest version is prioritized over an specific file
@cgbautista cgbautista requested a review from tokland July 17, 2025 14:47
Copy link
Contributor

@tokland tokland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor in-line comments:

@tokland
Copy link
Contributor

tokland commented Aug 26, 2025

A minor thing: when not using Glowroot, we see in the logs: "core-1 | warning [/opt/glowroot.zip]: zipfile is empty". The user may think something is wrong. Can we refactor to hide this or show a more descriptive log entry?

domain in the /etc/resolv.conf copied onto the containers
This avoids the `core` container trying to determine when the `data`
container has finished its execution via `curl` to get responses from
any `data.search_domain` machine that might exist.
to the original content (it didn't erase contents, but overwrote any
change on those folders with the files' previous version)
-q" did not return any container, so a "-a" parameter is added to ensure
all processes (even stopped) are returned
@cgbautista cgbautista requested a review from tokland October 22, 2025 13:39
if [ -f $GLOWROOT_ZIP ] && [ ! -d $GLOWROOT_DIR ] ; then
unzip -q $GLOWROOT_ZIP -d /opt/ || [ $? -le 1 ]
status=0
output=$(unzip -q "$GLOWROOT_ZIP" -d /opt/ 2>&1) || status=$?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[formatting] I'd say to test with vscode+some extension (ideally with some .editconfig so we all get the same)


def get_glowroot_zip(command, glowroot_zip, glowroot):
logger = utils.logger
glowroot_path=None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

def get_glowroot_zip(command, glowroot_zip, glowroot):
logger = utils.logger
glowroot_path=None
if isinstance(command, list) and command[0] == "up":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keeping the spirit of immutability, I'd add an explicit else to better manage glowroot_path.

README.md Outdated
When starting a container, there are a few options to enable glowroot on the Tomcat process:
- Use option `--glowroot-port=PORT` to specify the APM glowroot port of the Tomcat process.
- Use option `--glowroot` to use the latest version of glowroot in the Tomcat process.
- Use option `--glowroot-zip=FILE` to specify the zip file with a version of glowroot to run in the Tomcat process.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the default port if not specified?

README.md Outdated
When starting a container, there are a few options to enable glowroot on the Tomcat process:
- Use option `--glowroot-port=PORT` to specify the APM glowroot port of the Tomcat process.
- Use option `--glowroot` to use the latest version of glowroot in the Tomcat process.
- Use option `--glowroot-zip=FILE` to specify the zip file with a version of glowroot to run in the Tomcat process.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear how to the options form a group. I guess --glowroot | glowroot-zip, and --glowroot-port applies to both.

@tokland
Copy link
Contributor

tokland commented Oct 23, 2025

@cgbautista can you link this PR to its task in clickup?

@cgbautista cgbautista requested a review from tokland October 23, 2025 11:40
@tokland
Copy link
Contributor

tokland commented Oct 27, 2025

@cgbautista can you link this PR (in the description) to some task in clickup?

(this one? https://app.clickup.com/t/8699xm4qd)

…topped_containers

"d2-docker rm" not clearing up containers
…_apps

[FIX] -k option should keep apps, dataValues, documents, etc. upon restart
[Fix] Core container might get responses from other servers named "data"
@ifoche ifoche changed the base branch from master to development October 29, 2025 15:28
@ifoche ifoche merged commit a2dacfa into development Oct 29, 2025
2 checks passed
@ifoche ifoche deleted the feature/glowroot branch October 29, 2025 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants