Skip to content

Conversation

@samjewell
Copy link

  1. Use logfmt when logging, and include Url:
    See https://brandur.org/logfmt
    Fixes Feature-request: Logs, including "Result URL" #79

  2. Use asctime for logging timestamps

  3. Add .venv to gitignore

  4. Also log Unix time …
    This allows us to configure Promtail with:

scrape_configs:
- job_name: [name]
  pipeline_stages:
  - timestamp:
      source: time
      format: Unix
  static_configs:
  - targets:
      - localhost
    labels:
      job: [name]
      …

In order to set the timestamp of the log-line to the exact time that the
speedtest was completed, rather than the time that Promtail scraped the
record (which could be later, if Promtail was booted a few mins after
the exporter and Prometheus were booted).

This allows us to configure Promtail with:
```
scrape_configs:
- job_name: [name]
  pipeline_stages:
  - timestamp:
      source: time
      format: Unix
  static_configs:
  - targets:
      - localhost
    labels:
      job: [name]
      …
```
In order to set the timestamp of the log-line to the exact time that the
speedtest was completed, rather than the time that Promtail scraped the
record (which could be later, if Promtail was booted a few mins after
the exporter and Prometheus were booted).
@samjewell samjewell force-pushed the sj/log-url-and-unix-time-and-use-logfmt branch from d305824 to 2a673a2 Compare July 2, 2021 14:57
@samjewell samjewell marked this pull request as draft July 14, 2021 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature-request: Logs, including "Result URL"

1 participant