feenion 0.1.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.
Files changed (59) hide show
  1. feenion-0.1.0/LICENSE +177 -0
  2. feenion-0.1.0/PKG-INFO +366 -0
  3. feenion-0.1.0/README.md +300 -0
  4. feenion-0.1.0/feenion.egg-info/PKG-INFO +366 -0
  5. feenion-0.1.0/feenion.egg-info/SOURCES.txt +57 -0
  6. feenion-0.1.0/feenion.egg-info/dependency_links.txt +1 -0
  7. feenion-0.1.0/feenion.egg-info/entry_points.txt +2 -0
  8. feenion-0.1.0/feenion.egg-info/requires.txt +49 -0
  9. feenion-0.1.0/feenion.egg-info/top_level.txt +2 -0
  10. feenion-0.1.0/pyproject.toml +109 -0
  11. feenion-0.1.0/sdk/feenion/__init__.py +83 -0
  12. feenion-0.1.0/sdk/feenion/context.py +25 -0
  13. feenion-0.1.0/sdk/feenion/exporters/__init__.py +14 -0
  14. feenion-0.1.0/sdk/feenion/exporters/async_exporter.py +116 -0
  15. feenion-0.1.0/sdk/feenion/exporters/base.py +61 -0
  16. feenion-0.1.0/sdk/feenion/exporters/console.py +23 -0
  17. feenion-0.1.0/sdk/feenion/exporters/http.py +94 -0
  18. feenion-0.1.0/sdk/feenion/exporters/jsonl.py +34 -0
  19. feenion-0.1.0/sdk/feenion/integrations/__init__.py +20 -0
  20. feenion-0.1.0/sdk/feenion/integrations/anthropic.py +69 -0
  21. feenion-0.1.0/sdk/feenion/integrations/azure.py +188 -0
  22. feenion-0.1.0/sdk/feenion/integrations/gemini.py +91 -0
  23. feenion-0.1.0/sdk/feenion/integrations/langchain.py +319 -0
  24. feenion-0.1.0/sdk/feenion/integrations/openai.py +76 -0
  25. feenion-0.1.0/sdk/feenion/models.py +187 -0
  26. feenion-0.1.0/sdk/feenion/pricing.py +172 -0
  27. feenion-0.1.0/sdk/feenion/py.typed +0 -0
  28. feenion-0.1.0/sdk/feenion/redaction.py +74 -0
  29. feenion-0.1.0/sdk/feenion/replay.py +48 -0
  30. feenion-0.1.0/sdk/feenion/sampling.py +41 -0
  31. feenion-0.1.0/sdk/feenion/serializer.py +117 -0
  32. feenion-0.1.0/sdk/feenion/tracer.py +307 -0
  33. feenion-0.1.0/server/feenion_server/api/admin.py +116 -0
  34. feenion-0.1.0/server/feenion_server/api/ingestion.py +66 -0
  35. feenion-0.1.0/server/feenion_server/api/query.py +1284 -0
  36. feenion-0.1.0/server/feenion_server/auth.py +79 -0
  37. feenion-0.1.0/server/feenion_server/config.py +26 -0
  38. feenion-0.1.0/server/feenion_server/db.py +128 -0
  39. feenion-0.1.0/server/feenion_server/main.py +86 -0
  40. feenion-0.1.0/server/feenion_server/models.py +51 -0
  41. feenion-0.1.0/server/feenion_server/queue.py +60 -0
  42. feenion-0.1.0/server/feenion_server/retention.py +55 -0
  43. feenion-0.1.0/server/feenion_server/store.py +104 -0
  44. feenion-0.1.0/server/feenion_server/worker.py +148 -0
  45. feenion-0.1.0/server/feenion_server/ws.py +24 -0
  46. feenion-0.1.0/setup.cfg +4 -0
  47. feenion-0.1.0/tests/test_admin.py +38 -0
  48. feenion-0.1.0/tests/test_async_exporter.py +49 -0
  49. feenion-0.1.0/tests/test_async_tracing.py +41 -0
  50. feenion-0.1.0/tests/test_azure_integration.py +103 -0
  51. feenion-0.1.0/tests/test_backend_pipeline.py +86 -0
  52. feenion-0.1.0/tests/test_concurrency.py +52 -0
  53. feenion-0.1.0/tests/test_integrations.py +89 -0
  54. feenion-0.1.0/tests/test_langchain.py +56 -0
  55. feenion-0.1.0/tests/test_mock_ecosystem.py +56 -0
  56. feenion-0.1.0/tests/test_pricing.py +36 -0
  57. feenion-0.1.0/tests/test_serializer.py +60 -0
  58. feenion-0.1.0/tests/test_server.py +104 -0
  59. feenion-0.1.0/tests/test_tracing.py +86 -0
feenion-0.1.0/LICENSE ADDED
@@ -0,0 +1,177 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
feenion-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,366 @@
1
+ Metadata-Version: 2.4
2
+ Name: feenion
3
+ Version: 0.1.0
4
+ Summary: Open-source, self-hosted AI debugging and observability engine for LLMs, RAG, and autonomous agents.
5
+ Author-email: Darshan <hello@feenion.fun>
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://feenion.fun
8
+ Project-URL: Documentation, https://feenion.fun/docs
9
+ Project-URL: Repository, https://github.com/DarshanAguru/feenion.git
10
+ Project-URL: Issues, https://github.com/DarshanAguru/feenion/issues
11
+ Project-URL: Changelog, https://github.com/DarshanAguru/feenion/releases
12
+ Keywords: ai,llm,observability,tracing,debugging,rag,agents,opentelemetry,langchain,openai,anthropic
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Software Development :: Bug Tracking
21
+ Classifier: Topic :: Software Development :: Quality Assurance
22
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
+ Requires-Python: >=3.10
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: pydantic>=2.0.0
27
+ Requires-Dist: pydantic-settings>=2.0.0
28
+ Requires-Dist: requests>=2.28.0
29
+ Provides-Extra: server
30
+ Requires-Dist: fastapi>=0.110.0; extra == "server"
31
+ Requires-Dist: uvicorn[standard]>=0.30.0; extra == "server"
32
+ Requires-Dist: sqlalchemy>=2.0.0; extra == "server"
33
+ Provides-Extra: postgres
34
+ Requires-Dist: asyncpg>=0.29.0; extra == "postgres"
35
+ Requires-Dist: psycopg2-binary>=2.9.0; extra == "postgres"
36
+ Provides-Extra: redis
37
+ Requires-Dist: redis>=5.0.0; extra == "redis"
38
+ Provides-Extra: gemini
39
+ Requires-Dist: google-genai>=0.1.0; extra == "gemini"
40
+ Provides-Extra: openai
41
+ Requires-Dist: openai>=1.0.0; extra == "openai"
42
+ Provides-Extra: azure
43
+ Requires-Dist: openai>=1.0.0; extra == "azure"
44
+ Provides-Extra: anthropic
45
+ Requires-Dist: anthropic>=0.18.0; extra == "anthropic"
46
+ Provides-Extra: langchain
47
+ Requires-Dist: langchain-core>=0.1.0; extra == "langchain"
48
+ Provides-Extra: all
49
+ Requires-Dist: fastapi>=0.110.0; extra == "all"
50
+ Requires-Dist: uvicorn[standard]>=0.30.0; extra == "all"
51
+ Requires-Dist: sqlalchemy>=2.0.0; extra == "all"
52
+ Requires-Dist: asyncpg>=0.29.0; extra == "all"
53
+ Requires-Dist: redis>=5.0.0; extra == "all"
54
+ Requires-Dist: google-genai>=0.1.0; extra == "all"
55
+ Requires-Dist: openai>=1.0.0; extra == "all"
56
+ Requires-Dist: anthropic>=0.18.0; extra == "all"
57
+ Requires-Dist: langchain-core>=0.1.0; extra == "all"
58
+ Provides-Extra: dev
59
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
60
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
61
+ Requires-Dist: httpx>=0.27.0; extra == "dev"
62
+ Requires-Dist: build>=1.0.0; extra == "dev"
63
+ Requires-Dist: twine>=5.0.0; extra == "dev"
64
+ Requires-Dist: ruff>=0.4.0; extra == "dev"
65
+ Dynamic: license-file
66
+
67
+ <p align="center">
68
+ <img src="assets/icon.svg" width="72" height="72" alt="Feenion Icon" />
69
+ </p>
70
+
71
+ <h1 align="center">Feenion</h1>
72
+
73
+ <p align="center">
74
+ <strong>Open-source, self-hosted AI debugging and observability platform.</strong><br/>
75
+ <em>Debug AI systems like you debug production software.</em>
76
+ </p>
77
+
78
+ <p align="center">
79
+ <a href="https://feenion.fun">Website</a> β€’
80
+ <a href="https://feenion.fun/docs">Documentation</a> β€’
81
+ <a href="https://feenion.fun/architecture">Architecture</a> β€’
82
+ <a href="https://feenion.fun/examples">Examples</a> β€’
83
+ <a href="#quickstart">Quickstart</a>
84
+ </p>
85
+
86
+ <p align="center">
87
+ <img src="https://img.shields.io/badge/License-Apache_2.0-indigo.svg" alt="License" />
88
+ <img src="https://img.shields.io/badge/Python-3.10%2B-brightgreen.svg" alt="Python" />
89
+ <img src="https://img.shields.io/badge/Docker-Self--Hosted-blue.svg" alt="Docker" />
90
+ <img src="https://img.shields.io/badge/FastAPI-Async-009688.svg" alt="FastAPI" />
91
+ <img src="https://img.shields.io/badge/React-18-61DAFB.svg" alt="React" />
92
+ <img src="https://img.shields.io/badge/PRs-Welcome-brightgreen.svg" alt="PRs Welcome" />
93
+ </p>
94
+
95
+ ---
96
+
97
+ ## ⚑ What is Feenion?
98
+
99
+ **Feenion** is an open-source, self-hosted developer observability engine built specifically for LLM applications, RAG pipelines, and autonomous multi-step agents.
100
+
101
+ Traditional APM tools only report flat HTTP timeouts or generic exceptions. Feenion captures the **entire internal execution story**:
102
+
103
+ ```text
104
+ User Query
105
+ β”‚
106
+ β–Ό
107
+ [ Agent Reasoning ] ──► [ Vector Retrieval (top_k=5) ]
108
+ β”‚
109
+ β–Ό
110
+ [ Tool Execution (db.query) ] ──► [ LLM Synthesis (gpt-4o) ]
111
+ β”‚
112
+ β–Ό
113
+ Response + Exact Tokens + Exact Cost + Critical Path Latency
114
+ ```
115
+
116
+ ### πŸ”’ 100% Self-Hosted & Privacy-First
117
+ - **Zero Cloud Leakage**: Your proprietary prompts, vector embeddings, retrieved documents, and API keys never leave your infrastructure.
118
+ - **Lightweight (< 40MB RAM)**: Embedded single-container mode runs SQLite with Write-Ahead Logging (WAL) alongside your local Ollama or cloud models.
119
+ - **Non-Blocking Ingestion**: Background worker threads decouple trace export from application execution so user requests are never delayed.
120
+
121
+ ---
122
+
123
+ ## πŸš€ Quickstart
124
+
125
+ ### 1. Launch Feenion Server with Docker
126
+
127
+ ```bash
128
+ git clone https://github.com/DarshanAguru/feenion.git
129
+ cd feenion
130
+ docker compose up -d
131
+ ```
132
+
133
+ Open **[http://localhost:8000](http://localhost:8000)** to view the live dashboard.
134
+
135
+ ### 2. Install the Python SDK
136
+
137
+ ```bash
138
+ pip install feenion
139
+ ```
140
+
141
+ ### 3. Trace Your First Function
142
+
143
+ ```python
144
+ from feenion import trace, span, configure
145
+
146
+ # Configure target Feenion server
147
+ configure(server_url="http://localhost:8000")
148
+
149
+ @trace(name="customer_support_agent", span_type="agent")
150
+ def handle_support_query(user_query: str):
151
+ with span("vector_kb_search", span_type="retrieval", input={"query": user_query}):
152
+ docs = search_knowledge_base(user_query)
153
+
154
+ with span("llm_synthesis", span_type="llm"):
155
+ return generate_answer(user_query, docs)
156
+
157
+ handle_support_query("How do I rotate my API keys?")
158
+ ```
159
+
160
+ ---
161
+
162
+ ## πŸ—οΈ System Architecture
163
+
164
+ ```text
165
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
166
+ β”‚ YOUR PYTHON APPLICATION β”‚
167
+ β”‚ FastAPI β€’ LangChain β€’ LlamaIndex β€’ Autogen β€’ CrewAI β”‚
168
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
169
+ β”‚
170
+ Feenion SDK
171
+ (ContextVar + Async Queue)
172
+ β”‚
173
+ β–Ό Non-blocking HTTP Batches
174
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
175
+ β”‚ FEENION INGESTION API β”‚
176
+ β”‚ FastAPI β€’ Python 3.12 Runtime β”‚
177
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
178
+ β”‚ β”‚
179
+ β–Ό β–Ό
180
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
181
+ β”‚ STORAGE ENGINE β”‚ β”‚ WEBSOCKET BROADCASTER β”‚
182
+ β”‚ SQLite WAL / PostgreSQL β”‚ β”‚ Live Telemetry Stream β”‚
183
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
184
+ β”‚ β”‚
185
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
186
+ β–Ό
187
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
188
+ β”‚ FEENION REACT DASHBOARD β”‚
189
+ β”‚ Waterfall Timeline β€’ D3 Mindmaps β€’ Error Intelligence β”‚
190
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
191
+ ```
192
+
193
+ ---
194
+
195
+ ## 🧩 Framework Integrations
196
+
197
+ ### 1. OpenAI Auto-Instrumentation
198
+
199
+ ```python
200
+ from openai import OpenAI
201
+ from feenion.integrations.openai import instrument_openai
202
+
203
+ client = OpenAI()
204
+ instrument_openai(client)
205
+
206
+ # All chat completions now record prompt/completion tokens, duration, and calculated cost!
207
+ response = client.chat.completions.create(
208
+ model="gpt-4o",
209
+ messages=[{"role": "user", "content": "Explain raft consensus."}]
210
+ )
211
+ ```
212
+
213
+ ### 2. Google Gemini Auto-Instrumentation
214
+
215
+ ```python
216
+ from google import genai
217
+ from feenion.integrations.gemini import instrument_gemini
218
+
219
+ client = genai.Client()
220
+ instrument_gemini(client)
221
+
222
+ response = client.models.generate_content(
223
+ model="gemini-2.0-flash",
224
+ contents="Explain vector embeddings in machine learning."
225
+ )
226
+ ```
227
+
228
+ ### 3. Anthropic Auto-Instrumentation
229
+
230
+ ```python
231
+ from anthropic import Anthropic
232
+ from feenion.integrations.anthropic import instrument_anthropic
233
+
234
+ client = Anthropic()
235
+ instrument_anthropic(client)
236
+
237
+ response = client.messages.create(
238
+ model="claude-3-5-sonnet-20241022",
239
+ max_tokens=1024,
240
+ messages=[{"role": "user", "content": "Analyze system architecture."}]
241
+ )
242
+ ```
243
+
244
+ ### 4. LangChain Native Callback
245
+
246
+ ```python
247
+ from langchain_openai import ChatOpenAI
248
+ from langchain_core.prompts import ChatPromptTemplate
249
+ from feenion.integrations.langchain import FeenionCallbackHandler
250
+
251
+ handler = FeenionCallbackHandler()
252
+ llm = ChatOpenAI(model="gpt-4o", callbacks=[handler])
253
+
254
+ prompt = ChatPromptTemplate.from_template("Summarize: {topic}")
255
+ chain = prompt | llm
256
+ chain.invoke({"topic": "Distributed Tracing"}, config={"callbacks": [handler]})
257
+ ```
258
+
259
+ ### 5. Zero-Key Comprehensive Mock AI Ecosystem
260
+
261
+ Run the standalone executable mock demo mimicking Gemini, OpenAI, Claude, RAG retrievers, and Model Context Protocol (MCP) tools:
262
+
263
+ ```bash
264
+ python examples/comprehensive_mock_ecosystem.py
265
+ ```
266
+
267
+ ### 6. Client-Side Sensitive PII & Secret Redaction
268
+
269
+ ```python
270
+ from feenion.redaction import Redactor
271
+
272
+ # Custom sensitive keys are automatically masked before payloads leave application memory
273
+ redactor = Redactor(sensitive_keys={"api_key", "password", "auth_token", "ssn"})
274
+ ```
275
+
276
+ ---
277
+
278
+ ## πŸ“Š Core Observability Features
279
+
280
+ - ⏱️ **Distributed Waterfall Timeline**: Interactive time-scale flamegraphs with critical path highlights and duration percentiles (p50, p75, p90, p95, p99).
281
+ - 🌳 **D3 Mind Map DAG**: Hierarchical execution trees with link distances scaled proportionally to latency.
282
+ - 🎯 **Error Intelligence**: Semantic error fingerprinting that clusters identical exceptions and links to root cause spans.
283
+ - πŸ€– **Model Analytics Matrix**: Comprehensive breakdown of prompt vs completion tokens, cumulative spend ($), and cost per 1K tokens by model.
284
+ - ⏸️ **High-Velocity Feed Freeze**: Pause incoming live streams (`⏸️ Pause Feed`) during high-traffic bursts to inspect traces without viewport jumping.
285
+ - πŸ” **Comparative Trace Regression Diff**: Side-by-side comparison modal to isolate why Trace A was 3x slower or used 4x more tokens than Trace B.
286
+
287
+ ---
288
+
289
+ ## βš™οΈ Configuration Options
290
+
291
+ | Variable | Default | Description |
292
+ | :--- | :--- | :--- |
293
+ | `FEENION_DATABASE_URL` | `sqlite:////app/data/feenion.db` | Storage connection string (SQLite WAL or PostgreSQL) |
294
+ | `FEENION_REDIS_URL` | `""` | Optional Redis URL for distributed asynchronous queues |
295
+ | `FEENION_LOG_LEVEL` | `INFO` | Logging level (`DEBUG`, `INFO`, `WARNING`, `ERROR`) |
296
+ | `FEENION_RETENTION_DAYS` | `30` | Auto-retention period for trace telemetry |
297
+
298
+ ---
299
+
300
+ ## πŸ› οΈ Local Development & Contributing
301
+
302
+ Contributions are welcome! Feenion is built in the open.
303
+
304
+ ```bash
305
+ # 1. Clone repo
306
+ git clone https://github.com/DarshanAguru/feenion.git
307
+ cd feenion
308
+
309
+ # 2. Setup Python environment
310
+ python3 -m venv .venv
311
+ source .venv/bin/activate
312
+ pip install -r server/requirements.txt
313
+ pip install -e ".[dev]"
314
+
315
+ # 3. Run test suite
316
+ pytest
317
+
318
+ # 4. Build Frontend UI
319
+ cd web
320
+ npm install
321
+ npm run build
322
+ ```
323
+
324
+ ---
325
+
326
+ ## πŸ“‘ REST & WebSocket API
327
+
328
+ The Feenion telemetry server provides high-performance asynchronous endpoints for ingestion, exploration, deep analytics, and live WebSocket push:
329
+
330
+ | Category | Key Endpoints | Description |
331
+ | -------- | ------------- | ----------- |
332
+ | **Ingestion** | `POST /api/v1/traces`<br/>`WS /api/v1/ws/telemetry` | High-throughput batch ingestion (with Gzip support) and real-time live event streaming. |
333
+ | **Queries** | `GET /api/v1/traces`<br/>`GET /api/v1/traces/{id}`<br/>`GET /api/v1/traces/{id}/spans` | Multi-dimensional trace search, full causality tree, and child span hierarchy. |
334
+ | **Analytics** | `GET /api/v1/analytics/overview`<br/>`GET /api/v1/analytics/models`<br/>`GET /api/v1/analytics/tools`<br/>`GET /api/v1/analytics/retrieval`<br/>`GET /api/v1/analytics/agents`<br/>`GET /api/v1/errors` | System health scores, latency percentiles (p50-p99), model token economics, tool calling stats, RAG metrics, and error clustering. |
335
+ | **Workspaces** | `GET /api/v1/projects`<br/>`POST /api/v1/projects`<br/>`DELETE /api/v1/projects/{id}` | Multi-tenant workspace management and API key provisioning. |
336
+ | **Admin** | `DELETE /api/v1/admin/traces`<br/>`POST /api/v1/admin/traces/batch-delete`<br/>`DELETE /api/v1/admin/traces/{id}` | Telemetry database purge, batch trace deletion, and single trace removal. |
337
+ | **Probes** | `GET /health`<br/>`GET /ready` | Liveness and readiness health probes for container orchestrators. |
338
+
339
+ For detailed payloads, schemas, query parameters, and cURL examples, see the **[Full API Specification](docs/api.md)** or the **[Interactive Web Documentation](https://feenion.fun/docs#api-reference)**.
340
+
341
+ ---
342
+
343
+ ## πŸ—ΊοΈ Project Roadmap
344
+
345
+ - [x] Python SDK with non-blocking async batch exporter
346
+ - [x] Google Gemini, OpenAI, Anthropic, and LangChain auto-instrumentation
347
+ - [x] Zero-key interactive CLI debugging simulator (`examples/comprehensive_mock_ecosystem.py`)
348
+ - [x] Waterfall distributed timeline & D3 latency mind map
349
+ - [x] Semantic error grouping & stack trace viewer
350
+ - [x] Model economics & prompt inflation analytics
351
+ - [x] Workspace & project lifecycle management with cascade deletion
352
+ - [ ] TypeScript / Node.js SDK
353
+ - [ ] OpenTelemetry (OTel) Collector receiver
354
+ - [ ] Automated RAG context evaluation metrics (Faithfulness & Relevance)
355
+
356
+ ---
357
+
358
+ ## πŸ“„ License & Credits
359
+
360
+ Feenion is open-source software licensed under the **[Apache License 2.0](LICENSE)**.
361
+
362
+ <p align="center">
363
+ <sub>copyright &copy; 2026 feenion &bull; made with ❀️ by <a href="https://thisdarshiii.in"><strong>A.Darshan</strong></a></sub>
364
+ </p>
365
+
366
+