monocle-apptrace 0.4.0b2__tar.gz → 0.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/.gitignore +6 -1
- monocle_apptrace-0.7.0/PKG-INFO +122 -0
- monocle_apptrace-0.7.0/README.md +28 -0
- monocle_apptrace-0.7.0/pyproject.toml +200 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/__main__.py +1 -1
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/exporters/aws/s3_exporter.py +99 -41
- monocle_apptrace-0.7.0/src/monocle_apptrace/exporters/azure/blob_exporter.py +208 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/exporters/base_exporter.py +10 -1
- monocle_apptrace-0.7.0/src/monocle_apptrace/exporters/file_exporter.py +195 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/exporters/okahu/okahu_exporter.py +1 -15
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/__init__.py +2 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/common/__init__.py +20 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/common/constants.py +229 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/common/instrumentor.py +20 -153
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/common/method_wrappers.py +265 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/common/scope_wrapper.py +141 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/common/span_handler.py +163 -53
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/common/utils.py +252 -27
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/common/wrapper.py +484 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/common/wrapper_method.py +152 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/a2a/_helper.py +37 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/a2a/entities/inference.py +114 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/a2a/methods.py +22 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/adk/_helper.py +219 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/adk/adk_handler.py +27 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/adk/entities/agent.py +158 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/adk/entities/tool.py +64 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/adk/methods.py +33 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/agents/_helper.py +226 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/agents/agents_processor.py +156 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/agents/entities/inference.py +225 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/agents/methods.py +48 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/aiohttp/_helper.py +28 -18
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/aiohttp/entities/http.py +63 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/anthropic/_helper.py +236 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/anthropic/entities/inference.py +34 -4
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/azfunc/_helper.py +90 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/azfunc/entities/http.py +62 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/azfunc/methods.py +23 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/azfunc/wrapper.py +23 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/azureaiinference/__init__.py +1 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/azureaiinference/_helper.py +352 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/azureaiinference/entities/inference.py +237 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/azureaiinference/methods.py +23 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/botocore/_helper.py +260 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/botocore/entities/inference.py +36 -4
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/botocore/handlers/botocore_span_handler.py +1 -1
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/crew_ai/_helper.py +260 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/crew_ai/crew_ai_processor.py +72 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/crew_ai/entities/inference.py +179 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/crew_ai/methods.py +70 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/fastapi/_helper.py +95 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/fastapi/entities/http.py +49 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/fastapi/methods.py +23 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/fastmcp/_helper.py +261 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/fastmcp/entities/prompts.py +96 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/fastmcp/entities/resources.py +97 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/fastmcp/entities/tools.py +97 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/fastmcp/methods.py +56 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/finish_types.py +513 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/flask/_helper.py +29 -20
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/flask/entities/http.py +9 -3
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/gemini/_helper.py +179 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/gemini/entities/inference.py +102 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/gemini/entities/retrieval.py +44 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/gemini/methods.py +31 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/haystack/_helper.py +282 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/haystack/entities/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/haystack/entities/inference.py +34 -6
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/haystack/entities/retrieval.py +2 -1
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/haystack/methods.py +7 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/hugging_face/__init__.py +0 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/hugging_face/_helper.py +138 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/hugging_face/entities/__init__.py +0 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/hugging_face/entities/inference.py +94 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/hugging_face/methods.py +23 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/lambdafunc/_helper.py +89 -0
- {monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/aiohttp → monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/lambdafunc}/entities/http.py +11 -5
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/lambdafunc/methods.py +23 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/lambdafunc/wrapper.py +23 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/langchain/__init__.py +0 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/langchain/_helper.py +318 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/langchain/entities/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/langchain/entities/inference.py +35 -6
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/langchain/entities/retrieval.py +2 -1
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/langchain/methods.py +2 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/langgraph/__init__.py +0 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/langgraph/_helper.py +177 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/langgraph/entities/__init__.py +0 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/langgraph/entities/inference.py +184 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/langgraph/langgraph_processor.py +122 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/langgraph/methods.py +58 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/litellm/__init__.py +0 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/litellm/_helper.py +176 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/litellm/entities/__init__.py +0 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/litellm/entities/inference.py +135 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/litellm/methods.py +19 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/llamaindex/__init__.py +0 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/llamaindex/_helper.py +488 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/llamaindex/entities/__init__.py +0 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/llamaindex/entities/agent.py +170 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/llamaindex/entities/inference.py +33 -4
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/llamaindex/entities/retrieval.py +2 -1
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/llamaindex/llamaindex_processor.py +76 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/llamaindex/methods.py +63 -2
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/mcp/__init__.py +0 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/mcp/_helper.py +120 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/mcp/entities/__init__.py +0 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/mcp/entities/inference.py +55 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/mcp/mcp_processor.py +8 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/mcp/methods.py +21 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/mistral/__init__.py +0 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/mistral/_helper.py +293 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/mistral/entities/__init__.py +0 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/mistral/entities/inference.py +105 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/mistral/entities/retrieval.py +41 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/mistral/methods.py +50 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/openai/__init__.py +0 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/openai/_helper.py +392 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/openai/entities/__init__.py +0 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/openai/entities/inference.py +317 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/openai/entities/retrieval.py +1 -1
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/openai/methods.py +1 -1
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/openai/openai_processor.py +81 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/requests/entities/http.py +2 -1
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/strands/_helper.py +71 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/strands/entities/agent.py +179 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/strands/entities/tool.py +62 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/strands/methods.py +21 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/strands/strands_processor.py +22 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/teamsai/__init__.py +0 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/teamsai/_helper.py +184 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/teamsai/entities/__init__.py +0 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/teamsai/entities/inference/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/teamsai/entities/inference/actionplanner_output_processor.py +32 -12
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/teamsai/entities/inference/teamsai_output_processor.py +17 -10
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/teamsai/methods.py +73 -0
- monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/teamsai/sample.json +444 -0
- monocle_apptrace-0.4.0b2/CHANGELOG.md +0 -105
- monocle_apptrace-0.4.0b2/CODEOWNERS.md +0 -10
- monocle_apptrace-0.4.0b2/CODE_OF_CONDUCT.md +0 -3
- monocle_apptrace-0.4.0b2/CONTRIBUTING.md +0 -28
- monocle_apptrace-0.4.0b2/COPYRIGHT.template +0 -2
- monocle_apptrace-0.4.0b2/MAINTAINER.md +0 -10
- monocle_apptrace-0.4.0b2/Monocle_User_Guide.md +0 -193
- monocle_apptrace-0.4.0b2/Monocle_committer_guide.md +0 -56
- monocle_apptrace-0.4.0b2/Monocle_contributor_guide.md +0 -1
- monocle_apptrace-0.4.0b2/NOTICE +0 -4
- monocle_apptrace-0.4.0b2/PKG-INFO +0 -134
- monocle_apptrace-0.4.0b2/README.md +0 -76
- monocle_apptrace-0.4.0b2/SECURITY.md +0 -9
- monocle_apptrace-0.4.0b2/pyproject.toml +0 -119
- monocle_apptrace-0.4.0b2/src/monocle_apptrace/exporters/azure/blob_exporter.py +0 -146
- monocle_apptrace-0.4.0b2/src/monocle_apptrace/exporters/file_exporter.py +0 -94
- monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/__init__.py +0 -1
- monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/common/__init__.py +0 -2
- monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/common/constants.py +0 -81
- monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/common/wrapper.py +0 -267
- monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/common/wrapper_method.py +0 -82
- monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/anthropic/_helper.py +0 -64
- monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/botocore/_helper.py +0 -95
- monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/haystack/_helper.py +0 -140
- monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/langchain/_helper.py +0 -135
- monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/langgraph/_helper.py +0 -48
- monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/langgraph/entities/inference.py +0 -56
- monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/langgraph/methods.py +0 -14
- monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/llamaindex/_helper.py +0 -176
- monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/llamaindex/entities/agent.py +0 -47
- monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/openai/_helper.py +0 -125
- monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/openai/entities/inference.py +0 -219
- monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/teamsai/_helper.py +0 -108
- monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/teamsai/methods.py +0 -60
- monocle_apptrace-0.4.0b2/tox.ini +0 -33
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/LICENSE +0 -0
- {monocle_apptrace-0.4.0b2/src/monocle_apptrace → monocle_apptrace-0.7.0/src}/README.md +0 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/exporters/aws/s3_exporter_opendal.py +0 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/exporters/azure/blob_exporter_opendal.py +0 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/exporters/exporter_processor.py +0 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/exporters/monocle_exporters.py +0 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/common/tracing.md +0 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/aiohttp → monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/a2a}/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/anthropic → monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/a2a/entities}/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/anthropic/entities → monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/adk}/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/botocore → monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/agents}/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/botocore → monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/agents}/entities/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/flask → monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/aiohttp}/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/aiohttp/methods.py +0 -0
- {monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/haystack → monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/anthropic}/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/haystack → monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/anthropic}/entities/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/anthropic/methods.py +0 -0
- {monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/langchain → monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/botocore}/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/langchain → monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/botocore}/entities/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/botocore/methods.py +0 -0
- {monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/langgraph → monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/crew_ai}/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/langgraph → monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/crew_ai}/entities/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/llamaindex → monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/fastapi}/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/llamaindex → monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/fastapi}/entities/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/openai → monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/fastmcp}/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/openai/entities → monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/flask}/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/flask/methods.py +0 -0
- {monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/teamsai → monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/gemini}/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/teamsai → monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/gemini}/entities/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2/src/monocle_apptrace/instrumentation/metamodel/teamsai/entities/inference → monocle_apptrace-0.7.0/src/monocle_apptrace/instrumentation/metamodel/haystack}/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/requests/__init__.py +0 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/requests/_helper.py +0 -0
- {monocle_apptrace-0.4.0b2 → monocle_apptrace-0.7.0}/src/monocle_apptrace/instrumentation/metamodel/requests/methods.py +0 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: monocle_apptrace
|
|
3
|
+
Version: 0.7.0
|
|
4
|
+
Summary: package with monocle genAI tracing
|
|
5
|
+
Project-URL: Homepage, https://github.com/monocle2ai/monocle
|
|
6
|
+
Project-URL: Issues, https://github.com/monocle2ai/monocle/issues
|
|
7
|
+
Author-email: "Okahu Inc." <okahu-pypi@okahu.ai>
|
|
8
|
+
License: Apache-2.0
|
|
9
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Requires-Python: >=3.8
|
|
13
|
+
Requires-Dist: opentelemetry-api>=1.21.0
|
|
14
|
+
Requires-Dist: opentelemetry-instrumentation
|
|
15
|
+
Requires-Dist: opentelemetry-sdk>=1.21.0
|
|
16
|
+
Requires-Dist: requests
|
|
17
|
+
Requires-Dist: rfc3986>=2.0.0
|
|
18
|
+
Requires-Dist: wrapt>=1.14.0
|
|
19
|
+
Provides-Extra: ai-test
|
|
20
|
+
Requires-Dist: bert-score; extra == 'ai-test'
|
|
21
|
+
Requires-Dist: transformers; extra == 'ai-test'
|
|
22
|
+
Provides-Extra: aws
|
|
23
|
+
Requires-Dist: boto3==1.37.24; extra == 'aws'
|
|
24
|
+
Provides-Extra: azure
|
|
25
|
+
Requires-Dist: azure-ai-inference; extra == 'azure'
|
|
26
|
+
Requires-Dist: azure-storage-blob==12.22.0; extra == 'azure'
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: a2a-sdk==0.3.6; extra == 'dev'
|
|
29
|
+
Requires-Dist: anthropic-haystack; extra == 'dev'
|
|
30
|
+
Requires-Dist: anthropic==0.57.1; extra == 'dev'
|
|
31
|
+
Requires-Dist: azure-storage-blob==12.22.0; extra == 'dev'
|
|
32
|
+
Requires-Dist: boto3==1.39.0; extra == 'dev'
|
|
33
|
+
Requires-Dist: chromadb==1.0.15; extra == 'dev'
|
|
34
|
+
Requires-Dist: click==8.2.1; extra == 'dev'
|
|
35
|
+
Requires-Dist: crewai==0.95.0; extra == 'dev'
|
|
36
|
+
Requires-Dist: datasets==4.3.0; extra == 'dev'
|
|
37
|
+
Requires-Dist: faiss-cpu==1.8.0; extra == 'dev'
|
|
38
|
+
Requires-Dist: fastapi>=0.115.0; extra == 'dev'
|
|
39
|
+
Requires-Dist: flask; extra == 'dev'
|
|
40
|
+
Requires-Dist: google-adk==1.10.0; extra == 'dev'
|
|
41
|
+
Requires-Dist: google-ai-haystack; extra == 'dev'
|
|
42
|
+
Requires-Dist: google-generativeai==0.8.5; extra == 'dev'
|
|
43
|
+
Requires-Dist: haystack-ai==2.3.0; extra == 'dev'
|
|
44
|
+
Requires-Dist: httpx==0.28.1; extra == 'dev'
|
|
45
|
+
Requires-Dist: huggingface-hub==0.35.3; extra == 'dev'
|
|
46
|
+
Requires-Dist: instructorembedding==1.0.1; extra == 'dev'
|
|
47
|
+
Requires-Dist: langchain-anthropic==0.3.13; extra == 'dev'
|
|
48
|
+
Requires-Dist: langchain-aws==0.2.23; extra == 'dev'
|
|
49
|
+
Requires-Dist: langchain-chroma==0.2.4; extra == 'dev'
|
|
50
|
+
Requires-Dist: langchain-community==0.3.24; extra == 'dev'
|
|
51
|
+
Requires-Dist: langchain-google-genai==2.0.10; extra == 'dev'
|
|
52
|
+
Requires-Dist: langchain-mcp-adapters==0.1.8; extra == 'dev'
|
|
53
|
+
Requires-Dist: langchain-mistralai==0.2.10; extra == 'dev'
|
|
54
|
+
Requires-Dist: langchain-openai==0.3.18; extra == 'dev'
|
|
55
|
+
Requires-Dist: langchain==0.3.25; extra == 'dev'
|
|
56
|
+
Requires-Dist: langchainhub==0.1.21; extra == 'dev'
|
|
57
|
+
Requires-Dist: langgraph-supervisor==0.0.28; extra == 'dev'
|
|
58
|
+
Requires-Dist: langgraph==0.5.4; extra == 'dev'
|
|
59
|
+
Requires-Dist: litellm==1.77.5; extra == 'dev'
|
|
60
|
+
Requires-Dist: llama-index-embeddings-huggingface==0.6.0; extra == 'dev'
|
|
61
|
+
Requires-Dist: llama-index-llms-anthropic==0.8.1; extra == 'dev'
|
|
62
|
+
Requires-Dist: llama-index-llms-azure-openai==0.4.0; extra == 'dev'
|
|
63
|
+
Requires-Dist: llama-index-llms-mistralai==0.7.0; extra == 'dev'
|
|
64
|
+
Requires-Dist: llama-index-llms-openai==0.5.0; extra == 'dev'
|
|
65
|
+
Requires-Dist: llama-index-tools-mcp==0.3.0; extra == 'dev'
|
|
66
|
+
Requires-Dist: llama-index-vector-stores-chroma==0.5.0; extra == 'dev'
|
|
67
|
+
Requires-Dist: llama-index-vector-stores-opensearch==0.6.0; extra == 'dev'
|
|
68
|
+
Requires-Dist: llama-index==0.13.0; extra == 'dev'
|
|
69
|
+
Requires-Dist: mcp==1.12.1; extra == 'dev'
|
|
70
|
+
Requires-Dist: mistral-haystack==0.0.2; extra == 'dev'
|
|
71
|
+
Requires-Dist: mistralai==1.9.9; extra == 'dev'
|
|
72
|
+
Requires-Dist: numpy==1.26.4; extra == 'dev'
|
|
73
|
+
Requires-Dist: openai-agents==0.2.6; extra == 'dev'
|
|
74
|
+
Requires-Dist: opendal==0.45.14; extra == 'dev'
|
|
75
|
+
Requires-Dist: opensearch-haystack==1.2.0; extra == 'dev'
|
|
76
|
+
Requires-Dist: opentelemetry-instrumentation-flask; extra == 'dev'
|
|
77
|
+
Requires-Dist: parameterized==0.9.0; extra == 'dev'
|
|
78
|
+
Requires-Dist: pydantic==2.11.7; extra == 'dev'
|
|
79
|
+
Requires-Dist: pytest-asyncio==0.26.0; extra == 'dev'
|
|
80
|
+
Requires-Dist: pytest-venv; extra == 'dev'
|
|
81
|
+
Requires-Dist: pytest==8.3.5; extra == 'dev'
|
|
82
|
+
Requires-Dist: python-dotenv>=1.1.0; extra == 'dev'
|
|
83
|
+
Requires-Dist: requests-aws4auth==1.2.3; extra == 'dev'
|
|
84
|
+
Requires-Dist: types-requests==2.31.0.20240106; extra == 'dev'
|
|
85
|
+
Requires-Dist: uvicorn==0.35.0; extra == 'dev'
|
|
86
|
+
Provides-Extra: dev-gemini
|
|
87
|
+
Requires-Dist: llama-index-llms-gemini==0.6.0; extra == 'dev-gemini'
|
|
88
|
+
Provides-Extra: dev-strands
|
|
89
|
+
Requires-Dist: strands-agents-tools==0.2.10; extra == 'dev-strands'
|
|
90
|
+
Requires-Dist: strands-agents==1.11.0; extra == 'dev-strands'
|
|
91
|
+
Provides-Extra: dev-tranformers
|
|
92
|
+
Requires-Dist: sentence-transformers==3.3.0; extra == 'dev-tranformers'
|
|
93
|
+
Description-Content-Type: text/markdown
|
|
94
|
+
|
|
95
|
+
# Monocle Apptrace
|
|
96
|
+
|
|
97
|
+
**Monocle** helps developers and platform engineers building or managing GenAI apps monitor these in prod by making it easy to instrument their code to capture traces that are compliant with open-source cloud-native observability ecosystem.
|
|
98
|
+
|
|
99
|
+
**Monocle** is a community-driven OSS framework for tracing GenAI app code governed as a [Linux Foundation AI & Data project](https://lfaidata.foundation/projects/monocle/).
|
|
100
|
+
|
|
101
|
+
## Use Monocle
|
|
102
|
+
|
|
103
|
+
- Get the Monocle package
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
pip install monocle_apptrace
|
|
107
|
+
```
|
|
108
|
+
- Instrument your app code
|
|
109
|
+
- Import the Monocle package
|
|
110
|
+
```
|
|
111
|
+
from monocle_apptrace.instrumentor import setup_monocle_telemetry
|
|
112
|
+
```
|
|
113
|
+
- Setup instrumentation in your ```main()``` function
|
|
114
|
+
```
|
|
115
|
+
setup_monocle_telemetry(workflow_name="your-app-name")
|
|
116
|
+
```
|
|
117
|
+
- (Optionally) Modify config to alter where traces are sent
|
|
118
|
+
|
|
119
|
+
See [Monocle user guide](Monocle_User_Guide.md) for more details.
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Monocle Apptrace
|
|
2
|
+
|
|
3
|
+
**Monocle** helps developers and platform engineers building or managing GenAI apps monitor these in prod by making it easy to instrument their code to capture traces that are compliant with open-source cloud-native observability ecosystem.
|
|
4
|
+
|
|
5
|
+
**Monocle** is a community-driven OSS framework for tracing GenAI app code governed as a [Linux Foundation AI & Data project](https://lfaidata.foundation/projects/monocle/).
|
|
6
|
+
|
|
7
|
+
## Use Monocle
|
|
8
|
+
|
|
9
|
+
- Get the Monocle package
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
pip install monocle_apptrace
|
|
13
|
+
```
|
|
14
|
+
- Instrument your app code
|
|
15
|
+
- Import the Monocle package
|
|
16
|
+
```
|
|
17
|
+
from monocle_apptrace.instrumentor import setup_monocle_telemetry
|
|
18
|
+
```
|
|
19
|
+
- Setup instrumentation in your ```main()``` function
|
|
20
|
+
```
|
|
21
|
+
setup_monocle_telemetry(workflow_name="your-app-name")
|
|
22
|
+
```
|
|
23
|
+
- (Optionally) Modify config to alter where traces are sent
|
|
24
|
+
|
|
25
|
+
See [Monocle user guide](Monocle_User_Guide.md) for more details.
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling","hatch-build-scripts"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[[tool.hatch.build.hooks.build-scripts.scripts]]
|
|
6
|
+
commands = [
|
|
7
|
+
"echo 'Running a pre-build step..copying license'",
|
|
8
|
+
"if [ -f \"LICENSE\" ]; then echo \"✅ LICENSE already exists\"; elif [ -f \"../LICENSE\" ]; then cp \"../LICENSE\" \"LICENSE\" && echo \"✅ LICENSE copied from parent\"; else echo \"❌ ERROR: LICENSE not found\" && exit 1; fi"
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
[project]
|
|
12
|
+
name = "monocle_apptrace"
|
|
13
|
+
version = "0.7.0"
|
|
14
|
+
authors = [
|
|
15
|
+
{ name="Okahu Inc.", email="okahu-pypi@okahu.ai" },
|
|
16
|
+
]
|
|
17
|
+
description = "package with monocle genAI tracing"
|
|
18
|
+
readme = "README.md"
|
|
19
|
+
requires-python = ">=3.8"
|
|
20
|
+
license = {text = "Apache-2.0"}
|
|
21
|
+
classifiers = [
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"License :: OSI Approved :: Apache Software License",
|
|
24
|
+
"Operating System :: OS Independent",
|
|
25
|
+
]
|
|
26
|
+
dependencies = [
|
|
27
|
+
'requests',
|
|
28
|
+
'wrapt>=1.14.0',
|
|
29
|
+
'rfc3986>=2.0.0',
|
|
30
|
+
'opentelemetry-api>=1.21.0',
|
|
31
|
+
'opentelemetry-sdk>=1.21.0',
|
|
32
|
+
'opentelemetry-instrumentation',
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[tool.pytest.ini_options]
|
|
36
|
+
log_cli = true
|
|
37
|
+
log_cli_level = "INFO"
|
|
38
|
+
# Enable file logging
|
|
39
|
+
#log_file = "traces.log"
|
|
40
|
+
#log_file_level = "INFO"
|
|
41
|
+
log_format = "%(asctime)s %(levelname)s %(pathname)s:%(lineno)d %(message)s"
|
|
42
|
+
log_date_format = "%Y-%m-%d %H:%M:%S"
|
|
43
|
+
|
|
44
|
+
pythonpath = [
|
|
45
|
+
"src",
|
|
46
|
+
"tests"
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
# Simple ignore patterns - uncomment lines to ignore specific tests
|
|
50
|
+
# Just uncomment the patterns you want to ignore:
|
|
51
|
+
|
|
52
|
+
#ignore = [
|
|
53
|
+
# "tests/integration/", # Ignore ALL integration tests
|
|
54
|
+
# "tests/unit/", # Ignore ALL unit tests
|
|
55
|
+
#]
|
|
56
|
+
|
|
57
|
+
# Or ignore specific test files/patterns:
|
|
58
|
+
#ignore = [
|
|
59
|
+
# "tests/integration/test_langchain_bedrock_sample.py",
|
|
60
|
+
# "tests/integration/test_anthropic_*.py",
|
|
61
|
+
# "tests/integration/test_azure_*.py",
|
|
62
|
+
# "tests/integration/test_openai_*.py",
|
|
63
|
+
# "tests/unit/*_processor_test.py",
|
|
64
|
+
#]
|
|
65
|
+
|
|
66
|
+
# Test discovery patterns
|
|
67
|
+
testpaths = [
|
|
68
|
+
"tests"
|
|
69
|
+
]
|
|
70
|
+
|
|
71
|
+
[project.optional-dependencies]
|
|
72
|
+
ai_test = [
|
|
73
|
+
'bert-score',
|
|
74
|
+
'transformers'
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
dev = [
|
|
78
|
+
'langchain-openai==0.3.18',
|
|
79
|
+
'langchain-chroma==0.2.4',
|
|
80
|
+
'langchain-community==0.3.24',
|
|
81
|
+
'langchain==0.3.25',
|
|
82
|
+
'datasets==4.3.0',
|
|
83
|
+
'numpy==1.26.4',
|
|
84
|
+
'types-requests==2.31.0.20240106',
|
|
85
|
+
'InstructorEmbedding==1.0.1',
|
|
86
|
+
'faiss-cpu==1.8.0',
|
|
87
|
+
'pytest==8.3.5',
|
|
88
|
+
'pytest-venv',
|
|
89
|
+
'llama-index==0.13.0',
|
|
90
|
+
'llama-index-llms-openai==0.5.0',
|
|
91
|
+
'llama-index-tools-mcp==0.3.0',
|
|
92
|
+
'llama-index-embeddings-huggingface==0.6.0',
|
|
93
|
+
'llama-index-vector-stores-chroma==0.5.0',
|
|
94
|
+
'parameterized==0.9.0',
|
|
95
|
+
'llama-index-llms-mistralai==0.7.0',
|
|
96
|
+
'langchain-mistralai==0.2.10',
|
|
97
|
+
'mistral-haystack==0.0.2',
|
|
98
|
+
'langchain-aws==0.2.23',
|
|
99
|
+
'azure-storage-blob==12.22.0', # this is for blob exporter
|
|
100
|
+
'boto3==1.39.0', # this is for aws exporter
|
|
101
|
+
'llama-index-vector-stores-opensearch==0.6.0',
|
|
102
|
+
'haystack-ai==2.3.0',
|
|
103
|
+
'llama-index-llms-azure-openai==0.4.0',
|
|
104
|
+
'requests-aws4auth==1.2.3',
|
|
105
|
+
'opensearch-haystack==1.2.0',
|
|
106
|
+
'langchainhub==0.1.21',
|
|
107
|
+
'chromadb==1.0.15',
|
|
108
|
+
'flask',
|
|
109
|
+
'opentelemetry-instrumentation-flask',
|
|
110
|
+
'langgraph==0.5.4',
|
|
111
|
+
'langgraph-supervisor==0.0.28',
|
|
112
|
+
'opendal==0.45.14',
|
|
113
|
+
'anthropic==0.57.1',
|
|
114
|
+
'anthropic-haystack',
|
|
115
|
+
'pytest-asyncio==0.26.0',
|
|
116
|
+
'llama-index-llms-anthropic==0.8.1',
|
|
117
|
+
'langchain-anthropic==0.3.13',
|
|
118
|
+
'langchain-mcp-adapters==0.1.8',
|
|
119
|
+
'mcp==1.12.1',
|
|
120
|
+
'a2a-sdk==0.3.6',
|
|
121
|
+
'httpx==0.28.1',
|
|
122
|
+
'fastapi>=0.115.0',
|
|
123
|
+
'pydantic==2.11.7',
|
|
124
|
+
'uvicorn==0.35.0',
|
|
125
|
+
'click==8.2.1',
|
|
126
|
+
'python-dotenv>=1.1.0',
|
|
127
|
+
'langchain-google-genai==2.0.10',
|
|
128
|
+
'google-adk==1.10.0',
|
|
129
|
+
'google-generativeai==0.8.5',
|
|
130
|
+
'openai-agents==0.2.6',
|
|
131
|
+
'mistralai==1.9.9',
|
|
132
|
+
'huggingface_hub==0.35.3',
|
|
133
|
+
'litellm==1.77.5',
|
|
134
|
+
'google-ai-haystack',
|
|
135
|
+
'crewai==0.95.0'
|
|
136
|
+
]
|
|
137
|
+
|
|
138
|
+
dev_tranformers = [
|
|
139
|
+
'sentence-transformers==3.3.0'
|
|
140
|
+
]
|
|
141
|
+
|
|
142
|
+
dev_gemini = [
|
|
143
|
+
'llama-index-llms-gemini==0.6.0'
|
|
144
|
+
]
|
|
145
|
+
|
|
146
|
+
dev_strands = [
|
|
147
|
+
'strands-agents==1.11.0',
|
|
148
|
+
'strands-agents-tools==0.2.10'
|
|
149
|
+
]
|
|
150
|
+
|
|
151
|
+
azure = [
|
|
152
|
+
'azure-storage-blob==12.22.0',
|
|
153
|
+
'azure-ai-inference'
|
|
154
|
+
]
|
|
155
|
+
|
|
156
|
+
aws = [
|
|
157
|
+
'boto3==1.37.24',
|
|
158
|
+
]
|
|
159
|
+
|
|
160
|
+
[project.urls]
|
|
161
|
+
Homepage = "https://github.com/monocle2ai/monocle"
|
|
162
|
+
Issues = "https://github.com/monocle2ai/monocle/issues"
|
|
163
|
+
|
|
164
|
+
[tool.hatch.build.targets.wheel]
|
|
165
|
+
packages = ["src/monocle_apptrace"]
|
|
166
|
+
|
|
167
|
+
[tool.hatch.build.targets.sdist]
|
|
168
|
+
ignore-vcs = true
|
|
169
|
+
include = [
|
|
170
|
+
"pyproject.toml",
|
|
171
|
+
"README.md",
|
|
172
|
+
"LICENSE",
|
|
173
|
+
"src/**",
|
|
174
|
+
]
|
|
175
|
+
|
|
176
|
+
[tool.hatch.build]
|
|
177
|
+
exclude = [
|
|
178
|
+
"/.*",
|
|
179
|
+
"*.txt",
|
|
180
|
+
"Pipfile",
|
|
181
|
+
"/data",
|
|
182
|
+
"/docs",
|
|
183
|
+
"/tests",
|
|
184
|
+
"*.yml",
|
|
185
|
+
]
|
|
186
|
+
|
|
187
|
+
[tool.pylint]
|
|
188
|
+
max-line-length = 120
|
|
189
|
+
disable = [
|
|
190
|
+
"C0103", # (invalid-name)
|
|
191
|
+
"C0114", # (missing-module-docstring)
|
|
192
|
+
"C0115", # (missing-class-docstring)
|
|
193
|
+
"C0116", # (missing-function-docstring)
|
|
194
|
+
"R0903", # (too-few-public-methods)
|
|
195
|
+
"R0913", # (too-many-arguments)
|
|
196
|
+
"W0105", # (pointless-string-statement)
|
|
197
|
+
]
|
|
198
|
+
|
|
199
|
+
[project.scripts]
|
|
200
|
+
monocle_apptrace = "monocle_apptrace.mcp_server:main"
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import os
|
|
2
|
-
import time
|
|
3
|
-
import random
|
|
4
2
|
import datetime
|
|
5
3
|
import logging
|
|
6
4
|
import asyncio
|
|
@@ -15,12 +13,14 @@ from botocore.exceptions import (
|
|
|
15
13
|
)
|
|
16
14
|
from opentelemetry.sdk.trace import ReadableSpan
|
|
17
15
|
from opentelemetry.sdk.trace.export import SpanExporter, SpanExportResult
|
|
18
|
-
from monocle_apptrace.exporters.base_exporter import SpanExporterBase
|
|
16
|
+
from monocle_apptrace.exporters.base_exporter import SpanExporterBase, format_trace_id_without_0x
|
|
19
17
|
from monocle_apptrace.exporters.exporter_processor import ExportTaskProcessor
|
|
20
|
-
from typing import Sequence, Optional
|
|
18
|
+
from typing import Sequence, Optional, Dict, List, Tuple
|
|
21
19
|
import json
|
|
22
20
|
logger = logging.getLogger(__name__)
|
|
23
21
|
|
|
22
|
+
HANDLE_TIMEOUT_SECONDS = 60
|
|
23
|
+
|
|
24
24
|
class S3SpanExporter(SpanExporterBase):
|
|
25
25
|
def __init__(self, bucket_name=None, region_name=None, task_processor: Optional[ExportTaskProcessor] = None):
|
|
26
26
|
super().__init__()
|
|
@@ -29,6 +29,8 @@ class S3SpanExporter(SpanExporterBase):
|
|
|
29
29
|
DEFAULT_TIME_FORMAT = "%Y-%m-%d__%H.%M.%S"
|
|
30
30
|
self.max_batch_size = 500
|
|
31
31
|
self.export_interval = 1
|
|
32
|
+
# Dictionary to store spans by trace_id: {trace_id: (spans_list, creation_time, has_root_span)}
|
|
33
|
+
self.trace_spans: Dict[int, Tuple[List[ReadableSpan], datetime.datetime, bool]] = {}
|
|
32
34
|
if(os.getenv('MONOCLE_AWS_ACCESS_KEY_ID') and os.getenv('MONOCLE_AWS_SECRET_ACCESS_KEY')):
|
|
33
35
|
self.s3_client = boto3.client(
|
|
34
36
|
's3',
|
|
@@ -46,8 +48,6 @@ class S3SpanExporter(SpanExporterBase):
|
|
|
46
48
|
self.bucket_name = bucket_name or os.getenv('MONOCLE_S3_BUCKET_NAME','default-bucket')
|
|
47
49
|
self.file_prefix = os.getenv('MONOCLE_S3_KEY_PREFIX', DEFAULT_FILE_PREFIX)
|
|
48
50
|
self.time_format = DEFAULT_TIME_FORMAT
|
|
49
|
-
self.export_queue = []
|
|
50
|
-
self.last_export_time = time.time()
|
|
51
51
|
self.task_processor = task_processor
|
|
52
52
|
if self.task_processor is not None:
|
|
53
53
|
self.task_processor.start()
|
|
@@ -92,6 +92,47 @@ class S3SpanExporter(SpanExporterBase):
|
|
|
92
92
|
logger.error(f"Type error while checking bucket existence: {e}")
|
|
93
93
|
raise e
|
|
94
94
|
|
|
95
|
+
def _cleanup_expired_traces(self) -> None:
|
|
96
|
+
"""Upload and remove traces that have exceeded the timeout."""
|
|
97
|
+
current_time = datetime.datetime.now()
|
|
98
|
+
expired_trace_ids = []
|
|
99
|
+
|
|
100
|
+
for trace_id, (spans, creation_time, _) in self.trace_spans.items():
|
|
101
|
+
if (current_time - creation_time).total_seconds() > HANDLE_TIMEOUT_SECONDS:
|
|
102
|
+
expired_trace_ids.append(trace_id)
|
|
103
|
+
|
|
104
|
+
for trace_id in expired_trace_ids:
|
|
105
|
+
self._upload_trace(trace_id)
|
|
106
|
+
|
|
107
|
+
def _add_spans_to_trace(self, trace_id: int, spans: List[ReadableSpan], has_root: bool = False) -> None:
|
|
108
|
+
"""Add spans to a trace buffer, creating it if needed."""
|
|
109
|
+
if trace_id in self.trace_spans:
|
|
110
|
+
existing_spans, creation_time, existing_root = self.trace_spans[trace_id]
|
|
111
|
+
existing_spans.extend(spans)
|
|
112
|
+
has_root = has_root or existing_root
|
|
113
|
+
self.trace_spans[trace_id] = (existing_spans, creation_time, has_root)
|
|
114
|
+
else:
|
|
115
|
+
self.trace_spans[trace_id] = (spans.copy(), datetime.datetime.now(), has_root)
|
|
116
|
+
|
|
117
|
+
def _upload_trace(self, trace_id: int) -> None:
|
|
118
|
+
"""Upload a specific trace to S3 and remove it from the buffer."""
|
|
119
|
+
if trace_id not in self.trace_spans:
|
|
120
|
+
return
|
|
121
|
+
|
|
122
|
+
spans, _, _ = self.trace_spans[trace_id]
|
|
123
|
+
if len(spans) == 0:
|
|
124
|
+
del self.trace_spans[trace_id]
|
|
125
|
+
return
|
|
126
|
+
|
|
127
|
+
serialized_data = self.__serialize_spans(spans)
|
|
128
|
+
if serialized_data:
|
|
129
|
+
try:
|
|
130
|
+
self.__upload_to_s3_with_trace_id(serialized_data, trace_id)
|
|
131
|
+
except Exception as e:
|
|
132
|
+
logger.error(f"Failed to upload trace {format_trace_id_without_0x(trace_id)}: {e}")
|
|
133
|
+
|
|
134
|
+
del self.trace_spans[trace_id]
|
|
135
|
+
|
|
95
136
|
def export(self, spans: Sequence[ReadableSpan]) -> SpanExportResult:
|
|
96
137
|
"""Synchronous export method that internally handles async logic."""
|
|
97
138
|
try:
|
|
@@ -106,18 +147,44 @@ class S3SpanExporter(SpanExporterBase):
|
|
|
106
147
|
async def __export_async(self, spans: Sequence[ReadableSpan]) -> SpanExportResult:
|
|
107
148
|
try:
|
|
108
149
|
logger.info(f"__export_async {len(spans)} spans to S3.")
|
|
109
|
-
|
|
150
|
+
|
|
151
|
+
# Cleanup expired traces first
|
|
152
|
+
self._cleanup_expired_traces()
|
|
153
|
+
|
|
154
|
+
# Group spans by trace_id
|
|
155
|
+
spans_by_trace = {}
|
|
156
|
+
root_span_traces = set()
|
|
157
|
+
|
|
110
158
|
for span in spans:
|
|
111
|
-
self.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
159
|
+
if self.skip_export(span):
|
|
160
|
+
continue
|
|
161
|
+
|
|
162
|
+
trace_id = span.context.trace_id
|
|
163
|
+
if trace_id not in spans_by_trace:
|
|
164
|
+
spans_by_trace[trace_id] = []
|
|
165
|
+
spans_by_trace[trace_id].append(span)
|
|
166
|
+
|
|
167
|
+
# Check if this span is a root span (no parent)
|
|
168
|
+
if not span.parent:
|
|
169
|
+
root_span_traces.add(trace_id)
|
|
170
|
+
|
|
171
|
+
# Add spans to their respective trace buffers
|
|
172
|
+
for trace_id, trace_spans in spans_by_trace.items():
|
|
173
|
+
has_root = trace_id in root_span_traces
|
|
174
|
+
self._add_spans_to_trace(trace_id, trace_spans, has_root)
|
|
175
|
+
|
|
176
|
+
# Upload complete traces (those with root spans)
|
|
177
|
+
for trace_id in root_span_traces:
|
|
178
|
+
if self.task_processor is not None and callable(getattr(self.task_processor, 'queue_task', None)):
|
|
179
|
+
# Queue the upload task
|
|
180
|
+
if trace_id in self.trace_spans:
|
|
181
|
+
spans_to_upload, _, _ = self.trace_spans[trace_id]
|
|
182
|
+
serialized_data = self.__serialize_spans(spans_to_upload)
|
|
183
|
+
if serialized_data:
|
|
184
|
+
self.task_processor.queue_task(self.__upload_to_s3_with_trace_id, serialized_data, trace_id, True)
|
|
185
|
+
del self.trace_spans[trace_id]
|
|
186
|
+
else:
|
|
187
|
+
self._upload_trace(trace_id)
|
|
121
188
|
|
|
122
189
|
return SpanExportResult.SUCCESS
|
|
123
190
|
except Exception as e:
|
|
@@ -140,44 +207,35 @@ class S3SpanExporter(SpanExporterBase):
|
|
|
140
207
|
return ndjson_data
|
|
141
208
|
except Exception as e:
|
|
142
209
|
logger.warning(f"Error serializing spans: {e}")
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
async def __export_spans(self):
|
|
146
|
-
if len(self.export_queue) == 0:
|
|
147
|
-
return
|
|
148
|
-
|
|
149
|
-
# Take a batch of spans from the queue
|
|
150
|
-
batch_to_export = self.export_queue[:self.max_batch_size]
|
|
151
|
-
serialized_data = self.__serialize_spans(batch_to_export)
|
|
152
|
-
self.export_queue = self.export_queue[self.max_batch_size:]
|
|
153
|
-
# to calculate is_root_span loop over each span in batch_to_export and check if parent id is none or null
|
|
154
|
-
is_root_span = any(not span.parent for span in batch_to_export)
|
|
155
|
-
logger.info(f"Exporting {len(batch_to_export)} spans to S3 is_root_span : {is_root_span}.")
|
|
156
|
-
if self.task_processor is not None and callable(getattr(self.task_processor, 'queue_task', None)):
|
|
157
|
-
self.task_processor.queue_task(self.__upload_to_s3, serialized_data, is_root_span)
|
|
158
|
-
else:
|
|
159
|
-
try:
|
|
160
|
-
self.__upload_to_s3(serialized_data)
|
|
161
|
-
except Exception as e:
|
|
162
|
-
logger.error(f"Failed to upload span batch: {e}")
|
|
210
|
+
return ""
|
|
163
211
|
|
|
164
212
|
@SpanExporterBase.retry_with_backoff(exceptions=(EndpointConnectionError, ConnectionClosedError, ReadTimeoutError, ConnectTimeoutError))
|
|
165
|
-
def
|
|
213
|
+
def __upload_to_s3_with_trace_id(self, span_data_batch: str, trace_id: int):
|
|
214
|
+
"""Upload spans for a specific trace to S3 with trace ID in filename."""
|
|
166
215
|
current_time = datetime.datetime.now().strftime(self.time_format)
|
|
167
216
|
prefix = self.file_prefix + os.environ.get('MONOCLE_S3_KEY_PREFIX_CURRENT', '')
|
|
168
|
-
file_name = f"{prefix}{current_time}.ndjson"
|
|
217
|
+
file_name = f"{prefix}{current_time}_{format_trace_id_without_0x(trace_id)}.ndjson"
|
|
169
218
|
self.s3_client.put_object(
|
|
170
219
|
Bucket=self.bucket_name,
|
|
171
220
|
Key=file_name,
|
|
172
221
|
Body=span_data_batch
|
|
173
222
|
)
|
|
174
|
-
logger.debug(f"
|
|
223
|
+
logger.debug(f"Trace {format_trace_id_without_0x(trace_id)} uploaded to AWS S3 as {file_name}.")
|
|
175
224
|
|
|
176
225
|
async def force_flush(self, timeout_millis: int = 30000) -> bool:
|
|
177
|
-
|
|
226
|
+
"""Flush all pending traces to S3."""
|
|
227
|
+
trace_ids_to_upload = list(self.trace_spans.keys())
|
|
228
|
+
for trace_id in trace_ids_to_upload:
|
|
229
|
+
self._upload_trace(trace_id)
|
|
178
230
|
return True
|
|
179
231
|
|
|
180
232
|
def shutdown(self) -> None:
|
|
233
|
+
"""Upload all pending traces and shutdown."""
|
|
234
|
+
# Upload all remaining traces
|
|
235
|
+
trace_ids_to_upload = list(self.trace_spans.keys())
|
|
236
|
+
for trace_id in trace_ids_to_upload:
|
|
237
|
+
self._upload_trace(trace_id)
|
|
238
|
+
|
|
181
239
|
if hasattr(self, 'task_processor') and self.task_processor is not None:
|
|
182
240
|
self.task_processor.stop()
|
|
183
241
|
logger.info("S3SpanExporter has been shut down.")
|