Skip to content

Commit 28ad1f9

Browse files
authored
Document new default values for logging (#123)
1 parent 1cf31da commit 28ad1f9

File tree

2 files changed

+26
-22
lines changed

2 files changed

+26
-22
lines changed

content/en/docs/measuring/best-practices.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,16 @@ filesystem. Otherwise it might skew with your measurement as disk-writes can be
117117

118118
On Ubuntu you can use `sudo systemctl enable /usr/share/systemd/tmp.mount`
119119

120-
### 13. Turn logging off
120+
### 13. Manage logging appropriately
121121

122-
Generally logging of either `stdout` or `stderr` through the `log-stdout` and `log-stderr` keys in the `usage_scenario`
123-
should be turned off, because it generally creates overhead.
122+
Logging of either `stdout` or `stderr` through the `log-stdout` and `log-stderr` keys in the `usage_scenario`
123+
is enabled by default in the GMT. In many cases the overhead of logging is small.
124124

125-
You should only have it turned on when you are developing or debugging.
125+
However, you should consider turning logging off when there is extensive logging output, as it can create overhead.
126126

127127
Since the logs will be captured into a memory buffer there is a limit to how much this buffer can hold.
128128
If you really log excessive amounts (100 MB+) then at some point the buffer might get exhausted and either you will
129-
loose data or the run with the GMT will fail.
129+
lose data or the run with the GMT will fail.
130130

131131
### 14. Use `--docker-prune`
132132

content/en/docs/measuring/usage-scenario.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,17 @@ services:
129129
+ Declares the default entrypoint for the service container. This overrides the ENTRYPOINT instruction from the service's Dockerfile.
130130
+ The value of `entrypoint` can either be an empty string (ENTRYPOINT instruction will be ignored) or a single word (helpful to provide a script).
131131
+ If you need an entrypoint that consists of multiple commands/arguments, either provide a script (e.g. `entrypoint.sh`) or set it to an empty string and provide your commands via `command`.
132-
- `log-stdout:` **[boolean]** *(optional)*
133-
+ Will log the *stdout* and make it available through the frontend in the *Logs* tab.
134-
+ Please see the [Best Practices →]({{< relref "best-practices" >}}) for when and how to log.
135-
- `log-stderr:` **[boolean]** *(optional)*
136-
+ Will log the *stderr* and make it available through the frontend in the *Logs* tab and in error messages.
137-
+ Please see the [Best Practices →]({{< relref "best-practices" >}}) for when and how to log.
132+
- `log-stdout:` **[boolean]** *(optional, default: `true`)*
133+
+ Will log the *stdout* of the container and make it available through the frontend in the *Logs* tab.
134+
+ Please see the [Best Practices →]({{< relref "best-practices" >}}) for when to disable the logging.
135+
- `log-stderr:` **[boolean]** *(optional, default: `true`)*
136+
+ Will log the *stderr* of the container and make it available through the frontend in the *Logs* tab and in error messages.
137+
+ Please see the [Best Practices →]({{< relref "best-practices" >}}) for when to disable the logging.
138138
- `read-notes-stdout:` **[bool]** *(optional)*
139-
+ Read notes from *stdout*. Most likely you do not need this, as it also requires customization of your application (writing of a log message in a specific format). It may be helpful if your application has asynchronous operations and you want to know when they have finished.
140-
+ Make sure to also set `log-stdout` to `true`. Format specification is documented below in section [Read-notes-stdout format specification →]({{< relref "#read-notes-stdout-format-specification" >}}).
139+
+ Read notes from *stdout* of the container.
140+
+ Most likely you do not need this, as it also requires customization of your application (writing of a log message in a specific format). It may be helpful if your application has asynchronous operations and you want to know when they have finished. In most cases, it is more appropriate to read the notes from the command's *stdout* in your flow (see below).
141+
+ Note that `log-stdout` has to be enabled (it is the default).
142+
+ Format specification is documented below in section [Read-notes-stdout format specification →]({{< relref "#read-notes-stdout-format-specification" >}}).
141143
- `read-sci-stdout:` **[bool]** *(optional)*
142144
+ Enables the reading of ticks for the unit of work (*R*) required to calculate the SCI metric.
143145
+ Please see [Software Carbon Intensity (SCI) →]({{< relref "carbon/sci" >}}) for more information.
@@ -195,7 +197,7 @@ flow:
195197
+ `console` will execute a shell command inside the container
196198
- `command:` **[str]**
197199
+ The command to be executed. If type is `console` then piping or moving to background is not supported.
198-
- `detach:` **[bool]** (optional. default false)
200+
- `detach:` **[bool]** (optional, default: `false`)
199201
+ When the command is detached it will get sent to the background. This allows to run commands in parallel if needed, for instance if you want to stress the DB in parallel with a web request
200202
- `note:` **[str]** *(optional)*
201203
+ A string that will appear as note attached to the datapoint of measurement (optional)
@@ -205,15 +207,17 @@ flow:
205207
- `shell:` **[str]** *(optional)*
206208
+ Will execute the `command` in a shell. Use this if you need shell-mechanics like redirection `>` or chaining `&&`.
207209
+ Please use a string for a shell command here like `sh`, `bash`, `ash` etc. The shell must be available in your container
208-
- `log-stdout:` **[boolean]** *(optional)*
209-
+ Will log the *stdout* and make it available through the frontend in the *Logs* tab.
210-
+ Please see the [Best Practices →]({{< relref "best-practices" >}}) for when and how to log.
211-
- `log-stderr:` **[boolean]** *(optional)*
212-
+ Will log the *stderr* and make it available through the frontend in the *Logs* tab and in error messages.
213-
+ Please see the [Best Practices →]({{< relref "best-practices" >}}) for when and how to log.
210+
- `log-stdout:` **[boolean]** *(optional, default: `true`)*
211+
+ Will log the *stdout* of the command and make it available through the frontend in the *Logs* tab.
212+
+ Please see the [Best Practices →]({{< relref "best-practices" >}}) for when to disable the logging.
213+
- `log-stderr:` **[boolean]** *(optional, default: `true`)*
214+
+ Will log the *stderr* of the command and make it available through the frontend in the *Logs* tab and in error messages.
215+
+ Please see the [Best Practices →]({{< relref "best-practices" >}}) for when to disable the logging.
214216
- `read-notes-stdout:` **[bool]** *(optional)*
215-
+ Read notes from the *stdout* of the command. This is helpful if you have a long running command that does multiple steps and you want to log every step.
216-
+ Make sure to also set `log-stdout` to `true`. Format specification is documented below in section [Read-notes-stdout format specification →]({{< relref "#read-notes-stdout-format-specification" >}}).
217+
+ Read notes from the *stdout* of the command.
218+
+ This is helpful if you have a long running command that does multiple steps and you want to log every step.
219+
+ Note that `log-stdout` has to be enabled (it is the default).
220+
+ Format specification is documented below in section [Read-notes-stdout format specification →]({{< relref "#read-notes-stdout-format-specification" >}}).
217221
- `read-sci-stdout:` **[bool]** *(optional)*
218222
+ Enables the reading of ticks for the unit of work (*R*) required to calculate the SCI metric.
219223
+ Please see [Software Carbon Intensity (SCI) →]({{< relref "carbon/sci" >}}) for more information.

0 commit comments

Comments
 (0)