Latest sites

  • 2017-11-26: New Drupal 8 site at Rue du Commerce, architected and tech-led by OSInet, just went throught Black Friday week with flying colors thanks to RabbitMQ
  • 2017-05-26: New headless Drupal 8 / Symfony 3 site at FranceTV Sport, architected and tech-led by OSInet, with RabbitMQ
  • 2017-02-20: New Drupal 8 site galaxy (+/- 70 sites) for Agences Régionales de Santé architected and tech-led by OSInet, delivered by Klee
  • 2015-08-21: 50% less server load with MongoDB on the Drupal 7 site factory at France Télévisions
  • 2015-07-15: Our first Drupal 8 production site at France Télévisions is live
  • 2014-08-18: 400% speedup in 3 weeks for http://france3-regions.francetvinfo.fr/ : who said Drupal back-offices had to be slow ?
  • 2014-02-07: Sotchi Olympics traffic not a problem for http://www.francetvsport.fr/ , which I rearchitected on Drupal 7 in 2013
  • 2011-09-14: Completed migration of FranceInfo.FR from SPIP to Drupal
  • 2011-07-13: The new social network features of Le Figaro are now powered by an OSInet-designed MongoDB implementation

Quick news

  • 2014-03-27: MongoDB Watchdog module ported to Drupal 8 at the Szeged Dev Days.
  • 2014-01-26: My post on the Symfony web profiler in Silex selected in Week of Symfony. w00t !
  • 2013-10-18: My first commit went into MongoDB today. And, guess what ? It's in JavaScript
  • 2013-09-20 to 29: Working on Drupal 8 EntityAPI at the extended code sprints during and around DrupalCon Prague
  • 2012-08-19: Working on Drupal 8 EntityAPI at Drupalcon Munich
  • 2012-06-15: Working on Drupal 8 EntityAPI at DrupalDevDays Barcelona
  • 2012-03-23: Working on the future Drupal Document Oriented Storage at DrupalCon Denver. D8 or later ? Bets are on Later

Golang tip of the day: admin dashboard and health checks in Beego applications

One litle-publicized feature of the BeeGo Go framework is its admin dashboard.

Features

Although it may look quite raw visually (think MIME: text/plain), it contains a wealth of information about goroutines, threads, memory usage, and request statistics. It even allows devs to add to a "healthcheck" list, and admins allowed dashboard access to run "tasks" defined in code. The diagram belows shows the hierarchy of features in the version coming with Beego 1.3.0.

BeeGo admin dashboard

Enabling and customizing the admin dashboard

The admin dashboard is not enabled by default. Its availability is controlled by the EnableAdmin global. The simplest (best ?) way to configure it is arguably to add it to the confg/app.conf configuration file:

appname = wego
httpport = 8080
runmode = dev
enableadmin = true

For the curious reader, the config loading happens in beego/config.ParseConfig(), which is itself triggered by beego/config init(), meaning it runs before the application main().

Some degree of configuration is available, via the two additional variables: AdminHttpAddr which take an IP address/name string (default: 127.0.01), and AdminHttpPort, which takes an integer port number (default: 8088).

Adding application health checks runnable from the admin dashboard

The dashboard provides access to a "healthcheck" section, allowing app developers to add their custom sanity checks on the running application.

Health checks are defined by the minimal HealthChecker interface, and stored in the AdminCheckList map. Although the is public, it is better to add checks to it using function AddHealthCheck():


// See beego/toolbox/healthcheck.go
type HealthChecker interface {
    Check() error
}

// add health checker with name string
func AddHealthCheck(name string, hc HealthChecker) {
    AdminCheckList[name] = hc
}

The dashboard-triggered healthcheck works by iterating on the checks in AdminCheckList, and printing the results from each check which returned a non-nil error.