Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduces telemetry sent #1237

Merged
merged 2 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion hamilton/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
CLI_COMMAND = "os_hamilton_cli_command"
EXPERIMENT_SERVER = "os_hamilton_experiment_server"
TIMEOUT = 2
MAX_COUNT_SESSION = 100 # max number of events collected per python process
MAX_COUNT_SESSION = 10 # max number of events collected per python process
DEFAULT_CONFIG_URI = os.environ.get("HAMILTON_CONFIG_URI", "~/.hamilton.conf")
DEFAULT_CONFIG_LOCATION = os.path.expanduser(DEFAULT_CONFIG_URI)

Expand Down Expand Up @@ -155,6 +155,7 @@ def is_telemetry_enabled() -> bool:
"distinct_id": g_anonymous_id,
"hamilton_version": list(VERSION),
"telemetry_version": "0.0.1",
"$process_person_profile": False,
}


Expand Down
5 changes: 4 additions & 1 deletion tests/test_hamilton_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pandas as pd
import pytest

from hamilton import base, node
from hamilton import base, node, telemetry
from hamilton.caching.adapter import HamiltonCacheAdapter
from hamilton.driver import (
Builder,
Expand All @@ -25,6 +25,8 @@
import tests.resources.test_for_materialization
import tests.resources.very_simple_dag

telemetry.MAX_COUNT_SESSION = 100
skrawcz marked this conversation as resolved.
Show resolved Hide resolved

"""This file tests driver capabilities.
Anything involving execution is tested for multiple executors/driver configuration.
Anything not involving execution is tested for just the single driver configuration.
Expand Down Expand Up @@ -235,6 +237,7 @@ def test_capture_constructor_telemetry(send_event_json):
assert actual_event_dict["event"] == "os_hamilton_run_start"
# validate schema
expected_properties = {
"$process_person_profile",
"os_type",
"os_version",
"python_version",
Expand Down
2 changes: 2 additions & 0 deletions tests/test_telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
from hamilton import async_driver, base, node, telemetry
from hamilton.lifecycle import base as lifecycle_base

telemetry.MAX_COUNT_SESSION = 100


@pytest.fixture
def blank_conf_file(tmp_path_factory):
Expand Down