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

(PE-27794) add a puma status app #64

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .rubocop.yml
Expand Up @@ -37,7 +37,7 @@ Style/NumericPredicate:
Layout/EmptyLineAfterGuardClause:
Enabled: false

Layout/IndentHeredoc:
Layout/HeredocIndentation:
Enabled: false

Layout/ClosingHeredocIndentation:
Expand Down
31 changes: 26 additions & 5 deletions config/transport_tasks_config.rb
@@ -1,10 +1,10 @@
# frozen_string_literal: true

####################################################
## DO NOT EDIT THIS FILE ##
## Use /etc/puppetlabs/ace/conf.d/ace-server.conf ##
## to configure the sinatra server ##
####################################################
###########################################################
## DO NOT EDIT THIS FILE ##
## Use /etc/puppetlabs/ace-server/conf.d/ace-server.conf ##
## to configure the sinatra server ##
###########################################################

require 'ace/transport_app'
require 'ace/config'
Expand Down Expand Up @@ -47,3 +47,24 @@
end

app impl

#### Metrics/Status

control_token = 'none'
control_url_https = bind_addr.sub(config['port'].to_s, config['status-port'].to_s).sub('force_peer', 'none')

# Start either the default Puma Control/Status app (if it supports our 'auth_actions' feature)
# or start our custom Puma Status app via our custom 'stats' app/plugin (shipped in the Bolt gem).

if defined? auth_actions
control_actions = 'gc-stats,stats'
activate_control_app control_url_https, auth_token: control_token, auth_actions: control_actions
else
begin
plugin 'stats'
stats_url control_url_https
stats_token control_token
rescue UnknownPlugin
puts '* Status endpoint disabled'
end
end
1 change: 1 addition & 0 deletions lib/ace/config.rb
Expand Up @@ -25,6 +25,7 @@ def int_keys
def defaults
super.merge(
'port' => 44633,
'status-port' => 44632,
'concurrency' => 10,
'cache-dir' => "/opt/puppetlabs/server/data/ace-server/cache",
'puppet-server-conn-timeout' => 120,
Expand Down
1 change: 1 addition & 0 deletions spec/unit/ace/config_spec.rb
Expand Up @@ -52,6 +52,7 @@ def build_config(config_file, from_env = false)
'ECDHE-ECDSA-AES128-SHA256',
'ECDHE-RSA-AES128-SHA256'],
'port' => 44633,
'status-port' => 44632,
'concurrency' => 10,
'cache-dir' => "/opt/puppetlabs/server/data/ace-server/cache",
'puppet-server-conn-timeout' => 120,
Expand Down