fix: switch to using ec2 instance role
This commit is contained in:
@@ -262,6 +262,7 @@ AZURE_APP_SECRET=
|
||||
|
||||
# Sidekiq CloudWatch Metrics Configuration
|
||||
# Enable CloudWatch metrics collection for Sidekiq (Chatwoot Cloud only)
|
||||
# Uses EC2 instance role for AWS credentials - no additional AWS config needed
|
||||
# ENABLE_SIDEKIQ_CLOUDWATCH=true
|
||||
|
||||
# CloudWatch namespace for Sidekiq metrics (default: Chatwoot/Sidekiq)
|
||||
|
||||
@@ -1,16 +1,8 @@
|
||||
if defined?(Sidekiq::CloudWatchMetrics) && defined?(ChatwootApp) && ChatwootApp.chatwoot_cloud? && ENV['ENABLE_SIDEKIQ_CLOUDWATCH'].present?
|
||||
require 'sidekiq/cloudwatchmetrics'
|
||||
|
||||
# Configure AWS region if specified
|
||||
if ENV['AWS_REGION'].present?
|
||||
require 'aws-sdk-cloudwatch'
|
||||
client = Aws::CloudWatch::Client.new(region: ENV['AWS_REGION'])
|
||||
else
|
||||
client = nil # Use default client (EC2 instance role or env credentials)
|
||||
end
|
||||
|
||||
# Use EC2 instance role for AWS credentials (no custom client needed)
|
||||
Sidekiq::CloudWatchMetrics.enable!(
|
||||
client: client,
|
||||
namespace: ENV.fetch('SIDEKIQ_CLOUDWATCH_NAMESPACE', 'Chatwoot/Sidekiq'),
|
||||
interval: ENV.fetch('SIDEKIQ_CLOUDWATCH_INTERVAL', '60').to_i
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user