message: Observe dropped requests in Prometheus metrics
diff: @@ -352,6 +352,7 @@ IrcBridge.prototype._addRequestCallbacks = function() {
  // SUCCESS
  this._bridge.getRequestFactory().addDefaultResolveCallback((req, res) => {
  + const isFromIrc = Boolean((req.getData() || {}).isFromIrc);
  if (res === BridgeRequest.ERR_VIRTUAL_USER) {
  logMessage(req, "IGNORE virtual user");
  return; // these aren't true successes so don't skew graphs
  @@ -362,13 +363,18 @@ IrcBridge.prototype._addRequestCallbacks = function() {
  }
  else if (res === BridgeRequest.ERR_DROPPED) {
  logMessage(req, "IGNORE dropped");
  - return; // these aren't true successes so don't skew graphs
  + if (this._timers) {
  + let timer = this._timers[
  + isFromIrc ? "remote_request_seconds" : "matrix_request_seconds"
  + ];
  + timer.observe({outcome: "dropped"}, req.getDuration() / 1000);
  + }
  + return;
  }
  logMessage(req, "SUCCESS");
  - var isFromIrc = Boolean((req.getData() || {}).isFromIrc);
  stats.request(isFromIrc, "success", req.getDuration());
  if (this._timers) {
  - var timer = this._timers[
  + let timer = this._timers[
  isFromIrc ? "remote_request_seconds" : "matrix_request_seconds"
  ];
  timer.observe({outcome: "success"}, req.getDuration() / 1000);
  