# `Tlm.Config`

Where events go and what they say about the app. Everything has a
default, the DSN included: set `TLM_DSN` in the environment, or
configure it yourself:

    config :tlm, dsn: System.get_env("MY_TLM_DSN")

The DSN, from the project's setup page in Tlm, is where Tlm
runs plus the project's key, in one URL:
`https://tlm_…@tlm.hullop.com`. A port and a path are fine too
(`http://tlm_…@localhost:4000`, `https://tlm_…@example.com/tlm`).

Options:

  * `:dsn` — defaults to the `TLM_DSN` environment variable.
    Without a DSN or a key nothing is sent, which keeps dev and test
    quiet.
  * `:key` and `:endpoint` — the two halves of a DSN, for when you'd
    rather set them apart. The key defaults to `TLM_KEY`, the
    endpoint to `https://tlm.hullop.com`. A DSN wins over both.
  * `:environment` — defaults to the Mix environment the app was built
    in (`prod` in a release).
  * `:release` — defaults to the release version (`RELEASE_VSN`).
  * `:in_app` — the applications whose code is "yours". Defaults to the
    root applications: those no other loaded application depends on.

# `get`

The current settings, read from the application environment.

# `in_app?`

Whether `module` belongs to the app itself rather than a dependency.

# `invalid_dsn?`

Whether a DSN is configured but can't be parsed.

# `parse_dsn`

Splits a DSN into the key and the endpoint, or says why it can't.

    iex> Tlm.Config.parse_dsn("https://tlm_abc@example.com:8443/tlm/")
    {:ok, "tlm_abc", "https://example.com:8443/tlm"}

---

*Consult [api-reference.md](api-reference.md) for complete listing*
