Skip to content

Commit 2d0db0e

Browse files
authored
Merge pull request #4382 from esl/instrumentation-docs-update
Updating documentation
2 parents 1e890ff + f6e474e commit 2d0db0e

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

Diff for: doc/configuration/instrumentation.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ In case both `prefix` and `env_prefix` are defined, it will be placed before the
9292
## Log handler options
9393

9494
### `instrumentation.log.level`
95-
* **Syntax:** string, one of `"none"`, `"emergency"`, `"alert"`, `"critical"`, `"error"`, `"warning"`, `"notice"`, `"info"`, `"debug"`, `"all"`.
95+
* **Syntax:** string, one of `"emergency"`, `"alert"`, `"critical"`, `"error"`, `"warning"`, `"notice"`, `"info"`, `"debug"`, `"all"`.
9696
* **Default:** `"debug"`
9797
* **Example:** `loglevel = "error"`
9898

@@ -107,10 +107,10 @@ Note that for some events, the level may be different, and this option overridde
107107

108108
## Example Prometheus configuration
109109

110-
This configuration enables `prometheus`, and `log` handlers:
110+
This configuration enables `prometheus`, and `log` handlers, setting the periodic measurement (probe) interval to 60 seconds:
111111
```toml
112112
[instrumentation]
113-
probe_interval = 10_000
113+
probe_interval = 60
114114

115115
[instrumentation.prometheus]
116116

Diff for: doc/migrations/6.2.1_x.x.x.md

-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ Exometer is no longer configured through [`app.config`](../configuration/configu
3636

3737
Example configuration that is equivalent to the old example configuration provided in `app.config`:
3838
```toml
39-
[instrumentation]
40-
probe_interval = 60000
41-
4239
[[instrumentation.exometer.report.graphite]]
4340
host = "127.0.0.1"
4441
port = 2003

Diff for: src/config/mongoose_config_validator.erl

+7
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ validate(V, atom, module) -> validate_module(V);
4646
validate(V, atom, {module, Prefix}) ->
4747
validate_module(list_to_atom(atom_to_list(Prefix) ++ "_" ++ atom_to_list(V)));
4848
validate(V, atom, loglevel) -> validate_loglevel(V);
49+
validate(V, atom, instrumentation_loglevel) -> validate_instrumentation_loglevel(V);
4950
validate(V, atom, pool_name) -> validate_non_empty_atom(V);
5051
validate(V, atom, shaper) -> validate_non_empty_atom(V);
5152
validate(V, atom, access_rule) -> validate_non_empty_atom(V);
@@ -64,6 +65,12 @@ validate_section([_|_], non_empty) -> ok;
6465
validate_section(L, any) when is_list(L) -> ok.
6566

6667
%% validators
68+
%%
69+
validate_instrumentation_loglevel(none) ->
70+
error(#{what => validate_instrumentation_loglevel_failed,
71+
value => none});
72+
validate_instrumentation_loglevel(Level) ->
73+
validate_loglevel(Level).
6774

6875
validate_loglevel(Level) ->
6976
mongoose_logs:loglevel_keyword_to_number(Level).

Diff for: src/instrument/mongoose_instrument_log.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
-spec config_spec() -> mongoose_config_spec:config_section().
1111
config_spec() ->
12-
#section{items = #{<<"level">> => #option{type = atom, validate = loglevel}},
12+
#section{items = #{<<"level">> => #option{type = atom, validate = instrumentation_loglevel}},
1313
defaults = #{<<"level">> => debug}}.
1414

1515
-spec set_up(mongoose_instrument:event_name(), mongoose_instrument:labels(),

Diff for: test/config_parser_SUITE.erl

+1
Original file line numberDiff line numberDiff line change
@@ -2961,6 +2961,7 @@ instrumentation_log(_Config) ->
29612961
T = fun(Opts) -> #{<<"instrumentation">> => #{<<"log">> => Opts}} end,
29622962
?cfg(P, default_config(P), T(#{})),
29632963
?cfg(P ++ [level], info, T(#{<<"level">> => <<"info">>})),
2964+
?err(T(#{<<"level">> => <<"none">>})),
29642965
?err(T(#{<<"level">> => <<"insane">>})).
29652966

29662967
instrumentation_exometer(_Config) ->

0 commit comments

Comments
 (0)