Skip to content

Conversation

@bmehta001
Copy link

@bmehta001 bmehta001 commented Feb 2, 2026

Add telemetry library and Olive-specific functionality

  • Convert .NET OneCollector library to Python and add to telemetry/library
  • Track actions/errors with telemetry decorator
  • Use heartbeat event to track general usage
  • Add flag to disable telemetry, if desired (--disable-telemetry)
  • Create telemetry cache so events can be sent when network connectivity is convenient
    Nits:
  • Break out version into separate file
  • Remove Python 3.9 from classifiers, since library only supports 3.10+
  • Update minimum onnxscript version needed, since FOLDED_FROM_KEY requires 0.5.3

Description of change for release notes:

Add telemetry to help improve our products and services

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all tests can pass.
  • Update documents if necessary.
  • Lint and apply fixes to your code by running lintrunner -a
  • Is this a user-facing change? If yes, give a description of this change to be included in the release notes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Some of the functions like _build_path, retrieve_id, etc. can be marked as property.

Comment on lines +85 to +91
def item_count(self) -> int:
"""Get the number of items in the current payload."""
return len(self.items)

def is_empty(self) -> bool:
"""Check if the payload is empty."""
return len(self.items) == 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mark these with @Property

Comment on lines +42 to +48
def is_informational_logging_enabled(self) -> bool:
"""Check if informational level logging is enabled."""
return self.logger.isEnabledFor(logging.INFO)

def is_error_logging_enabled(self) -> bool:
"""Check if error level logging is enabled."""
return self.logger.isEnabledFor(logging.ERROR)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mark these with @Property

ORT_SUPPORT_DIR = r"Microsoft/DeveloperTools/.onnxruntime"


def get_telemetry_base_dir() -> Path:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it a property and also mark it with @functools.lru_cache(maxsize=1)



def get_telemetry_base_dir() -> Path:
os_name = platform.system()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth adding a way for user to override this path with a known/defined environment variable OLIVE_TELEMETRY_CACHE_PATH or something. Permissions might be a problem sometimes in default folders.

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.

2 participants