Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

airbrake v5 api routes-brakedowns/routes-stats #1450

Open
teadur opened this issue Oct 16, 2019 · 2 comments
Open

airbrake v5 api routes-brakedowns/routes-stats #1450

teadur opened this issue Oct 16, 2019 · 2 comments

Comments

@teadur
Copy link

teadur commented Oct 16, 2019

  • Errbit version: 0.9.0-dev
  • OS: Debian Buster

Errbit seems to not support airbrake v5 api new features.
From logs it sounds like it's related to APM features of airbrake.
Are there any plans to implement this or atleast catch the exception?

Client "airbrake-ruby/4.6.0 Ruby/2.4.7"

Steps to reproduce:

  1. Connect latest airbrake/airbrake-ruby client to errbit

Observed Results:

Exception is thrown about the missing routes

Expected Results:

Implement missing feature or catch the exception and document comptability.

Application Logs:

ActionController::RoutingError (No route matches [PUT] "/api/v5/projects/1/routes-stats"):
ActionController::RoutingError (No route matches [PUT] "/api/v5/projects/1/routes-breakdowns"):

@stevecrozz
Copy link
Member

That is a great point. I don't have any plans to update the API, so I suppose we'll probably need to clarify which API versions we can support.

@burnettk
Copy link
Contributor

@jasquat and i investigated this a bit. we're thinking that errbit should just throw away the data if the client sends it (until someone cares to replicate airbrake's performance management UIs in errbit) and avoid verbose 404 logging, but we discovered a client configuration that will prevent these requests from being sent in the first place. so if you are using airbrake-ruby greater than version 2, do this:

 Airbrake.configure do |config|
  config.job_stats = false
  config.query_stats = false
  config.performance_stats = false
end

docs are at https://github.com/airbrake/airbrake-ruby#performance_stats.

here's a naive bash script to add these configs to your rails app if it would be appropriate to do so:

#!/usr/bin/env bash

set -eo pipefail

airbrake_ruby_gemfile_lock_line="$(grep -ohE '    airbrake-ruby \(\d+' Gemfile.lock || echo '')"
if [[ -n "$airbrake_ruby_gemfile_lock_line" ]]; then
  airbrake_ruby_major_version="$(perl -p -e "s/    airbrake-ruby \((\d+)/\1/" <<< "$airbrake_ruby_gemfile_lock_line")"
  if [[ "$airbrake_ruby_major_version" -gt "2" ]]; then
    file_with_configuration="$(grep -l Airbrake.configure config/initializers/*)"
    for i in performance_stats query_stats job_stats; do
      if ! grep -q "$i" "$file_with_configuration"; then
        perl -pi -e "s/(Airbrake.configure.*)\|([^|]+)\|/\1|\2|\n  \2.$i = false/" "$file_with_configuration"
      fi
    done
  fi
fi

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

No branches or pull requests

3 participants