README.md in service_skeleton-0.0.0.20.gb9a0460 vs README.md in service_skeleton-0.0.0.25.gbf57918
- old
+ new
@@ -144,11 +144,11 @@
should) declare your configuration variables in your service class, because
that way you can get coerced values (numbers and booleans, rather than strings
everywhere), range and format checking (say "the number must be between one and
ten", or "the string must match this regex"), default values, and error
reporting. You also get direct access to the configuration value as a method
-call on the `@config` object.
+call on the `config` object.
To declare configuration variables, simply call one of the "config declaration
methods" (as listed in the `ServiceSkeleton::ConfigVariables` module) in your
class definition, and pass it an environment variable name (as a string or
symbol) and any relevant configuration parameters (like a default, or a
@@ -261,13 +261,13 @@
class MyService < ServiceSkeleton
config_class MyServiceConfig
def run
loop do
- puts config.something_funny
- sleep 1
- end
+ puts config.something_funny
+ sleep 1
+ end
end
end
## Logging
@@ -325,11 +325,11 @@
If you wish to change the severity level for a single progname, you can
override the default log level for messages with a specific progname, by
specifying one or more "progname severities" separated by commas. A progname
severity looks like this:
-
+
<progname>=<severity>
To make things even more fun, if `<progname>` looks like a regular expression
(starts with `/` or `%r{`, and ends with `/` or `}` plus optional flag
characters), then all log messages with prognames *matching* the specified
@@ -416,11 +416,11 @@
before use. This is typically done in the `#run` method, before entering the
infinite loop.
To register a metric, use one of the standard metric registration methods from
[Prometheus::Client::Registry](https://www.rubydoc.info/gems/prometheus-client/0.8.0/Prometheus/Client/Registry)
-(`#counter`, `gauge`, `histogram`, `summary`, or `register`) on the `metrics`
+(`#counter`, `#gauge`, `#histogram`, `#summary`, or `#register`) on the `metrics`
object to create or register the metric.
In our generic greeter service we've been using as an example so far, you might
like to define a metric to count how many greetings have been sent. You'd define
such a metric like this:
@@ -449,11 +449,11 @@
def run
metrics.counter(:greetings_total, "How many greetings we have sent")
loop do
puts "Hello, #{config.recipient}!"
- metrics.greetings_total.increment(recipient: config.recipient)
+ metrics.greetings_total.increment(recipient: config.recipient)
sleep 1
end
end
end
@@ -468,10 +468,10 @@
def run
metrics.counter(:generic_hello_service_greetings_total, "How many greetings we have sent")
loop do
puts "Hello, #{config.recipient}!"
- metrics.greetings_total.increment(recipient: config.recipient)
+ metrics.greetings_total.increment(recipient: config.recipient)
sleep 1
end
end
end