Tracelet

otel-test init

Write the starter project into a directory.

Usage: otel-test init [OPTIONS] [DIR]

Arguments:
  [DIR]  [default: .]

Options:
      --force

Writes five files into DIR, creating directories as needed:

FileContents
otel-test.yamlThree tests
collector.yamlA Collector config that deletes passwords, hashes user.name and drops /healthz spans
fixtures/login-span.jsonPOST /login span with password and user.name
fixtures/login-log.jsonLog record with password, user.name and client.address
fixtures/healthz-span.jsonGET /healthz span

These are identical to examples/password-redaction. init doesn't need the Collector and doesn't download anything.

Examples

otel-test init
otel-test v0.1.0

  created ./otel-test.yaml
  created ./collector.yaml
  created ./fixtures/login-span.json
  created ./fixtures/login-log.json
  created ./fixtures/healthz-span.json

Next: run `otel-test test`

With a directory, the next-step hint includes -f:

otel-test init my-tests
# Next: run `otel-test test -f my-tests/otel-test.yaml`

Existing files

init refuses to overwrite and writes nothing if any of the five files already exists:

error: refusing to overwrite existing files (use --force):
  - ./otel-test.yaml
  - ./collector.yaml
  - ./fixtures/login-span.json
  - ./fixtures/login-log.json
  - ./fixtures/healthz-span.json

That exits with code 2. Pass --force to overwrite them. Other files in the directory are never touched.

On this page