This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/honeybadger.rb | |
Honeybadger.configure do |config| | |
config.before_event do |event| | |
event.payload.update(Honeybadger.get_context.slice(:user_id, :tenant_id)) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/honeybadger.rb | |
# See https://docs.honeybadger.io/lib/ruby/gem-reference/configuration/#changing-notice-data for more info | |
Honeybadger.configure do |config| | |
config.before_notify do |notice| | |
additional_tags = | |
case notice.backtrace.lines.first&.file | |
when /stripe\.rb/ | |
["payment"] | |
else | |
[] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/honeybadger.rb | |
require "zlib" | |
PERCENT_TO_SEND = 10 | |
Honeybadger.configure do |config| | |
config.before_event do |event| | |
if event[:request_id] # Send all events for a given request | |
event.halt! unless Zlib.crc32(event[:request_id].to_s) % 100 < PERCENT_TO_SEND |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
# Enable automatic package updates and upgrades during cloud-init execution | |
package_update: true | |
package_upgrade: true | |
packages: | |
# Security and Hardening | |
- ufw | |
- fail2ban |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws: | |
access_key_id: 123 | |
secret_access_key: 456 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Honeybadger from "@honeybadger-io/js"; | |
const honeybadger = Honeybadger.configure({ | |
apiKey: "your-api-key", | |
}); | |
// Function to generate a SHA-256 hash in pure JavaScript | |
async function generateFingerprint(stackFrame) { | |
const { file, line, method } = stackFrame; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/honeybadger.rb | |
Honeybadger.configure do |config| | |
config.before_event do |event| | |
event[:dyno] = ENV['DYNO'] if ENV['DYNO'].present? | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Amazon ECS release | |
on: | |
workflow_run: | |
workflows: ["Tests"] | |
branches: [master] | |
types: [completed] | |
concurrency: | |
group: production |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_codedeploy_app" "web" { | |
compute_platform = "ECS" | |
name = "honeybadger-web-${var.environment}" | |
} | |
resource "aws_codedeploy_deployment_group" "web" { | |
app_name = aws_codedeploy_app.web.name | |
deployment_config_name = "CodeDeployDefault.ECSAllAtOnce" | |
deployment_group_name = var.environment | |
service_role_arn = aws_iam_role.web-deployer.arn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "http/server" | |
require "honeybadger" | |
Honeybadger.configure do |config| | |
config.api_key = "replaceme" | |
config.environment = "production" | |
end | |
server = HTTP::Server.new do |context| | |
context.response.content_type = "text/plain" |
NewerOlder