Ryan Greenhall

Thoughts on Software Development

Exposed Application Configuration

with 16 comments

Problem:

As a developer or operations person
I want easy access to the current configuration of a web application
So that I can diagnose configuration problems more effectively

Solution:

Expose application properties as a simple HTML page.  Using a URI such as: /internal/status allows the page to be hidden from end users through appropriate configuration of your web server.  For example:

status page example

In this example status page, each configurable property is listed alongside the configured value.  The page even provides the location of the properties file should modifications need to be made.

Teams can go one step further and expose “health checks” through such a page.  In this example the application has three
dependencies that need to be satisfied for correct operation:

1) Need to be able to access a HTTP endpoint;
2) Need a directory to exist (and have read/write permissions)
3) Need to be able to connect to a database.

For each of these properties we can check whether the dependency is satisfied. For example, does the directory exist?
Can we read from the directory?  Any failure can then be exposed visually, providing early warning signs immediately
after a deployment that the application is not healthy and requires further investigation.

For more information on this topic and many other techniques for smoothing the path from dev to production I highly recommend Sam Newman’s QCon 2010 presentation: From Development to Production

Written by Ryan Greenhall

June 3rd, 2010 at 2:41 pm

Posted in devops