Skip to content

Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.

[Feat]: Added connection for middleware.io (#475)

naman-jain-15ecbf50c2fd7c
diff --git a/docs/images/middleware-dashboard-1.png b/docs/images/middleware-dashboard-1.png
new file mode 100644
index 00000000..020818bb
Binary files /dev/null and b/docs/images/middleware-dashboard-1.png differ
diff --git a/docs/images/middleware-dashboard-2.png b/docs/images/middleware-dashboard-2.png
new file mode 100644
index 00000000..1931f7e7
Binary files /dev/null and b/docs/images/middleware-dashboard-2.png differ
diff --git a/docs/images/middleware-dashboard-3.png b/docs/images/middleware-dashboard-3.png
new file mode 100644
index 00000000..498c3f0f
Binary files /dev/null and b/docs/images/middleware-dashboard-3.png differ
diff --git a/docs/images/middleware-dashboard-4.png b/docs/images/middleware-dashboard-4.png
new file mode 100644
index 00000000..6703bf11
Binary files /dev/null and b/docs/images/middleware-dashboard-4.png differ
diff --git a/docs/latest/connections/intro.mdx b/docs/latest/connections/intro.mdx
index 1c137195..16f6ccff 100644
--- a/docs/latest/connections/intro.mdx
+++ b/docs/latest/connections/intro.mdx
@@ -3110,6 +3110,29 @@ Below is a list of observability tools that work seamlessly with OpenLIT:
</svg>
}>
</Card>
+ <Card
+ title="Middleware"
+ href="/latest/connections/middleware"
+ icon={
+ <svg
+ viewBox="0 0 36 36"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <rect width="36" height="36" rx="4" fill="#5B5FC7" />
+ <path
+ d="M23.5214 18.4126C23.6548 18.2051 23.7616 18.053 23.8594 17.8916C24.5934 16.6746 25.314 15.4483 26.0835 14.2359C26.2238 13.9895 26.4342 13.7943 26.686 13.677C26.9377 13.5598 27.2183 13.5263 27.4892 13.5812C27.7514 13.6222 27.9928 13.753 28.175 13.9527C28.3572 14.1523 28.4696 14.4094 28.4945 14.683C28.5208 15.0141 28.4527 15.346 28.2987 15.6373C27.0948 17.6996 25.8671 19.748 24.6156 21.7825C24.0196 22.7506 22.8363 22.7045 22.2581 21.6903C21.5508 20.4963 20.8791 19.2793 20.1896 18.076C20.0962 17.9101 19.9939 17.7533 19.856 17.5228L19.3667 18.325C18.7084 19.436 18.0323 20.547 17.3739 21.6627C16.7156 22.7783 15.4612 22.7967 14.7895 21.6119C14.0333 20.2843 13.2816 18.9519 12.4987 17.5735C12.383 17.7533 12.2852 17.8962 12.2006 18.0345C11.4622 19.2516 10.7327 20.4733 9.97653 21.6857C9.88524 21.8422 9.7649 21.9785 9.62247 22.0865C9.48004 22.1945 9.31835 22.2721 9.14676 22.3149C8.97518 22.3577 8.7971 22.3648 8.62285 22.3358C8.4486 22.3068 8.28163 22.2423 8.1316 22.146C7.98158 22.0496 7.85149 21.9234 7.74885 21.7746C7.64622 21.6258 7.57309 21.4574 7.53368 21.2791C7.49428 21.1008 7.48939 20.9162 7.51931 20.7359C7.54922 20.5557 7.61333 20.3833 7.70794 20.2289C8.89413 18.2435 10.0996 16.2628 11.3243 14.2866C11.4466 14.0443 11.6318 13.8423 11.859 13.7034C12.0862 13.5645 12.3463 13.4941 12.61 13.5004C12.8738 13.5066 13.1306 13.5892 13.3514 13.7387C13.5723 13.8882 13.7484 14.0987 13.8598 14.3465C14.5315 15.5221 15.1943 16.7069 15.8571 17.8824C15.9505 18.0484 16.0528 18.2051 16.1818 18.4172L18.4415 14.6738C18.5394 14.5125 18.6328 14.3419 18.7484 14.1852C18.8804 13.9709 19.0642 13.7961 19.2816 13.6783C19.4989 13.5604 19.7422 13.5035 19.9873 13.5133C20.2325 13.5231 20.4708 13.5992 20.6788 13.7341C20.8867 13.8689 21.057 14.0578 21.1727 14.282C21.8622 15.4668 22.5072 16.6654 23.2011 17.8594C23.2901 18.0299 23.3879 18.1913 23.5214 18.4126Z"
+ fill="white"
+ />
+ <path
+ d="M25.228 13.7177C24.6499 14.6292 24.0968 15.5518 23.5526 16.46C23.3891 16.1706 23.2265 15.8801 23.0629 15.5878L23.0578 15.5788C22.7278 14.9892 22.3938 14.3926 22.0481 13.7981C21.8544 13.4331 21.5715 13.1211 21.2228 12.895L20.6788 13.7341L21.2228 12.895C20.8659 12.6636 20.4537 12.5312 20.0272 12.5141C19.6008 12.4971 19.1791 12.5962 18.8049 12.7992C18.4435 12.9952 18.1401 13.2803 17.9197 13.6245C17.8074 13.7812 17.7042 13.9563 17.6344 14.0746C17.6159 14.1059 17.5998 14.1333 17.5865 14.1552L17.5854 14.157L16.1997 16.4526C16.198 16.4497 16.1964 16.4468 16.1947 16.4438C15.7162 15.5933 15.2346 14.7372 14.749 13.887C14.5619 13.4943 14.2744 13.1559 13.912 12.9106L13.3555 13.7326L13.912 12.9106C13.5342 12.6548 13.0914 12.5115 12.6337 12.5007C12.1759 12.4898 11.7267 12.6121 11.3373 12.8503C10.9623 13.0795 10.6587 13.4063 10.4542 13.7922C9.23442 15.7608 8.03367 17.7341 6.85197 19.7119C6.69126 19.9757 6.58325 20.2681 6.53279 20.5722C6.482 20.8784 6.49026 21.1918 6.55724 21.4949C6.62423 21.798 6.74895 22.0862 6.92568 22.3424L7.74885 21.7746L6.92568 22.3424C7.10247 22.5987 7.3282 22.8185 7.59127 22.9874L7.59127 22.9874C7.85444 23.1564 8.14921 23.2708 8.45866 23.3223C8.76815 23.3738 9.08449 23.3611 9.3888 23.2852C9.69305 23.2093 9.9777 23.0721 10.2267 22.8833C10.4711 22.6979 10.6761 22.4667 10.8318 22.204C11.385 21.3168 11.9255 20.4224 12.4615 19.5353C12.5045 19.6112 12.5474 19.687 12.5903 19.7627C13.0367 20.5508 13.4783 21.3303 13.9201 22.106C14.3893 22.9331 15.1627 23.4922 16.0783 23.4999C16.9901 23.5076 17.7663 22.9654 18.2352 22.1709C18.5923 21.5656 18.9429 20.9814 19.2952 20.3942C19.4761 20.0928 19.6574 19.7906 19.8404 19.4844C19.9007 19.5909 19.961 19.6976 20.0215 19.8045C20.4714 20.5997 20.9273 21.4057 21.3939 22.1935C21.8286 22.9506 22.5571 23.4465 23.3911 23.479C24.2359 23.512 25.0025 23.0614 25.4672 22.3068L25.4674 22.3064C26.7228 20.2653 27.9545 18.2104 29.1623 16.1415L29.173 16.1233L29.1829 16.1046C29.4263 15.644 29.5326 15.1225 29.4913 14.6038L29.4914 14.6038L29.4904 14.5926C29.4461 14.1055 29.2456 13.6424 28.9137 13.2786L28.1757 13.952L28.9137 13.2786C28.5863 12.9198 28.1487 12.6776 27.6661 12.5969C27.1915 12.5054 26.7016 12.5666 26.2638 12.7705C25.8281 12.9734 25.4686 13.3059 25.228 13.7177Z"
+ stroke="white"
+ strokeOpacity="0.2"
+ strokeWidth="2"
+ />
+ </svg>
+ }>
+ </Card>
</CardGroup>
---
diff --git a/docs/latest/connections/middleware.mdx b/docs/latest/connections/middleware.mdx
new file mode 100644
index 00000000..32c64b17
--- /dev/null
+++ b/docs/latest/connections/middleware.mdx
@@ -0,0 +1,82 @@
+---
+title: 'Middleware'
+description: 'LLM Observability with Middleware and OpenLIT'
+---
+
+<Frame>
+ <img src="/images/middleware-dashboard-1.png" />
+ <img src="/images/middleware-dashboard-2.png" />
+</Frame>
+<Frame>
+ <img src="/images/middleware-dashboard-3.png" />
+ <img src="/images/middleware-dashboard-4.png" />
+</Frame>
+
+To send OpenTelemetry metrics and traces generated by OpenLIT from your LLM Application to Middleware, Follow the below steps.
+<Steps>
+ <Step title="Get your Middleware credentials">
+ <Steps>
+ 1. Sign in to your [Middleware](https://app.middleware.io/) account.
+ 2. Go to settings and click on API Key. [Link](https://app.middleware.io/settings/api-keys)
+ 3. Copy and save the value for `MW_API_KEY` and `MW_TARGET`
+ </Steps>
+ </Step>
+ <Step title="Add the following lines to your application code:">
+ <Tabs>
+ <Tab title="Setup using function arguments">
+ ```python
+ import openlit
+
+ openlit.init(
+ otlp_endpoint="MW_TARGET",
+ application_name="YOUR_APPLICATION_NAME",
+ otlp_headers={
+ "Authorization": "MW_API_KEY",
+ "X-Trace-Source": "openlit",
+ },
+ )
+ ```
+ </Tab>
+ <Tab title="Setup using Environment Variables">
+ ```python
+ import openlit
+
+ openlit.init()
+ ```
+
+ Run the following command to configure the OTEL endpoint and headers to send metrics and traces to Middleware:
+ ```shell
+ export OPENLIT_OTLP_ENDPOINT="MW_TARGET"
+ export OPENLIT_APPLICATION_NAME="YOUR_APPLICATION_NAME"
+ export OPENLIT_OTLP_HEADERS='{"Authorization": "MW_API_KEY", "X-Trace-Source": "openlit"}'
+ ```
+ </Tab>
+
+ </Tabs>
+
+ Replace:
+ 1. `MW_TARGET` with your middleware target URL
+ * Example - `https://abcd.middleware.io:443`
+ 2. `MW_API_KEY` with your middleware API key.
+ * Example - dxyxsdojzrgpsvizzzcsvhrwnmzqdsdsd
+
+ Refer to the OpenLIT [Python SDK repository](https://github.com/openlit/openlit/tree/main/sdk/python) for more advanced configurations and use cases.
+
+ For detailed information on LLM Observability with Middleware and OpenLIT, consult Middleware Documentation:
+ [LLM Observability Documentation](https://docs.middleware.io/llm-observability/overview).
+ </Step>
+
+ <Step title="Visualize in Middleware">
+ Once your LLM application is instrumented, you can view the traces, metrics and dashboards in the Middleware LLM Observability section. To access this:
+ 1. Log in to your Middleware account
+ 2. Navigate to the [LLM Observability Section](https://app.middleware.io/llm) in the sidebar
+ </Step>
+</Steps>
+
+---
+
+<CardGroup cols={2}>
+<Card title="Integrations" href="/latest/integrations/introduction" icon='circle-nodes'>
+Start Monitoring your LLM Application
+</Card>
+</CardGroup>
\ No newline at end of file
diff --git a/docs/mint.json b/docs/mint.json
index 923cf5f6..a32e175e 100644
--- a/docs/mint.json
+++ b/docs/mint.json
@@ -148,7 +148,8 @@
"latest/connections/dynatrace",
"latest/connections/openobserve",
"latest/connections/highlight",
- "latest/connections/murnitur"
+ "latest/connections/murnitur",
+ "latest/connections/middleware"
],
"version": "latest"
},