-
Notifications
You must be signed in to change notification settings - Fork 271
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
Add supervisory_authority plugin #754
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# == Class: Foreman supervisory_authority Plugin | ||
# | ||
# This class installs the supervisory_authority plugin and configuration file. | ||
# | ||
# === Parameters: | ||
# | ||
# $server_url:: The URL for your APM Server. The URL must be fully qualified, including protocol (http or https) and port. | ||
# | ||
# $secret_token:: This string is used to ensure that only your agents can send data to your APM server. | ||
# | ||
# $service_name:: The name of your service. This is used to keep all the errors and transactions of your service together. | ||
# | ||
# === Advanced Parameters: | ||
# | ||
# $log_level:: Log severity level: 0 (debug), 1 (info), 2 (warn), 3 (error), 4 (fatal), 5 (unknown) | ||
# | ||
# $pool_size:: Size of Elastic APM thread pool to send its data to APM Server. | ||
# | ||
# $api_buffer_size:: Maximum amount of objects kept in queue, before sending to APM Server. | ||
# | ||
# $api_request_size:: Maximum amount of bytes sent over one request to APM Server. | ||
# | ||
# $api_request_time:: Maximum duration of a single streaming request to APM Server before opening a new one. | ||
# | ||
# $transaction_max_spans:: Limits the amount of spans that are recorded per transaction. | ||
# | ||
# $http_compression:: Defines if http compression is used to send data to APM Server. | ||
# | ||
# $metrics_interval:: Specify the interval for reporting metrics to APM Server. | ||
# | ||
class foreman::plugin::supervisory_authority ( | ||
Stdlib::HTTPUrl $server_url, | ||
String $secret_token, | ||
Pattern[/^[a-zA-Z0-9 _-]+$/] $service_name, | ||
Integer[0,5] $log_level = 1, | ||
Integer[0] $pool_size = 1, | ||
Integer[0] $api_buffer_size = 256, | ||
String $api_request_size = '750kb', | ||
String $api_request_time = '10s', | ||
Integer[0] $transaction_max_spans = 500, | ||
Boolean $http_compression = false, | ||
String $metrics_interval = '30s', | ||
) { | ||
foreman::plugin { 'supervisory_authority': | ||
config => template('foreman/foreman_supervisory_authority.yaml.erb'), | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
require 'spec_helper' | ||
|
||
describe 'foreman::plugin::supervisory_authority' do | ||
let(:params) do | ||
{ | ||
'server_url' => 'https://example.com', | ||
'secret_token' => 'secret_example', | ||
'service_name' => 'foreman prod', | ||
} | ||
end | ||
include_examples 'basic foreman plugin tests', 'supervisory_authority' | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
:foreman_supervisory_authority: | ||
server_url: <%= @server_url %> | ||
secret_token: '<%= @secret_token %>' | ||
service_name: '<%= @service_name %>' | ||
log_level: <%= @log_level %> | ||
pool_size: <%= @pool_size %> | ||
api_buffer_size: <%= @api_buffer_size %> | ||
api_request_size: '<%= @api_request_size %>' | ||
api_request_time: '<%= @api_request_time %>' | ||
transaction_max_spans: <%= @transaction_max_spans %> | ||
http_compression: <%= @http_compression ? 'true' : 'false' %> | ||
metrics_interval: '<%= @metrics_interval %>' |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to split this up into
Parameters
andAdvanced Parameters
? If not, I prefer the puppet-strings syntax since it's the officially supported one. However, RDoc has the feature of parameter groups which we do use in our installer.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the "Advanced Parameters" section with all parameters which are optional.
The doc-block was taken from another plugin (memcache) to be consistent with whats already there.
I think we should rework the RDoc in all the Puppet files at once to not have different styles of documenting stuff.
What do you think?