Skip to content

Conversation

@vinikatyal
Copy link
Contributor

@vinikatyal vinikatyal commented May 26, 2025

Description

  • Pass to Azure Insights - Metrics
  • Settings are hard coded and can be removed by the user
  • CLI commands are tracked , along with a random uuid
  • pass export DISABLE_COMPLIANT_LLM_TELEMETRY=true to disable

Screenshots/Results

Screenshot 2025-05-28 at 9 08 48 PM

Reference Links

  • Links to JIRA issue, links, Slack discussions, etc.

Checklist

This PR includes the following (tick all that apply):

  • Tests added/updated for new/changed functionality
  • Bug Fix (explain the bug in the description)
  • Refactoring or optimizations (no functional changes)
  • Documentation updated (README, docstrings, etc.)
  • Build or deployment related changes
  • Dependency updates (requirements.txt/pyproject.toml)
  • Setup change (update README/setup instructions if required)
  • Code style checks passed (PEP8, flake8, black, etc.)
  • Type hints added/updated (if applicable)
  • Pre-commit hooks run (if configured)

@vinikatyal vinikatyal changed the title chore: starting metrics work chore: starting metrics work [WIP] May 26, 2025
@vinikatyal vinikatyal changed the title chore: starting metrics work [WIP] chore: Metrics , tracks commands , errors for now May 27, 2025
from opentelemetry.metrics import set_meter_provider, get_meter_provider
from opentelemetry.sdk.metrics.export import (
PeriodicExportingMetricReader,
ConsoleMetricExporter
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kaushik-himself main code

@kaushik-himself
Copy link
Contributor

Pass to Azure Telemetry , which can be removed by user

Please add a better description and title.

The title + description should clearly and succinctly convey what the PR is doing to anyone: not just the team, but any viewer on the Internet who looks through our history,


def get_client_id() -> str:
"""Retrieve or create a unique, anonymous client ID for this user."""
path = os.path.join(os.path.expanduser("~"), ".compliant-llm", ".client-id")
Copy link
Contributor

Choose a reason for hiding this comment

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

os.path.expanduser("~"): this will probably not work across platforms.

please look into Path.home()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2025-05-28 at 9 05 47 PM

Updated

logger.info("✅ Azure Monitor traces initialized.")
except Exception as e:
logger.error(f"❌ Failed to initialize tracing: {e}")
print(f"❌ Failed to initialize tracing: {e}")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: remove print

@vinikatyal vinikatyal merged commit 0bd0566 into main May 28, 2025
3 checks passed
@vinikatyal vinikatyal deleted the vk/metrics branch May 28, 2025 16:48
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.

4 participants