<commit_before>require 'airbrake'
require 'dotenv'
Dotenv.load


Airbrake.configure do |config|
  config.api_key  = ENV['AIRBRAKE_API_KEY']
  config.host     = ENV['ERRBIT_HOST']
  config.port     = ENV['ERRBIT_PORT']
  config.environment_name = ENV['ERRBIT_ENVIRONMENT_NAME'] || `hostname`
  config.user_attributes = %w[id email]
end


args = {error: "we have an error", origin: "somewhere special"}
Airbrake.notify(NoMethodError, :parameters => args, :cgi_data => ENV.to_hash)
<commit_msg>filter environment variables<commit_after>require 'bundler/setup'
require 'airbrake'
require 'dotenv'
Dotenv.load


Airbrake.configure do |config|
  config.api_key  = ENV['AIRBRAKE_API_KEY']
  config.host     = ENV['ERRBIT_HOST']
  config.port     = ENV['ERRBIT_PORT']
  config.environment_name = ENV['ERRBIT_ENVIRONMENT_NAME'] || `hostname`
  config.user_attributes = %w[id email]
end

def filtered_env
  ENV.reject {|k,v|k.match("_API_KEY$|_API_SECRET$")}
end

args = {error: "we have an error", origin: "somewhere special"}
Airbrake.notify(NoMethodError, :parameters => args, :cgi_data => filtered_env)

{'fraction_non_alphanumeric': 0.1349134001823154, 'fraction_numerical': 0.0, 'mean_word_length': 5.614457831325301, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4748635', 'n_tokens_mistral': 408, 'n_tokens_neox': 402, 'n_words': 79}