monocle-apptrace 0.5.3__py3-none-any.whl → 0.6.6__py3-none-any.whl
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.
Potentially problematic release.
This version of monocle-apptrace might be problematic. Click here for more details.
- monocle_apptrace/exporters/file_exporter.py +7 -1
- monocle_apptrace/instrumentation/common/constants.py +8 -0
- monocle_apptrace/instrumentation/common/instrumentor.py +1 -1
- monocle_apptrace/instrumentation/common/span_handler.py +75 -24
- monocle_apptrace/instrumentation/common/utils.py +63 -6
- monocle_apptrace/instrumentation/common/wrapper.py +111 -42
- monocle_apptrace/instrumentation/common/wrapper_method.py +6 -2
- monocle_apptrace/instrumentation/metamodel/a2a/methods.py +1 -1
- monocle_apptrace/instrumentation/metamodel/adk/_helper.py +7 -4
- monocle_apptrace/instrumentation/metamodel/adk/entities/agent.py +6 -1
- monocle_apptrace/instrumentation/metamodel/agents/_helper.py +8 -8
- monocle_apptrace/instrumentation/metamodel/agents/entities/inference.py +9 -2
- monocle_apptrace/instrumentation/metamodel/aiohttp/_helper.py +1 -1
- monocle_apptrace/instrumentation/metamodel/anthropic/entities/inference.py +1 -4
- monocle_apptrace/instrumentation/metamodel/azfunc/_helper.py +1 -1
- monocle_apptrace/instrumentation/metamodel/botocore/_helper.py +5 -0
- monocle_apptrace/instrumentation/metamodel/botocore/entities/inference.py +4 -0
- monocle_apptrace/instrumentation/metamodel/fastapi/_helper.py +4 -4
- monocle_apptrace/instrumentation/metamodel/fastapi/methods.py +4 -4
- monocle_apptrace/instrumentation/metamodel/finish_types.py +32 -1
- monocle_apptrace/instrumentation/metamodel/flask/_helper.py +3 -3
- monocle_apptrace/instrumentation/metamodel/hugging_face/__init__.py +0 -0
- monocle_apptrace/instrumentation/metamodel/hugging_face/_helper.py +138 -0
- monocle_apptrace/instrumentation/metamodel/hugging_face/entities/__init__.py +0 -0
- monocle_apptrace/instrumentation/metamodel/hugging_face/entities/inference.py +94 -0
- monocle_apptrace/instrumentation/metamodel/hugging_face/methods.py +23 -0
- monocle_apptrace/instrumentation/metamodel/lambdafunc/_helper.py +1 -1
- monocle_apptrace/instrumentation/metamodel/langchain/entities/inference.py +1 -4
- monocle_apptrace/instrumentation/metamodel/langgraph/_helper.py +34 -8
- monocle_apptrace/instrumentation/metamodel/langgraph/entities/inference.py +8 -3
- monocle_apptrace/instrumentation/metamodel/langgraph/langgraph_processor.py +88 -19
- monocle_apptrace/instrumentation/metamodel/langgraph/methods.py +22 -6
- monocle_apptrace/instrumentation/metamodel/llamaindex/_helper.py +30 -10
- monocle_apptrace/instrumentation/metamodel/llamaindex/entities/agent.py +4 -3
- monocle_apptrace/instrumentation/metamodel/llamaindex/llamaindex_processor.py +15 -7
- monocle_apptrace/instrumentation/metamodel/llamaindex/methods.py +1 -8
- monocle_apptrace/instrumentation/metamodel/mcp/_helper.py +7 -6
- monocle_apptrace/instrumentation/metamodel/mistral/_helper.py +98 -49
- monocle_apptrace/instrumentation/metamodel/mistral/entities/inference.py +15 -9
- monocle_apptrace/instrumentation/metamodel/mistral/entities/retrieval.py +41 -0
- monocle_apptrace/instrumentation/metamodel/mistral/methods.py +10 -1
- monocle_apptrace/instrumentation/metamodel/openai/_helper.py +47 -7
- monocle_apptrace/instrumentation/metamodel/openai/entities/inference.py +20 -4
- monocle_apptrace/instrumentation/metamodel/openai/methods.py +1 -1
- monocle_apptrace/instrumentation/metamodel/strands/_helper.py +44 -0
- monocle_apptrace/instrumentation/metamodel/strands/entities/agent.py +179 -0
- monocle_apptrace/instrumentation/metamodel/strands/entities/tool.py +62 -0
- monocle_apptrace/instrumentation/metamodel/strands/methods.py +20 -0
- {monocle_apptrace-0.5.3.dist-info → monocle_apptrace-0.6.6.dist-info}/METADATA +23 -79
- {monocle_apptrace-0.5.3.dist-info → monocle_apptrace-0.6.6.dist-info}/RECORD +53 -46
- monocle_apptrace/README.md +0 -101
- monocle_apptrace/mcp_server.py +0 -94
- monocle_apptrace-0.5.3.dist-info/licenses/NOTICE +0 -4
- {monocle_apptrace-0.5.3.dist-info → monocle_apptrace-0.6.6.dist-info}/WHEEL +0 -0
- {monocle_apptrace-0.5.3.dist-info → monocle_apptrace-0.6.6.dist-info}/entry_points.txt +0 -0
- {monocle_apptrace-0.5.3.dist-info → monocle_apptrace-0.6.6.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
monocle_apptrace/README.md,sha256=T5NFC01bF8VR0oVnAX_n0bhsEtttwqfTxDNAe5Y_ivE,3765
|
|
2
1
|
monocle_apptrace/__init__.py,sha256=XtoX7gHUSZgkY1nry8IFny8RslPhutZQUuEkqIrBzFQ,30
|
|
3
2
|
monocle_apptrace/__main__.py,sha256=MLLPbC4YTp8O2wQrn8BROSZGvQpQd5brk_d1n_dWVWA,573
|
|
4
|
-
monocle_apptrace/mcp_server.py,sha256=X5NFOE1QHkIktykGlRH-bzOnLsby5E9sTRAT-4BOQx0,5591
|
|
5
3
|
monocle_apptrace/exporters/base_exporter.py,sha256=xm2MkDjuVZc-vmSXBMMsNMyIoy4z0O4g6wOAyuEnHwo,2062
|
|
6
4
|
monocle_apptrace/exporters/exporter_processor.py,sha256=-spCIJ_UfJ0fax_jE-ii3ODQBwtnHZgYIGVNd91Q718,6298
|
|
7
|
-
monocle_apptrace/exporters/file_exporter.py,sha256=
|
|
5
|
+
monocle_apptrace/exporters/file_exporter.py,sha256=wgYuCJRCC_H4S7hkPh6K5w8ps51sUXkeldNbU_uicmw,8426
|
|
8
6
|
monocle_apptrace/exporters/monocle_exporters.py,sha256=qo6S53dp2ko6EzMP-ICL2buqgmw8HZboy19j7iHp1Qk,2882
|
|
9
7
|
monocle_apptrace/exporters/aws/s3_exporter.py,sha256=9GA2tiWOUBLtDdGIdLLyYJEdQ1jRC5SdxxVH3qqR8Qk,8260
|
|
10
8
|
monocle_apptrace/exporters/aws/s3_exporter_opendal.py,sha256=0aEUxdMgJaDUwqjw0DqlCMr8kjl01KgwUt3_RRCVFds,5917
|
|
@@ -13,43 +11,43 @@ monocle_apptrace/exporters/azure/blob_exporter_opendal.py,sha256=wQUtciyFMD28tpW
|
|
|
13
11
|
monocle_apptrace/exporters/okahu/okahu_exporter.py,sha256=wFkHd87nOXzFMRejrUiO6N0mNIWkxAyRzob6o82lr_c,4765
|
|
14
12
|
monocle_apptrace/instrumentation/__init__.py,sha256=wCzg-Ivla7p2F01pM1fEEQMztzcZZB4vD5cZ9CsTigw,94
|
|
15
13
|
monocle_apptrace/instrumentation/common/__init__.py,sha256=iVcdQectswd-J_h5n0n-PqAXsrmCRxdK8YeyqYGArC8,432
|
|
16
|
-
monocle_apptrace/instrumentation/common/constants.py,sha256=
|
|
17
|
-
monocle_apptrace/instrumentation/common/instrumentor.py,sha256=
|
|
14
|
+
monocle_apptrace/instrumentation/common/constants.py,sha256=9T4h-pAzlIsGzZpQP4V1fyhLnVi2RJCbb2oYBabf1Rk,6488
|
|
15
|
+
monocle_apptrace/instrumentation/common/instrumentor.py,sha256=4n2USZsjfGSkK6FuNnx78PR3cMbxuSEI6UC86Asb92Q,10864
|
|
18
16
|
monocle_apptrace/instrumentation/common/method_wrappers.py,sha256=jC3G_R2YVD0JWCzxx1zNzJbe_BsNhsveVMegJRXA3IQ,10152
|
|
19
17
|
monocle_apptrace/instrumentation/common/scope_wrapper.py,sha256=Ysr4zmb71sZm3R-fNabctnNJHnmLVL9FE-4EmQo3HxA,3927
|
|
20
|
-
monocle_apptrace/instrumentation/common/span_handler.py,sha256=
|
|
18
|
+
monocle_apptrace/instrumentation/common/span_handler.py,sha256=WVpov28sknQpWAPcwYe9kTAS1OgBlbDqyzJhElw-Os8,18557
|
|
21
19
|
monocle_apptrace/instrumentation/common/tracing.md,sha256=6Lr8QGxEFHKhj-mMvLV3xjFnplKSs6HEdwl0McPK47M,7577
|
|
22
|
-
monocle_apptrace/instrumentation/common/utils.py,sha256=
|
|
23
|
-
monocle_apptrace/instrumentation/common/wrapper.py,sha256=
|
|
24
|
-
monocle_apptrace/instrumentation/common/wrapper_method.py,sha256=
|
|
20
|
+
monocle_apptrace/instrumentation/common/utils.py,sha256=RHXHbutqWecHUUAKYx5NEjS2YD6SCC3JJ-hfJeDqQIk,18046
|
|
21
|
+
monocle_apptrace/instrumentation/common/wrapper.py,sha256=71cezQtDRmikazOv9IfHuNM7dYK2Cv82Axpa4oTakgg,24163
|
|
22
|
+
monocle_apptrace/instrumentation/common/wrapper_method.py,sha256=bwdoCybp-eKQbOf3uWyEPscXEUSV7ve8RqQBuRQwuGo,6922
|
|
25
23
|
monocle_apptrace/instrumentation/metamodel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
|
-
monocle_apptrace/instrumentation/metamodel/finish_types.py,sha256=
|
|
24
|
+
monocle_apptrace/instrumentation/metamodel/finish_types.py,sha256=Bkto3dHkabTjSsPXLnzPiOW1_xal5CGNrIfIfqdHYSk,20748
|
|
27
25
|
monocle_apptrace/instrumentation/metamodel/a2a/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
26
|
monocle_apptrace/instrumentation/metamodel/a2a/_helper.py,sha256=BHuhF5OnEFEQR081lM4R538c83P--t1J5xHOREFDBpo,1281
|
|
29
|
-
monocle_apptrace/instrumentation/metamodel/a2a/methods.py,sha256=
|
|
27
|
+
monocle_apptrace/instrumentation/metamodel/a2a/methods.py,sha256=rA2AY3tGuCcAsQFb1VjtuwhRYgiMdtl7WKAa4h4iRXE,668
|
|
30
28
|
monocle_apptrace/instrumentation/metamodel/a2a/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
29
|
monocle_apptrace/instrumentation/metamodel/a2a/entities/inference.py,sha256=5v37Q5mqE0JzWsmC6x1ZvJB3Zpkyce3hKyfCHF7iD9Q,3715
|
|
32
30
|
monocle_apptrace/instrumentation/metamodel/adk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
|
-
monocle_apptrace/instrumentation/metamodel/adk/_helper.py,sha256=
|
|
31
|
+
monocle_apptrace/instrumentation/metamodel/adk/_helper.py,sha256=ZBXDWgOv6p0OojJrYo4qo6yI4G87quXkMnSJghFFMV0,6475
|
|
34
32
|
monocle_apptrace/instrumentation/metamodel/adk/methods.py,sha256=Wp6MJArvLotY2CIAf1PlwJzdcH8qBk7II1KPBRET7c0,917
|
|
35
|
-
monocle_apptrace/instrumentation/metamodel/adk/entities/agent.py,sha256=
|
|
33
|
+
monocle_apptrace/instrumentation/metamodel/adk/entities/agent.py,sha256=esRSIJRE91tzasEqMouXKsU8vj01Zf24a-7Uyxq0DKg,3905
|
|
36
34
|
monocle_apptrace/instrumentation/metamodel/adk/entities/tool.py,sha256=EEZxYM9bdH7KCmO-jnTywXAiN45hel5eAqLyHKZ1BbU,2157
|
|
37
35
|
monocle_apptrace/instrumentation/metamodel/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
|
-
monocle_apptrace/instrumentation/metamodel/agents/_helper.py,sha256=
|
|
36
|
+
monocle_apptrace/instrumentation/metamodel/agents/_helper.py,sha256=KwN7cM6f8M64O_oKsa23DuvV0iY9OskPHViOfu06w6w,7574
|
|
39
37
|
monocle_apptrace/instrumentation/metamodel/agents/agents_processor.py,sha256=P95dNBh18M74Bw-BklwcN3wRfyi4vC3Q9EOcR8QBheg,6194
|
|
40
38
|
monocle_apptrace/instrumentation/metamodel/agents/methods.py,sha256=l7KwBLm_olUfZsN9UxUVc_spvSGLNqBJzKh3cyX40-o,1758
|
|
41
39
|
monocle_apptrace/instrumentation/metamodel/agents/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
42
|
-
monocle_apptrace/instrumentation/metamodel/agents/entities/inference.py,sha256=
|
|
40
|
+
monocle_apptrace/instrumentation/metamodel/agents/entities/inference.py,sha256=JO3TY1FDjOotU00IwSogTG3pNuaXenbXicTYZ4NwVKM,6945
|
|
43
41
|
monocle_apptrace/instrumentation/metamodel/aiohttp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
44
|
-
monocle_apptrace/instrumentation/metamodel/aiohttp/_helper.py,sha256=
|
|
42
|
+
monocle_apptrace/instrumentation/metamodel/aiohttp/_helper.py,sha256=aJeOouDTQJ7qUQ_5wX1VaTWfbKQapIG7ZvCYxSLNGbQ,2545
|
|
45
43
|
monocle_apptrace/instrumentation/metamodel/aiohttp/methods.py,sha256=rcfGoRMLJeu-X2O9fGv6nhhjUrBJALKOJ-axiedavMI,435
|
|
46
44
|
monocle_apptrace/instrumentation/metamodel/aiohttp/entities/http.py,sha256=OC7qgaKLUD_otmtP5jNyWcR_D0GGSbBZAxNa6RtQXwE,2201
|
|
47
45
|
monocle_apptrace/instrumentation/metamodel/anthropic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
48
46
|
monocle_apptrace/instrumentation/metamodel/anthropic/_helper.py,sha256=fuILJFil-Gr2hIDIK-2xlHyibCwVXLbakFgJ2P9AKNE,8615
|
|
49
47
|
monocle_apptrace/instrumentation/metamodel/anthropic/methods.py,sha256=WVXoN_i5h9hXjrJV5xF9wIQIpmP_gCN3P8HEPfAsfik,703
|
|
50
48
|
monocle_apptrace/instrumentation/metamodel/anthropic/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
51
|
-
monocle_apptrace/instrumentation/metamodel/anthropic/entities/inference.py,sha256=
|
|
52
|
-
monocle_apptrace/instrumentation/metamodel/azfunc/_helper.py,sha256=
|
|
49
|
+
monocle_apptrace/instrumentation/metamodel/anthropic/entities/inference.py,sha256=6UpRltu3e98nrnwDnLqME2ECumiXduMTE44WkaBBFhA,3535
|
|
50
|
+
monocle_apptrace/instrumentation/metamodel/azfunc/_helper.py,sha256=j7jfAo0lzGkHz0c7H57j5u7ZHqWHRPBWon3bGpFflbg,3047
|
|
53
51
|
monocle_apptrace/instrumentation/metamodel/azfunc/methods.py,sha256=dCcptd9nLsXkkWtSgXBh7zRia-1g-A3rgiC4cqt5Tzo,916
|
|
54
52
|
monocle_apptrace/instrumentation/metamodel/azfunc/wrapper.py,sha256=zssmQNWG-kn9cSfE1JYwqHsl1hU4zrN2xUcFbyos8oM,712
|
|
55
53
|
monocle_apptrace/instrumentation/metamodel/azfunc/entities/http.py,sha256=gWjUe5t4JWOGtzJDRFWbZqjPi8ER6hFa_2V43M8D2do,2208
|
|
@@ -58,18 +56,18 @@ monocle_apptrace/instrumentation/metamodel/azureaiinference/_helper.py,sha256=j0
|
|
|
58
56
|
monocle_apptrace/instrumentation/metamodel/azureaiinference/methods.py,sha256=PsxJPFSc9yp9uzdpwVUWUAd2PVwF7MYwf3I2_cqHSOk,810
|
|
59
57
|
monocle_apptrace/instrumentation/metamodel/azureaiinference/entities/inference.py,sha256=veszCGFtEiMKhbM88X-HVQL6KM2plsLzFUL2TF46x8A,8746
|
|
60
58
|
monocle_apptrace/instrumentation/metamodel/botocore/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
61
|
-
monocle_apptrace/instrumentation/metamodel/botocore/_helper.py,sha256=
|
|
59
|
+
monocle_apptrace/instrumentation/metamodel/botocore/_helper.py,sha256=ycVPk45SyHyWkjNZvztOM2d7U9zm2tdDMFV7ZFvPE0s,8511
|
|
62
60
|
monocle_apptrace/instrumentation/metamodel/botocore/methods.py,sha256=LzmjbZjDWy7Uozc0chNjWG6PZhLngh_KJe5L6rw5rqI,452
|
|
63
61
|
monocle_apptrace/instrumentation/metamodel/botocore/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
64
|
-
monocle_apptrace/instrumentation/metamodel/botocore/entities/inference.py,sha256
|
|
62
|
+
monocle_apptrace/instrumentation/metamodel/botocore/entities/inference.py,sha256=K8QW5IKORe55uR7CeVd07n9FZHuk0o59kw-Df38VJWs,3247
|
|
65
63
|
monocle_apptrace/instrumentation/metamodel/botocore/handlers/botocore_span_handler.py,sha256=aZ_jxngqjihxxTPFOqYH8rjoEdF_WVwE_3-TB57d_8I,1444
|
|
66
64
|
monocle_apptrace/instrumentation/metamodel/fastapi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
67
|
-
monocle_apptrace/instrumentation/metamodel/fastapi/_helper.py,sha256=
|
|
68
|
-
monocle_apptrace/instrumentation/metamodel/fastapi/methods.py,sha256=
|
|
65
|
+
monocle_apptrace/instrumentation/metamodel/fastapi/_helper.py,sha256=Im-TWet_i_42JgireqQ17dXqGGeLdLxMoB1bzLGQy-I,3672
|
|
66
|
+
monocle_apptrace/instrumentation/metamodel/fastapi/methods.py,sha256=2-tDWmTv_qx0UsiUvP3J3PFKswv8LBKmAhoE5VQTJG8,824
|
|
69
67
|
monocle_apptrace/instrumentation/metamodel/fastapi/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
70
68
|
monocle_apptrace/instrumentation/metamodel/fastapi/entities/http.py,sha256=HUH_lrxezw96t-9hCle-yALEZaHfZpOTEVB0kNkacv4,1476
|
|
71
69
|
monocle_apptrace/instrumentation/metamodel/flask/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
72
|
-
monocle_apptrace/instrumentation/metamodel/flask/_helper.py,sha256=
|
|
70
|
+
monocle_apptrace/instrumentation/metamodel/flask/_helper.py,sha256=vnIebFd1wgfKOzSoH4b9bSg767nFSiQq1hs_VaC2wbI,3288
|
|
73
71
|
monocle_apptrace/instrumentation/metamodel/flask/methods.py,sha256=dWCMEDk-HWHiD0vlMoAVYbIFclstmVkUpRrCtqDWyFE,739
|
|
74
72
|
monocle_apptrace/instrumentation/metamodel/flask/entities/http.py,sha256=bj_A7_tiz9oY-1nAXYL1V_Kj4g3Z6HLKqdCOdw4qgUc,1804
|
|
75
73
|
monocle_apptrace/instrumentation/metamodel/gemini/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -84,7 +82,12 @@ monocle_apptrace/instrumentation/metamodel/haystack/methods.py,sha256=fuICw7KVTA
|
|
|
84
82
|
monocle_apptrace/instrumentation/metamodel/haystack/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
85
83
|
monocle_apptrace/instrumentation/metamodel/haystack/entities/inference.py,sha256=pykGCW_ucEdPkp_yshSyHeK7p2WxJpnzxHEPt7TONp0,3880
|
|
86
84
|
monocle_apptrace/instrumentation/metamodel/haystack/entities/retrieval.py,sha256=bWagT0us1sGFlvHEToYlVk4PPDxFimQC0l_BJmrjnxc,2439
|
|
87
|
-
monocle_apptrace/instrumentation/metamodel/
|
|
85
|
+
monocle_apptrace/instrumentation/metamodel/hugging_face/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
86
|
+
monocle_apptrace/instrumentation/metamodel/hugging_face/_helper.py,sha256=1tXstgAwowmLYhB3psx8sdoxd_9sQ8T5fklfOP7Mzuk,4778
|
|
87
|
+
monocle_apptrace/instrumentation/metamodel/hugging_face/methods.py,sha256=U4kui4NiZ2drAvahira1__qVAUCT-OR0zZEn-rN_4nc,751
|
|
88
|
+
monocle_apptrace/instrumentation/metamodel/hugging_face/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
89
|
+
monocle_apptrace/instrumentation/metamodel/hugging_face/entities/inference.py,sha256=-Izfu4ZuVVVrELj6iRJZ5di299ervr5f-eKlTbYpmbw,3546
|
|
90
|
+
monocle_apptrace/instrumentation/metamodel/lambdafunc/_helper.py,sha256=ec0IM2c8DEnme6ILAuYSDc4EubVm8d9B57IzgftWlz4,3049
|
|
88
91
|
monocle_apptrace/instrumentation/metamodel/lambdafunc/methods.py,sha256=-b5dfI5oZVdRmBjfrVJgQuN910p7SUOu9Tc1AUhkz3A,934
|
|
89
92
|
monocle_apptrace/instrumentation/metamodel/lambdafunc/wrapper.py,sha256=nxnfCwPftoRdHfjuRNrILEFOvB1e8oXqHRfPn-qxyZY,716
|
|
90
93
|
monocle_apptrace/instrumentation/metamodel/lambdafunc/entities/http.py,sha256=ws2tSnf77rHdJ2E0ER2SOB9U7EDp33d9yNh2O29yDRA,1984
|
|
@@ -92,48 +95,53 @@ monocle_apptrace/instrumentation/metamodel/langchain/__init__.py,sha256=47DEQpj8
|
|
|
92
95
|
monocle_apptrace/instrumentation/metamodel/langchain/_helper.py,sha256=Xt-PRVLDMU6buiKLcUhw-IwL5sj1FF-etkp403HGRs0,12339
|
|
93
96
|
monocle_apptrace/instrumentation/metamodel/langchain/methods.py,sha256=sQLrji0NLuG8i8q5UdbgzPUjWh_WmromfvWL3pGZdCk,2941
|
|
94
97
|
monocle_apptrace/instrumentation/metamodel/langchain/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
95
|
-
monocle_apptrace/instrumentation/metamodel/langchain/entities/inference.py,sha256=
|
|
98
|
+
monocle_apptrace/instrumentation/metamodel/langchain/entities/inference.py,sha256=FtYTfO7YGuAaAFYHAQF41cxJn7HxVXVwkqO2FgoeWNc,3538
|
|
96
99
|
monocle_apptrace/instrumentation/metamodel/langchain/entities/retrieval.py,sha256=rRzp_oi_-yEKgCnQUxIS2ForJKtUQFGADYOou91sXU0,2121
|
|
97
100
|
monocle_apptrace/instrumentation/metamodel/langgraph/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
98
|
-
monocle_apptrace/instrumentation/metamodel/langgraph/_helper.py,sha256=
|
|
99
|
-
monocle_apptrace/instrumentation/metamodel/langgraph/langgraph_processor.py,sha256=
|
|
100
|
-
monocle_apptrace/instrumentation/metamodel/langgraph/methods.py,sha256=
|
|
101
|
+
monocle_apptrace/instrumentation/metamodel/langgraph/_helper.py,sha256=jXRhFVt8cqwDg-za4gpqtHFnLj81H05kzbYMe_VDz3M,5133
|
|
102
|
+
monocle_apptrace/instrumentation/metamodel/langgraph/langgraph_processor.py,sha256=OoNoiFozBG0aESzh7Gz5zmfROyRyt0_yVUj3Sjx3-4s,6904
|
|
103
|
+
monocle_apptrace/instrumentation/metamodel/langgraph/methods.py,sha256=CyQ-i9haqEhRsDcQ4HYscTO9YMnQwbDpSoxEqtr7UEI,1803
|
|
101
104
|
monocle_apptrace/instrumentation/metamodel/langgraph/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
102
|
-
monocle_apptrace/instrumentation/metamodel/langgraph/entities/inference.py,sha256=
|
|
105
|
+
monocle_apptrace/instrumentation/metamodel/langgraph/entities/inference.py,sha256=ne_WcdJ2lU6FWvJS-PCcq5kMiOtPvRWlqVXDkt_ER3Y,5375
|
|
103
106
|
monocle_apptrace/instrumentation/metamodel/litellm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
104
107
|
monocle_apptrace/instrumentation/metamodel/litellm/_helper.py,sha256=Yo0RtiJ4WKDRuC9VqUmXmdQmRLduOsVGHMNwswwdcLk,3433
|
|
105
108
|
monocle_apptrace/instrumentation/metamodel/litellm/methods.py,sha256=D3rT7bQKzPRxGIs3GxwPmjmmti8ndF7_5Cmz8ojfSJQ,627
|
|
106
109
|
monocle_apptrace/instrumentation/metamodel/litellm/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
107
110
|
monocle_apptrace/instrumentation/metamodel/litellm/entities/inference.py,sha256=uh8b8o770BCYgz9QGdFYTMU6pOK3XG7uzwjOBAPi1Ko,3636
|
|
108
111
|
monocle_apptrace/instrumentation/metamodel/llamaindex/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
109
|
-
monocle_apptrace/instrumentation/metamodel/llamaindex/_helper.py,sha256
|
|
110
|
-
monocle_apptrace/instrumentation/metamodel/llamaindex/llamaindex_processor.py,sha256=
|
|
111
|
-
monocle_apptrace/instrumentation/metamodel/llamaindex/methods.py,sha256=
|
|
112
|
+
monocle_apptrace/instrumentation/metamodel/llamaindex/_helper.py,sha256=KAmgrP5ySkQIM1D-qhGnbFE5mIABFU8Aeurgw13N_xg,16668
|
|
113
|
+
monocle_apptrace/instrumentation/metamodel/llamaindex/llamaindex_processor.py,sha256=AUvgRhZbr7ONMmTg4sF4zbwYfi_HUUCeOnUP0aC-2hM,4443
|
|
114
|
+
monocle_apptrace/instrumentation/metamodel/llamaindex/methods.py,sha256=BMoN7TcC8g-YBJgmj6i_bB0g1Ivf_BrbKF4SDZOOLBQ,4973
|
|
112
115
|
monocle_apptrace/instrumentation/metamodel/llamaindex/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
113
|
-
monocle_apptrace/instrumentation/metamodel/llamaindex/entities/agent.py,sha256=
|
|
116
|
+
monocle_apptrace/instrumentation/metamodel/llamaindex/entities/agent.py,sha256=xM2iNF9ztkolA_yZHq6JQgAl09M035TKloDsw5-rrio,5250
|
|
114
117
|
monocle_apptrace/instrumentation/metamodel/llamaindex/entities/inference.py,sha256=sWXR1-Vp6QxQVm9yYrrb3N6i8vS4vuR7G1MkS-DFY9o,3401
|
|
115
118
|
monocle_apptrace/instrumentation/metamodel/llamaindex/entities/retrieval.py,sha256=z9jWZW_UCYL0fKCUKXEiIzloZeYi14kGkOPqewO4If8,1952
|
|
116
119
|
monocle_apptrace/instrumentation/metamodel/mcp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
117
|
-
monocle_apptrace/instrumentation/metamodel/mcp/_helper.py,sha256=
|
|
120
|
+
monocle_apptrace/instrumentation/metamodel/mcp/_helper.py,sha256=f99CvGWxKIA8EiK7Ygb-VOP0bfAHrSuuELa_Lv6Dwwc,4006
|
|
118
121
|
monocle_apptrace/instrumentation/metamodel/mcp/mcp_processor.py,sha256=bCAEUYNudGcXhpS-U7GP6Zt917AhvxJWJpoykfjE044,377
|
|
119
122
|
monocle_apptrace/instrumentation/metamodel/mcp/methods.py,sha256=rgd5lZG8Z8x4vGZ5JxZiPeAwBoaZp6wOuwO8uYzHRCs,685
|
|
120
123
|
monocle_apptrace/instrumentation/metamodel/mcp/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
121
124
|
monocle_apptrace/instrumentation/metamodel/mcp/entities/inference.py,sha256=hd1K63T3DHInaTvcCHm8VO7IZsT5cV3todvOucWPL34,1783
|
|
122
125
|
monocle_apptrace/instrumentation/metamodel/mistral/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
123
|
-
monocle_apptrace/instrumentation/metamodel/mistral/_helper.py,sha256=
|
|
124
|
-
monocle_apptrace/instrumentation/metamodel/mistral/methods.py,sha256=
|
|
126
|
+
monocle_apptrace/instrumentation/metamodel/mistral/_helper.py,sha256=RT3Oh-4MAOgcvgpC8CCpT-zUy3rz_bH7U-vJZavVBkM,8931
|
|
127
|
+
monocle_apptrace/instrumentation/metamodel/mistral/methods.py,sha256=24xQSrFth6IBa8pPm0KCB_Pjt783JQq7qBfYpd5cVIE,1897
|
|
125
128
|
monocle_apptrace/instrumentation/metamodel/mistral/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
126
|
-
monocle_apptrace/instrumentation/metamodel/mistral/entities/inference.py,sha256=
|
|
129
|
+
monocle_apptrace/instrumentation/metamodel/mistral/entities/inference.py,sha256=s5qlVywKW1ic9rZTd3gWCzOK_H-IM-5O4bYsYS_p33M,3741
|
|
130
|
+
monocle_apptrace/instrumentation/metamodel/mistral/entities/retrieval.py,sha256=M5nc4bPbln0wKxzdXwkZzNBQ2etieBSAoHtbECUbHhg,1327
|
|
127
131
|
monocle_apptrace/instrumentation/metamodel/openai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
128
|
-
monocle_apptrace/instrumentation/metamodel/openai/_helper.py,sha256=
|
|
129
|
-
monocle_apptrace/instrumentation/metamodel/openai/methods.py,sha256=
|
|
132
|
+
monocle_apptrace/instrumentation/metamodel/openai/_helper.py,sha256=qgS54lxeJUJXM4jmCsUnI0t_7TH6NQkCJ8_jHf4_j4A,16621
|
|
133
|
+
monocle_apptrace/instrumentation/metamodel/openai/methods.py,sha256=VKWCA8EV2z0gw_F4HOyfcezsc92hbPXAvBDOY-JQXhY,1795
|
|
130
134
|
monocle_apptrace/instrumentation/metamodel/openai/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
131
|
-
monocle_apptrace/instrumentation/metamodel/openai/entities/inference.py,sha256=
|
|
135
|
+
monocle_apptrace/instrumentation/metamodel/openai/entities/inference.py,sha256=TKzzW67wSJWgUY4gUtwUa9x6mn8LgcT0P_I_Qf1iG_E,10934
|
|
132
136
|
monocle_apptrace/instrumentation/metamodel/openai/entities/retrieval.py,sha256=atvkAmG-7OiNndmH9kNWOMfN1vBpZ6lEZgMR_JISCe8,1457
|
|
133
137
|
monocle_apptrace/instrumentation/metamodel/requests/__init__.py,sha256=mg04UgoPzzcH-cPOahYUqN9T-TolZyOZipnBwDg5TP8,250
|
|
134
138
|
monocle_apptrace/instrumentation/metamodel/requests/_helper.py,sha256=GS03VbT9LiGwt4Mz2DPHtxuWd3xhQL4liS9-dfpy9SE,1985
|
|
135
139
|
monocle_apptrace/instrumentation/metamodel/requests/methods.py,sha256=O7lkglRvV97zqnCu6r2JwvW8WQqi4uvlpmNkAPpXigE,440
|
|
136
140
|
monocle_apptrace/instrumentation/metamodel/requests/entities/http.py,sha256=wM7HVf6GMnnso7sAO-YfRkYLWW21M_kLPMM8Ak9czLk,1751
|
|
141
|
+
monocle_apptrace/instrumentation/metamodel/strands/_helper.py,sha256=CnE9QmGo04EwC99wefEJzMjEd_L7se8COu5ACzJOkqs,1318
|
|
142
|
+
monocle_apptrace/instrumentation/metamodel/strands/methods.py,sha256=ib4wyCVxYvluz7RDOLu7lG95rjkkYq7gZjUDaNEC-LI,777
|
|
143
|
+
monocle_apptrace/instrumentation/metamodel/strands/entities/agent.py,sha256=OBiDMxbbJS7SHkstXgVG2kS-NUr5WAOhJWPrNohFIkI,5684
|
|
144
|
+
monocle_apptrace/instrumentation/metamodel/strands/entities/tool.py,sha256=qANG1STuNt_NdZPtSQonWVQI5hI66o_0UGu9Df6p7Pk,2081
|
|
137
145
|
monocle_apptrace/instrumentation/metamodel/teamsai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
138
146
|
monocle_apptrace/instrumentation/metamodel/teamsai/_helper.py,sha256=0wX6HOdzjQecYnrzWmR0RBX3Bm_WWbq1bKJO8DUhfM4,7212
|
|
139
147
|
monocle_apptrace/instrumentation/metamodel/teamsai/methods.py,sha256=5fPh2l8nSi524KwHGp-m6GVEy3lXmBG-97i7r0CpE2g,3453
|
|
@@ -142,9 +150,8 @@ monocle_apptrace/instrumentation/metamodel/teamsai/entities/__init__.py,sha256=4
|
|
|
142
150
|
monocle_apptrace/instrumentation/metamodel/teamsai/entities/inference/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
143
151
|
monocle_apptrace/instrumentation/metamodel/teamsai/entities/inference/actionplanner_output_processor.py,sha256=FRR9iBdDBXfYscP-lkORMNKl_lllflZN6gMlC7m_94w,3206
|
|
144
152
|
monocle_apptrace/instrumentation/metamodel/teamsai/entities/inference/teamsai_output_processor.py,sha256=o9jrBIEqPDg3VfR6zexUCpkq3jlX0lQji8CKLUUK4Wk,3022
|
|
145
|
-
monocle_apptrace-0.
|
|
146
|
-
monocle_apptrace-0.
|
|
147
|
-
monocle_apptrace-0.
|
|
148
|
-
monocle_apptrace-0.
|
|
149
|
-
monocle_apptrace-0.
|
|
150
|
-
monocle_apptrace-0.5.3.dist-info/RECORD,,
|
|
153
|
+
monocle_apptrace-0.6.6.dist-info/METADATA,sha256=8D4lLXMG4HA_ZqucQeW-6ORe5yRHuWdFcfCQJl2Xp9w,5499
|
|
154
|
+
monocle_apptrace-0.6.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
155
|
+
monocle_apptrace-0.6.6.dist-info/entry_points.txt,sha256=rxpPKb3klrgZEbSyOFQ2J6KRPO7ri9ES-zmC8Jtikx8,70
|
|
156
|
+
monocle_apptrace-0.6.6.dist-info/licenses/LICENSE,sha256=ay9trLiP5I7ZsFXo6AqtkLYdRqe5S9r-DrPOvsNlZrg,9136
|
|
157
|
+
monocle_apptrace-0.6.6.dist-info/RECORD,,
|
monocle_apptrace/README.md
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
## Monocle Concepts
|
|
2
|
-
|
|
3
|
-
### Traces
|
|
4
|
-
Traces are the full view of a single end-to-end application execution.
|
|
5
|
-
|
|
6
|
-
Examples of traces include one response to end user’s question by a chatbot app. Traces consists of various metadata about the application run including status, start time, duration, input/outputs etc. It also includes a list of individual steps aka “spans with details about that step.It’s typically the workflow code components of an application that generate the traces for application runs.
|
|
7
|
-
|
|
8
|
-
Traces are collections of spans.
|
|
9
|
-
|
|
10
|
-
### Spans
|
|
11
|
-
Spans are the individual steps executed by the application to perform a GenAI related task.
|
|
12
|
-
|
|
13
|
-
Examples of spans include app retrieving vectors from DB, app querying LLM for inference etc. The span includes the type of operation, start time, duration and metadata relevant to that step eg Model name, parameters and model endpoint/server for an inference request.
|
|
14
|
-
|
|
15
|
-
## Contribute to Monocle
|
|
16
|
-
|
|
17
|
-
Monocle includes:
|
|
18
|
-
- Methods for instrumentation of app code
|
|
19
|
-
- Base code for wrapping methods of interest in included in current folder
|
|
20
|
-
- Framework specific code is organized in a folder with the framework name
|
|
21
|
-
- Metamodel for how attributes and events for GenAI components are represented in OpenTelemety format
|
|
22
|
-
- See [metamodel](./metamodel/README.md) for supported GenAI entities, how functions operating on those entities map to spans and format of spans
|
|
23
|
-
- Exporters to send trace data to various locations. See [exporters](./exporters)
|
|
24
|
-
|
|
25
|
-
See [Monocle committer guide](/Monocle_committer_guide.md).
|
|
26
|
-
|
|
27
|
-
## Get Monocle
|
|
28
|
-
|
|
29
|
-
Option 1 - Download released packages from Pypi
|
|
30
|
-
```
|
|
31
|
-
python3 -m pip install pipenv
|
|
32
|
-
pip install monocle-apptrace
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Option 2 - Build and install locally from source
|
|
36
|
-
```
|
|
37
|
-
pip install .
|
|
38
|
-
pip install -e ".[dev]"
|
|
39
|
-
|
|
40
|
-
python3 -m pip install pipenv
|
|
41
|
-
pipenv install build
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Examples of app instrumentation with Monocle
|
|
45
|
-
|
|
46
|
-
### apps written using LLM orchestration frameworks
|
|
47
|
-
|
|
48
|
-
```python
|
|
49
|
-
from langchain.chains import LLMChain
|
|
50
|
-
from langchain_openai import OpenAI
|
|
51
|
-
from langchain.prompts import PromptTemplate
|
|
52
|
-
|
|
53
|
-
# Import the monocle_apptrace instrumentation method
|
|
54
|
-
from monocle_apptrace.instrumentor import setup_monocle_telemetry
|
|
55
|
-
from opentelemetry.sdk.trace.export import BatchSpanProcessor, ConsoleSpanExporter
|
|
56
|
-
|
|
57
|
-
# Call the setup Monocle telemetry method
|
|
58
|
-
setup_monocle_telemetry(workflow_name = "simple_math_app",
|
|
59
|
-
span_processors=[BatchSpanProcessor(ConsoleSpanExporter())])
|
|
60
|
-
|
|
61
|
-
llm = OpenAI()
|
|
62
|
-
prompt = PromptTemplate.from_template("1 + {number} = ")
|
|
63
|
-
|
|
64
|
-
chain = LLMChain(llm=llm, prompt=prompt)
|
|
65
|
-
chain.invoke({"number":2})
|
|
66
|
-
|
|
67
|
-
# Trace is generated when invoke() method is called
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### apps with custom methods
|
|
72
|
-
|
|
73
|
-
```python
|
|
74
|
-
|
|
75
|
-
# Import the monocle_apptrace instrumentation method
|
|
76
|
-
from monocle_apptrace.wrapper import WrapperMethod,task_wrapper,atask_wrapper
|
|
77
|
-
from opentelemetry.sdk.trace.export import BatchSpanProcessor, ConsoleSpanExporter
|
|
78
|
-
|
|
79
|
-
# Extend the default wrapped methods list as follows
|
|
80
|
-
app_name = "simple_math_app"
|
|
81
|
-
setup_monocle_telemetry(
|
|
82
|
-
workflow_name=app_name,
|
|
83
|
-
span_processors=[BatchSpanProcessor(ConsoleSpanExporter())],
|
|
84
|
-
wrapper_methods=[
|
|
85
|
-
WrapperMethod(
|
|
86
|
-
package="langchain.schema.runnable",
|
|
87
|
-
object_name="RunnableParallel",
|
|
88
|
-
method="invoke",
|
|
89
|
-
span_name="langchain.workflow",
|
|
90
|
-
wrapper=task_wrapper),
|
|
91
|
-
WrapperMethod(
|
|
92
|
-
package="langchain.schema.runnable",
|
|
93
|
-
object_name="RunnableParallel",
|
|
94
|
-
method="ainvoke",
|
|
95
|
-
span_name="langchain.workflow",
|
|
96
|
-
wrapper=atask_wrapper)
|
|
97
|
-
])
|
|
98
|
-
|
|
99
|
-
# Trace is generated when the invoke() method is called in langchain.schema.runnable package
|
|
100
|
-
|
|
101
|
-
```
|
monocle_apptrace/mcp_server.py
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
import click
|
|
3
|
-
from mcp.server.fastmcp import FastMCP
|
|
4
|
-
|
|
5
|
-
logger = logging.getLogger(__name__)
|
|
6
|
-
|
|
7
|
-
app = FastMCP(
|
|
8
|
-
"monocle-mcp",
|
|
9
|
-
)
|
|
10
|
-
code_snippets = {
|
|
11
|
-
"python": "from monocle_apptrace import setup_monocle_telemetry"
|
|
12
|
-
"setup_monocle_telemetry(workflow_name='my_workflow')\n",
|
|
13
|
-
"typescript": "import { trace } from 'monocle';\n\ntrace();\n",
|
|
14
|
-
}
|
|
15
|
-
setup_instructions = {
|
|
16
|
-
"python": "pip install monocle_apptrace package and add monocle_apptrace at the end of the requirement.txt for future. This code snippet provided below should be just below other imports in your application code.",
|
|
17
|
-
"typescript": "Install monocle package and add the trace function call at the top of your application. This code snippet provided below should be just below other imports in your application code.",
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
description = {
|
|
21
|
-
"python": "This will automatically trace your Python application, capturing telemetry data for your genAI operations.",
|
|
22
|
-
"typescript": "This will automatically trace your TypeScript application, capturing telemetry data for your genAI operations.",
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
# Use the existing dictionaries to get language-specific information
|
|
27
|
-
# code_snippet = code_snippets.get(app_language, code_snippets['python'])
|
|
28
|
-
# instructions = setup_instructions.get(app_language, setup_instructions['python'])
|
|
29
|
-
# desc = description.get(app_language, description['python'])
|
|
30
|
-
enable_monocle_prompt = """Do following changes to the project:
|
|
31
|
-
1. run command 'pip install monocle_apptrace'
|
|
32
|
-
2. Add following line to requirements.txt in current directory 'monocle_apptrace' if it's not there already
|
|
33
|
-
3. Add following lines just below other imports in the file if it's not there already:
|
|
34
|
-
from monocle_apptrace import setup_monocle_telemetry
|
|
35
|
-
setup_monocle_telemetry(workflow_name=<module-name>, monocle_exporters_list='file'))
|
|
36
|
-
"""
|
|
37
|
-
|
|
38
|
-
monocle_trace_prompt: str = """
|
|
39
|
-
You are a helpful assistant to analyze given Monocle trace data. Review the trace data and provide a summary of whether the execution was successful or if there were any errors. Your job is to analyze the trace data and provide a summary. Be very concise in reporting. Check for errors or problem situations. First provide a headline that indicates status of the trace and if there are problems. If there are problems, then provide a brief summary of the problems. If there are problems, then provide a brief summary of the root causes.
|
|
40
|
-
Use the trace details provided below to understand the data.
|
|
41
|
-
|
|
42
|
-
Monocle trace has recorded the traced the execution of a genAI application. Each step of the genAI operation is captured as span. The trace file is a JSON structure that is an array of span JSON elements. There's a root span that represents the overall execution context.
|
|
43
|
-
The important span JSON elements are as follows:
|
|
44
|
-
- context.trace_id is the unique id common for alls spans.
|
|
45
|
-
- context.span_id is the unique id for each span.
|
|
46
|
-
- parent_id indicates the parent span of that span. The span that has no parent is the root span.
|
|
47
|
-
- status.status_code indicate the status of span. It can be OK or ERROR or UNSET. If the span status is ERROR, then it generally propogated to it's parent and all the way to the root span. This means the entire trace is in error. However, sometimes the parent span will handle the error (eg. if parent name indicagtes 'retry') and the trace will be successful, even though an individual span has error.
|
|
48
|
-
- attributes captures various attributes involved in that span's operation
|
|
49
|
-
- attribute."span.type" indicates the type of operation
|
|
50
|
-
- When the span.type is "workflow", that span captures the summary of the entire application
|
|
51
|
-
- entity.[NUMBER] are the different entties involved in the operation, for example large language model, agent, tool etc
|
|
52
|
-
- entity.type indicates the type of that entity
|
|
53
|
-
- events is an array that captures the details of the operation such as input, output and metadata
|
|
54
|
-
- events array element with name=data.input captures the input provided to the operation
|
|
55
|
-
- events array element with name=data.output captures the output generated by the operation
|
|
56
|
-
- events array element with name=metaata captures the metadata of the operation
|
|
57
|
-
- total_tokens is the count of tokens
|
|
58
|
-
- completion_tokens is the count of ouput tokens
|
|
59
|
-
- prompt_tokens is the count of input tokens
|
|
60
|
-
- finish_type indicates how the operation finished, for example stop sequence or max tokens etc. If the finish_type is not success and indicates problems such as max tokens, then the operation is not successful. Check the status of it's parent span and check if it's due to the finish type of this child span. In that case callout the root cause as the child span error for the parent span error.
|
|
61
|
-
"""
|
|
62
|
-
|
|
63
|
-
@app.prompt(name="enable_tracing")
|
|
64
|
-
def enable_monocle_tracing_prompt(app_language: str = "python") -> str:
|
|
65
|
-
"""Trace agentic code"""
|
|
66
|
-
return enable_monocle_prompt.format(app_language=app_language)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
@app.prompt(name="analyze")
|
|
70
|
-
def analyze_monocle_tracing_prompt() -> str:
|
|
71
|
-
"""Identify root cause from trace"""
|
|
72
|
-
return monocle_trace_prompt
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
@click.command()
|
|
76
|
-
@click.option(
|
|
77
|
-
"--log-level",
|
|
78
|
-
default="info",
|
|
79
|
-
help="Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)",
|
|
80
|
-
)
|
|
81
|
-
def main(log_level: str) -> int:
|
|
82
|
-
# Configure logging
|
|
83
|
-
logging.basicConfig(
|
|
84
|
-
level=getattr(logging, log_level.upper()),
|
|
85
|
-
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
|
|
86
|
-
)
|
|
87
|
-
|
|
88
|
-
# Run the FastMCP server using stdio transport
|
|
89
|
-
app.run(transport="stdio")
|
|
90
|
-
return 0
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if __name__ == "__main__":
|
|
94
|
-
main() # type: ignore
|
|
File without changes
|
|
File without changes
|
|
File without changes
|