Skip to content

Commit

Permalink
Tweaks docs on sdk constants
Browse files Browse the repository at this point in the history
  • Loading branch information
skrawcz committed Nov 18, 2024
1 parent ff484f5 commit c9a855b
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions docs/hamilton-ui/ui.rst
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,35 @@ SDK Configuration
------------------
This section documents HamiltonTracker configuration options.

Changing where data is sent
----------------------------
You can change where telemetry is logged by passing in `hamilton_api_url` and/or `hamilton_ui_url` to the
HamiltonTracker constructor. By default, these are set to `localhost:8241/8242`.

.. code-block:: python
from hamilton_sdk import adapters
tracker = adapters.HamiltonTracker(
project_id=PROJECT_ID_FROM_ABOVE,
username="USERNAME/EMAIL_YOU_PUT_IN_THE_UI",
dag_name="my_version_of_the_dag",
tags={"environment": "DEV", "team": "MY_TEAM", "version": "X"},
hamilton_api_url="http://YOUR_DOMAIN_HERE:8241",
hamilton_ui_url="http://YOUR_DOMAIN_HERE:8242" # if using docker the UI is on 8242.
)
dr = (
driver.Builder()
.with_config(your_config)
.with_modules(*your_modules)
.with_adapters(tracker)
.build()
)
Changing behavior of what is captured
-------------------------------------
By default, a lot is captured and sent to the Hamilton UI.

Here are a few options that can change that - these can be found
Expand Down Expand Up @@ -276,13 +305,15 @@ To change the defaults via a config file, you can do the following:
To change the defaults via environment variables, you can do the following, prefixing them with `HAMILTON_`:

.. code-block:: bash
export HAMILTON_MAX_LIST_LENGTH_CAPTURE=100
export HAMILTON_MAX_DICT_LENGTH_CAPTURE=200
python run_my_hamilton_code.py
To change the defaults directly, you can do the following:

.. code-block:: python
from hamilton_sdk.tracking import constants
Expand All @@ -304,6 +335,7 @@ To change the defaults directly, you can do the following:
.with_adapters(tracker)
.build()
)
dr.execute(...)
In terms of precedence, the order is:

Expand Down

0 comments on commit c9a855b

Please sign in to comment.