Skip to content
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
10 changes: 10 additions & 0 deletions agentops/client/api/versions/v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from agentops.client.api.types import AuthTokenResponse
from agentops.exceptions import ApiServerException
from agentops.logging import logger
from termcolor import colored


class V3Client(BaseApiClient):
Expand Down Expand Up @@ -47,6 +48,15 @@ def fetch_auth_token(self, api_key: str) -> AuthTokenResponse:
if not token:
raise ApiServerException("No token in authentication response")

# Check project premium status
if jr.get("project_prem_status") != "pro":
logger.info(
colored(
"\x1b[34mYou're on the agentops free plan 🤔\x1b[0m",
"blue",
)
)

return jr
except Exception as e:
logger.error(f"Failed to process authentication response: {str(e)}")
Expand Down
16 changes: 8 additions & 8 deletions agentops/instrumentation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def _uninstrument_providers():
if instrumented_key and instrumented_key in PROVIDERS:
try:
instrumentor.uninstrument()
logger.info(
logger.debug(
f"AgentOps: Uninstrumented provider: {instrumentor.__class__.__name__} (for package '{instrumented_key}') due to agentic library activation."
)
uninstrumented_any = True
Expand Down Expand Up @@ -247,19 +247,19 @@ def _should_instrument_package(package_name: str) -> bool:
if _has_agentic_library:
# An agentic library is already active.
if is_target_agentic:
logger.info(
logger.debug(
f"AgentOps: An agentic library is active. Skipping instrumentation for subsequent agentic library '{package_name}'."
)
return False
if is_target_provider:
logger.info(
logger.debug(
f"AgentOps: An agentic library is active. Skipping instrumentation for provider '{package_name}'."
)
return False
else:
# No agentic library is active yet.
if is_target_agentic:
logger.info(
logger.debug(
f"AgentOps: '{package_name}' is the first-targeted agentic library. Will uninstrument providers if any are/become active."
)
_uninstrument_providers()
Expand Down Expand Up @@ -351,7 +351,7 @@ def _perform_instrumentation(package_name: str):
if concurrent_instrumentor is not None:
concurrent_instrumentor._agentops_instrumented_package_key = "concurrent.futures"
_active_instrumentors.append(concurrent_instrumentor)
logger.info("AgentOps: Instrumented concurrent.futures as a dependency of mem0.")
logger.debug("AgentOps: Instrumented concurrent.futures as a dependency of mem0.")
except Exception as e:
logger.debug(f"Could not instrument concurrent.futures for mem0: {e}")
else:
Expand Down Expand Up @@ -413,7 +413,7 @@ def _import_monitor(name: str, globals_dict=None, locals_dict=None, fromlist=(),
if target_module_obj:
is_sdk = _is_installed_package(target_module_obj, package_to_check)
if not is_sdk:
logger.info(
logger.debug(
f"AgentOps: Target '{package_to_check}' appears to be a local module/directory. Skipping AgentOps SDK instrumentation for it."
)
continue
Expand Down Expand Up @@ -488,7 +488,7 @@ def instrument_one(loader: InstrumentorLoader) -> Optional[BaseInstrumentor]:
"""
if not loader.should_activate:
# This log is important for users to know why something wasn't instrumented.
logger.info(
logger.debug(
f"AgentOps: Package '{loader.package_name or loader.module_name}' not found or version is less than minimum required ('{loader.min_version}'). Skipping instrumentation."
)
return None
Expand All @@ -497,7 +497,7 @@ def instrument_one(loader: InstrumentorLoader) -> Optional[BaseInstrumentor]:
try:
# Use the provider directly from the global tracer instance
instrumentor.instrument(tracer_provider=tracer.provider)
logger.info(
logger.debug(
f"AgentOps: Successfully instrumented '{loader.class_name}' for package '{loader.package_name or loader.module_name}'."
)
except Exception as e:
Expand Down
Loading