monocle-apptrace 0.1.0__tar.gz → 0.2.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.
Potentially problematic release.
This version of monocle-apptrace might be problematic. Click here for more details.
- monocle_apptrace-0.2.0/CHANGELOG.md +35 -0
- {monocle_apptrace-0.1.0 → monocle_apptrace-0.2.0}/Monocle_User_Guide.md +22 -4
- monocle_apptrace-0.2.0/PKG-INFO +115 -0
- monocle_apptrace-0.2.0/Pipfile.lock +478 -0
- monocle_apptrace-0.2.0/README.md +76 -0
- {monocle_apptrace-0.1.0 → monocle_apptrace-0.2.0}/pyproject.toml +9 -1
- monocle_apptrace-0.2.0/src/monocle_apptrace/README.md +101 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/exporters/aws/s3_exporter.py +158 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/exporters/azure/blob_exporter.py +128 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/exporters/base_exporter.py +47 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/exporters/exporter_processor.py +19 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/exporters/monocle_exporters.py +27 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/exporters/okahu/okahu_exporter.py +115 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/haystack/__init__.py +9 -0
- {monocle_apptrace-0.1.0 → monocle_apptrace-0.2.0}/src/monocle_apptrace/haystack/wrap_pipeline.py +18 -1
- {monocle_apptrace-0.1.0 → monocle_apptrace-0.2.0}/src/monocle_apptrace/instrumentor.py +15 -18
- monocle_apptrace-0.2.0/src/monocle_apptrace/langchain/__init__.py +9 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/llamaindex/__init__.py +16 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/metamodel/README.md +47 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/metamodel/entities/README.md +77 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/metamodel/entities/app_hosting_types.json +29 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/metamodel/entities/entities.json +49 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/metamodel/entities/inference_types.json +33 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/metamodel/entities/model_types.json +41 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/metamodel/entities/vector_store_types.json +25 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/metamodel/entities/workflow_types.json +22 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/metamodel/maps/attributes/inference/langchain_entities.json +35 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/metamodel/maps/attributes/inference/llamaindex_entities.json +35 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/metamodel/maps/attributes/retrieval/langchain_entities.json +27 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/metamodel/maps/attributes/retrieval/llamaindex_entities.json +27 -0
- monocle_apptrace-0.1.0/src/monocle_apptrace/wrapper_config/lang_chain_methods.json → monocle_apptrace-0.2.0/src/monocle_apptrace/metamodel/maps/langchain_methods.json +31 -8
- monocle_apptrace-0.1.0/src/monocle_apptrace/wrapper_config/llama_index_methods.json → monocle_apptrace-0.2.0/src/monocle_apptrace/metamodel/maps/llamaindex_methods.json +12 -8
- monocle_apptrace-0.2.0/src/monocle_apptrace/metamodel/spans/README.md +121 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/metamodel/spans/span_example.json +140 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/metamodel/spans/span_format.json +55 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/metamodel/spans/span_types.json +16 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/utils.py +172 -0
- monocle_apptrace-0.2.0/src/monocle_apptrace/wrap_common.py +417 -0
- {monocle_apptrace-0.1.0 → monocle_apptrace-0.2.0}/src/monocle_apptrace/wrapper.py +3 -1
- monocle_apptrace-0.1.0/CHANGELOG.md +0 -17
- monocle_apptrace-0.1.0/PKG-INFO +0 -77
- monocle_apptrace-0.1.0/Pipfile.lock +0 -46
- monocle_apptrace-0.1.0/README.md +0 -42
- monocle_apptrace-0.1.0/monocle_trace_file_test_0x8e5ff83c337b2649098910e1db3c8173_2024-08-27.json +0 -24
- monocle_apptrace-0.1.0/src/monocle_apptrace/README.md +0 -77
- monocle_apptrace-0.1.0/src/monocle_apptrace/haystack/__init__.py +0 -9
- monocle_apptrace-0.1.0/src/monocle_apptrace/langchain/__init__.py +0 -6
- monocle_apptrace-0.1.0/src/monocle_apptrace/llamaindex/__init__.py +0 -15
- monocle_apptrace-0.1.0/src/monocle_apptrace/utils.py +0 -73
- monocle_apptrace-0.1.0/src/monocle_apptrace/wrap_common.py +0 -268
- monocle_apptrace-0.1.0/storage/default__vector_store.json +0 -1
- monocle_apptrace-0.1.0/storage/docstore.json +0 -1
- monocle_apptrace-0.1.0/storage/graph_store.json +0 -1
- monocle_apptrace-0.1.0/storage/image__vector_store.json +0 -1
- monocle_apptrace-0.1.0/storage/index_store.json +0 -1
- {monocle_apptrace-0.1.0 → monocle_apptrace-0.2.0}/.gitignore +0 -0
- {monocle_apptrace-0.1.0 → monocle_apptrace-0.2.0}/CODEOWNERS.md +0 -0
- {monocle_apptrace-0.1.0 → monocle_apptrace-0.2.0}/CODE_OF_CONDUCT.md +0 -0
- {monocle_apptrace-0.1.0 → monocle_apptrace-0.2.0}/CONTRIBUTING.md +0 -0
- {monocle_apptrace-0.1.0 → monocle_apptrace-0.2.0}/COPYRIGHT.template +0 -0
- {monocle_apptrace-0.1.0 → monocle_apptrace-0.2.0}/LICENSE +0 -0
- {monocle_apptrace-0.1.0 → monocle_apptrace-0.2.0}/MAINTAINER.md +0 -0
- {monocle_apptrace-0.1.0 → monocle_apptrace-0.2.0}/Monocle_committer_guide.md +0 -0
- {monocle_apptrace-0.1.0 → monocle_apptrace-0.2.0}/Monocle_contributor_guide.md +0 -0
- {monocle_apptrace-0.1.0 → monocle_apptrace-0.2.0}/NOTICE +0 -0
- {monocle_apptrace-0.1.0 → monocle_apptrace-0.2.0}/SECURITY.md +0 -0
- {monocle_apptrace-0.1.0 → monocle_apptrace-0.2.0}/src/monocle_apptrace/__init__.py +0 -0
- {monocle_apptrace-0.1.0 → monocle_apptrace-0.2.0}/src/monocle_apptrace/constants.py +0 -0
- {monocle_apptrace-0.1.0 → monocle_apptrace-0.2.0}/src/monocle_apptrace/exporters/file_exporter.py +0 -0
- {monocle_apptrace-0.1.0 → monocle_apptrace-0.2.0}/src/monocle_apptrace/haystack/wrap_node.py +0 -0
- {monocle_apptrace-0.1.0 → monocle_apptrace-0.2.0}/src/monocle_apptrace/haystack/wrap_openai.py +0 -0
- {monocle_apptrace-0.1.0/src/monocle_apptrace/wrapper_config → monocle_apptrace-0.2.0/src/monocle_apptrace/metamodel/maps}/haystack_methods.json +0 -0
- {monocle_apptrace-0.1.0 → monocle_apptrace-0.2.0}/tox.ini +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
## 0.2.0 (Oct 22, 2024)
|
|
2
|
+
|
|
3
|
+
- Ndjson format for S3 and Blob exporters ([#61](https://github.com/monocle2ai/monocle/pull/61))
|
|
4
|
+
- Set monocle exporter from env setting ([#60](https://github.com/monocle2ai/monocle/pull/60))
|
|
5
|
+
- Update workflow name and type with new format ([#59](https://github.com/monocle2ai/monocle/pull/59))
|
|
6
|
+
- Updated async and custom output processor testcase for metamodel([#58](https://github.com/monocle2ai/monocle/pull/58))
|
|
7
|
+
- Build okahu exporter and added test cases for okahu exporte ([#56](https://github.com/monocle2ai/monocle/pull/56))
|
|
8
|
+
- Handle exception in span wrappers([#52](https://github.com/monocle2ai/monocle/pull/52))
|
|
9
|
+
- Metamodel entity changes ([#51](https://github.com/monocle2ai/monocle/pull/51)), ([#54](https://github.com/monocle2ai/monocle/pull/54))
|
|
10
|
+
- Error handling for llm_endpoint and tags ([#50](https://github.com/monocle2ai/monocle/pull/50))
|
|
11
|
+
- Context_output for vector store retriever ([#48](https://github.com/monocle2ai/monocle/pull/48))
|
|
12
|
+
- Direct exporter - AWS S3 ([#42](https://github.com/monocle2ai/monocle/pull/42))
|
|
13
|
+
- Direct Exporter - Blob store ([#41](https://github.com/monocle2ai/monocle/pull/41))
|
|
14
|
+
- Initial metamodel definition ([#39](https://github.com/monocle2ai/monocle/pull/39))
|
|
15
|
+
- Improvement in vectorstore traces ([#38](https://github.com/monocle2ai/monocle/pull/38))
|
|
16
|
+
- Update key for session context field in attributes ([#34](https://github.com/monocle2ai/monocle/pull/34))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## 0.1.0 (Aug 27, 2024)
|
|
20
|
+
|
|
21
|
+
- Fixed LlamaIndex tracing bugs ([#32](https://github.com/monocle2ai/monocle/pull/32))
|
|
22
|
+
- Added support to add AWS cloud infra attributes ([#29](https://github.com/monocle2ai/monocle/pull/29))
|
|
23
|
+
- Added support to add Azure cloud infra attributes ([#23](https://github.com/monocle2ai/monocle/pull/23))
|
|
24
|
+
- Added support for adding provider name in LLM span in traces ([#22](https://github.com/monocle2ai/monocle/pull/22))
|
|
25
|
+
- Added a default file span exporter ([#21](https://github.com/monocle2ai/monocle/pull/21))
|
|
26
|
+
- Moved input and output context and prompts from attributes to events ([#15](https://github.com/monocle2ai/monocle/pull/15))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## 0.0.1 (Jul 17, 2024)
|
|
34
|
+
|
|
35
|
+
- First monocle release
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#Monocle User Guide
|
|
1
|
+
# Monocle User Guide
|
|
2
2
|
|
|
3
3
|
## Monocle Concepts
|
|
4
4
|
### Traces
|
|
@@ -13,15 +13,27 @@ It’s typically the workflow code components of an application that generate th
|
|
|
13
13
|
```
|
|
14
14
|
> pip install monocle_apptrace
|
|
15
15
|
```
|
|
16
|
+
|
|
17
|
+
- For Azure support (to upload traces to Azure), install with the azure extra:
|
|
18
|
+
```
|
|
19
|
+
> pip install monocle_apptrace[azure]
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
- For AWS support (to upload traces to AWS), install with the aws extra:
|
|
23
|
+
```
|
|
24
|
+
> pip install monocle_apptrace[aws]
|
|
25
|
+
```
|
|
26
|
+
|
|
16
27
|
- You can locally build and install Monocle library from source
|
|
17
28
|
```
|
|
18
|
-
> pip install .
|
|
29
|
+
> pip install .
|
|
19
30
|
```
|
|
20
31
|
- Install the optional test dependencies listed against dev in pyproject.toml in editable mode
|
|
21
32
|
```
|
|
22
|
-
> pip install -e ".[dev]"
|
|
33
|
+
> pip install -e ".[dev]"
|
|
23
34
|
```
|
|
24
35
|
|
|
36
|
+
|
|
25
37
|
## Using Monocle with your application to generate traces
|
|
26
38
|
### Enable Monocle tracing
|
|
27
39
|
You need to import monocle package and invoke the API ``setup_monocle_telemetry(workflow=<workflow-name>)`` to enable the tracing. The 'workflow-name' is what you define to identify the give application workflow, for example "customer-chatbot". Monocle trace will include this name in every trace. The trace output will include a list of spans in the traces. You can print the output on the console or send it to an HTTP endpoint.
|
|
@@ -48,7 +60,7 @@ chain.invoke({"number":2})
|
|
|
48
60
|
# Request callbacks: Finally, let's use the request `callbacks` to achieve the same result
|
|
49
61
|
chain = LLMChain(llm=llm, prompt=prompt)
|
|
50
62
|
chain.invoke({"number":2}, {"callbacks":[handler]})
|
|
51
|
-
|
|
63
|
+
|
|
52
64
|
```
|
|
53
65
|
|
|
54
66
|
### Accessing monocle trace
|
|
@@ -63,6 +75,12 @@ setup_monocle_telemetry(workflow_name = "simple_math_app",
|
|
|
63
75
|
```
|
|
64
76
|
To print the trace on the console, use ```ConsoleSpanExporter()``` instead of ```FileSpanExporter()```
|
|
65
77
|
|
|
78
|
+
For Azure:
|
|
79
|
+
Install the Azure support as shown in the setup section, then use ```AzureBlobSpanExporter()``` to upload the traces to Azure.
|
|
80
|
+
|
|
81
|
+
For AWS:
|
|
82
|
+
Install the AWS support as shown in the setup section, then use ```S3SpanExporter()``` to upload the traces to an S3 bucket.
|
|
83
|
+
|
|
66
84
|
### Leveraging Monocle's extensibility to handle customization
|
|
67
85
|
When the out of box features from app frameworks are not sufficent, the app developers have to add custom code. For example, if you are extending a LLM class in LlamaIndex to use a model hosted in NVIDIA Triton. This new class is not know to Monocle. You can specify this new class method part of Monocle enabling API and it will be able to trace it.
|
|
68
86
|
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: monocle_apptrace
|
|
3
|
+
Version: 0.2.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
|
+
License-File: LICENSE
|
|
8
|
+
License-File: NOTICE
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT 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: wrapt>=1.14.0
|
|
18
|
+
Provides-Extra: aws
|
|
19
|
+
Requires-Dist: boto3==1.35.19; extra == 'aws'
|
|
20
|
+
Provides-Extra: azure
|
|
21
|
+
Requires-Dist: azure-storage-blob==12.22.0; extra == 'azure'
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: datasets==2.20.0; extra == 'dev'
|
|
24
|
+
Requires-Dist: faiss-cpu==1.8.0; extra == 'dev'
|
|
25
|
+
Requires-Dist: instructorembedding==1.0.1; extra == 'dev'
|
|
26
|
+
Requires-Dist: langchain-chroma==0.1.1; extra == 'dev'
|
|
27
|
+
Requires-Dist: langchain-community==0.2.5; extra == 'dev'
|
|
28
|
+
Requires-Dist: langchain-openai==0.1.8; extra == 'dev'
|
|
29
|
+
Requires-Dist: langchain==0.2.5; extra == 'dev'
|
|
30
|
+
Requires-Dist: llama-index-embeddings-huggingface==0.2.0; extra == 'dev'
|
|
31
|
+
Requires-Dist: llama-index-vector-stores-chroma==0.1.9; extra == 'dev'
|
|
32
|
+
Requires-Dist: llama-index==0.10.30; extra == 'dev'
|
|
33
|
+
Requires-Dist: numpy==1.26.4; extra == 'dev'
|
|
34
|
+
Requires-Dist: parameterized==0.9.0; extra == 'dev'
|
|
35
|
+
Requires-Dist: pytest==8.0.0; extra == 'dev'
|
|
36
|
+
Requires-Dist: sentence-transformers==2.6.1; extra == 'dev'
|
|
37
|
+
Requires-Dist: types-requests==2.31.0.20240106; extra == 'dev'
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
|
|
40
|
+
# Monocle for tracing GenAI app code
|
|
41
|
+
|
|
42
|
+
**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.
|
|
43
|
+
|
|
44
|
+
**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/).
|
|
45
|
+
|
|
46
|
+
## Why Monocle
|
|
47
|
+
|
|
48
|
+
Monocle is built for:
|
|
49
|
+
- **app developers** to trace their app code in any environment without lots of custom code decoration
|
|
50
|
+
- **platform engineers** to instrument apps in prod through wrapping instead of asking app devs to recode
|
|
51
|
+
- **GenAI component providers** to add observability features to their products
|
|
52
|
+
- **enterprises** to consume traces from GenAI apps in their existing open-source observability stack
|
|
53
|
+
|
|
54
|
+
Benefits:
|
|
55
|
+
- Monocle provides an implementation + package, not just a spec
|
|
56
|
+
- No expertise in OpenTelemetry spec required
|
|
57
|
+
- No bespoke implementation of that spec required
|
|
58
|
+
- No last-mile GenAI domain specific code required to instrument your app
|
|
59
|
+
- Monocle provides consistency
|
|
60
|
+
- Connect traces across app code executions, model inference or data retrievals
|
|
61
|
+
- No cleansing of telemetry data across GenAI component providers required
|
|
62
|
+
- Works the same in personal lab dev or org cloud prod environments
|
|
63
|
+
- Send traces to location that fits your scale, budget and observability stack
|
|
64
|
+
- Monocle is fully open source and community driven
|
|
65
|
+
- No vendor lock-in
|
|
66
|
+
- Implementation is transparent
|
|
67
|
+
- You can freely use or customize it to fit your needs
|
|
68
|
+
|
|
69
|
+
## What Monocle provides
|
|
70
|
+
|
|
71
|
+
- Easy to [use](#use-monocle) code instrumentation
|
|
72
|
+
- OpenTelemetry compatible format for [spans](src/monocle_apptrace/metamodel/spans/span_format.json).
|
|
73
|
+
- Community-curated and extensible [metamodel](src/monocle_apptrace/metamodel/README.md) for consisent tracing of GenAI components.
|
|
74
|
+
- Export to local and cloud storage
|
|
75
|
+
|
|
76
|
+
## Use Monocle
|
|
77
|
+
|
|
78
|
+
- Get the Monocle package
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
pip install monocle_apptrace
|
|
82
|
+
```
|
|
83
|
+
- Instrument your app code
|
|
84
|
+
- Import the Monocle package
|
|
85
|
+
```
|
|
86
|
+
from monocle_apptrace.instrumentor import setup_monocle_telemetry
|
|
87
|
+
```
|
|
88
|
+
- Setup instrumentation in your ```main()``` function
|
|
89
|
+
```
|
|
90
|
+
setup_monocle_telemetry(workflow_name="your-app-name")
|
|
91
|
+
```
|
|
92
|
+
- (Optionally) Modify config to alter where traces are sent
|
|
93
|
+
|
|
94
|
+
See [Monocle user guide](Monocle_User_Guide.md) for more details.
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
## Roadmap
|
|
98
|
+
|
|
99
|
+
Goal of Monocle is to support tracing for apps written in *any language* with *any LLM orchestration or agentic framework* and built using models, vectors, agents or other components served up by *any cloud or model inference provider*.
|
|
100
|
+
|
|
101
|
+
Current version supports:
|
|
102
|
+
- Language: (🟢) Python , (🔜) [Typescript](https://github.com/monocle2ai/monocle-typescript)
|
|
103
|
+
- LLM-frameworks: (🟢) Langchain, (🟢) Llamaindex, (🟢) Haystack, (🔜) Flask
|
|
104
|
+
- LLM inference providers: (🟢) OpenAI, (🟢) Azure OpenAI, (🟢) Nvidia Triton, (🔜) AWS Bedrock, (🔜) Google Vertex, (🔜) Azure ML, (🔜) Hugging Face
|
|
105
|
+
- Vector stores: (🟢) FAISS, (🔜) OpenSearch, (🔜) Milvus
|
|
106
|
+
- Exporter: (🟢) stdout, (🟢) file, (🔜) Azure Blob Storage, (🔜) AWS S3, (🔜) Google Cloud Storage
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
## Get involved
|
|
110
|
+
### Provide feedback
|
|
111
|
+
- Submit issues and enhancements requests via Github issues
|
|
112
|
+
|
|
113
|
+
### Contribute
|
|
114
|
+
- Monocle is community based open source project. We welcome your contributions. Please refer to the CONTRIBUTING and CODE_OF_CONDUCT for guidelines. The [contributor's guide](CONTRIBUTING.md) provides technical details of the project.
|
|
115
|
+
|