-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17943 from newrelic/daily-release/Jul-9-2024-3_27
daily-release/Jul-9-2024-3_27
- Loading branch information
Showing
9 changed files
with
127 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 111 additions & 0 deletions
111
...y/get-started/traceloop-llm-observability/traceloop-llm-observability-intro.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
--- | ||
title: 'Traceloop LLM observability with OpenLLMetry' | ||
tags: | ||
- Integrations | ||
- LLM observability with OpenTelemetry | ||
- OpenTelemetry | ||
- OpenLLMetry | ||
- Traceloop | ||
metaDescription: Set up OpenTelemetry-based Traceloop LLM observability with New Relic. | ||
freshnessValidatedDate: 2024-07-02 | ||
--- | ||
|
||
import llmTraceloopDashboard from 'images/llm-traceloop_screenshot.webp' | ||
|
||
import llmTraceloopAttributes from 'images/llm-traceloop-attributes_screenshot.webp' | ||
|
||
import llmTraceloopDetails from 'images/llm-traceloop-details_screenshot.webp' | ||
|
||
While OpenTelemetry offers a powerful standard for collecting general application data (traces, metrics, logs), it lacks the ability to capture key performance indicators (KPIs) specific to AI models. This includes crucial metrics like model name, version, prompt and completion tokens, and temperature parameters. These details are essential for effectively monitoring and troubleshooting AI model performance. | ||
|
||
<img | ||
title="LLM Traceloop Attributes" | ||
alt="LLM Traceloop Attributes" | ||
src={llmTraceloopAttributes} | ||
/> | ||
|
||
OpenLLMetry emerges as a solution, specifically designed to address this gap in AI model observability. Built on top of the OpenTelemetry framework, OpenLLMetry provides seamless integration and extends its capabilities. It offers support for popular AI frameworks like OpenAI, HuggingFace, Pinecone, and LangChain. | ||
|
||
<DNT>**Key Benefits of OpenLLMetry:**</DNT> | ||
* <DNT>**Standardized Collection of AI Model KPIs:**</DNT> OpenLLMetry ensures consistent capture of essential model performance metrics, enabling comprehensive observability across diverse frameworks. | ||
* <DNT>**Deeper Insights into LLM Applications:**</DNT> With its open-source SDK, OpenLLMetry empowers you to gain thorough understanding of your Large Language Model (LLM) applications. | ||
This page describes common set up steps for OpenTelemetry based APM monitoring with New Relic. | ||
|
||
OpenLLMetry empowers developers to leverage the strengths of OpenTelemetry while gaining the additional functionalities required for effective AI model monitoring and performance optimization. | ||
|
||
## Before you start [#prereqs] | ||
|
||
* [Sign up](https://newrelic.com/signup) for a New Relic account. | ||
* Get the [license key](https://one.newrelic.com/launcher/api-keys-ui.launcher) for the New Relic account to which you want to report data. | ||
|
||
<Steps> | ||
<Step> | ||
## Instrument your LLM Model with OpenLLMetry [#instrument] | ||
|
||
Since New Relic natively supports OpenTelemetry, you just need to route the traces to New Relic’s endpoint and set the API key: | ||
|
||
```env | ||
TRACELOOP_BASE_URL = https://otlp.nr-data.net:443 | ||
TRACELOOP_HEADERS = "api-key=<YOUR_NEWRELIC_LICENSE_KEY>" | ||
``` | ||
|
||
* The OpenTelemetry Protocol (OTLP) exporter sends data to the [New Relic OTLP endpoint](/docs/opentelemetry/best-practices/opentelemetry-otlp). | ||
|
||
<DNT>**Example: OpenAI LLM Model with LangChain**</DNT> | ||
```python | ||
from traceloop.sdk import Traceloop | ||
import os | ||
import time | ||
from langchain_openai import ChatOpenAI | ||
from traceloop.sdk.decorators import workflow, task | ||
|
||
os.environ['OPENAI_API_KEY'] = 'OPENAI_API_KEY' | ||
os.environ['TRACELOOP_BASE_URL'] = 'https://otlp.nr-data.net:443' | ||
os.environ['TRACELOOP_HEADERS'] = 'api-key=YOUR_NEWRELIC_LICENSE_KEY' | ||
|
||
Traceloop.init(app_name="llm-test", disable_batch=True) | ||
|
||
def add_prompt_context(): | ||
llm = ChatOpenAI( | ||
model="gpt-3.5-turbo", | ||
temperature=0) | ||
chain = llm | ||
return chain | ||
|
||
def prep_prompt_chain(): | ||
return add_prompt_context() | ||
|
||
def prompt_question(): | ||
chain = prep_prompt_chain() | ||
return chain.invoke("explain the business of company Newrelic and it's advantages in a max of 50 words") | ||
|
||
if __name__ == "__main__": | ||
print(prompt_question()) | ||
``` | ||
</Step> | ||
|
||
<Step> | ||
## View your data in the New Relic UI [#view-data] | ||
|
||
Once your app is instrumented and configured to export data to New Relic, you should be able to find your data in the New Relic UI: | ||
|
||
* Find your entity at <DNT>**All entities -> Services - OpenTelemetry**</DNT>. The entity name is set to the value of the app's `service.name` resource attribute. For more information on how New Relic service entities are derived from OpenTelemetry resource attributes, see [Services](/docs/opentelemetry/best-practices/opentelemetry-best-practices-resources/#services) | ||
<img | ||
title="LLM Traceloop Application" | ||
alt="LLM Traceloop Application" | ||
src={llmTraceloopDashboard} | ||
/> | ||
|
||
<img | ||
title="LLM Traceloop Details" | ||
alt="LLM Traceloop Details" | ||
src={llmTraceloopDetails} | ||
/> | ||
* Use [NRQL](/docs/nrql/get-started/introduction-nrql-new-relics-query-language/) to query directly for [traces](https://one.newrelic.com/launcher/nr1-core.explorer?overlay=eyJuZXJkbGV0SWQiOiJkYXRhLWV4cGxvcmF0aW9uLnF1ZXJ5LWJ1aWxkZXIiLCJpbml0aWFsQWN0aXZlSW50ZXJmYWNlIjoibnJxbEVkaXRvciIsImluaXRpYWxOcnFsVmFsdWUiOiIiLCJpbml0aWFsUXVlcmllcyI6W3sibnJxbCI6IkZST00gU3BhbiBTRUxFQ1QgY291bnQoKikgd2hlcmUgbmV3cmVsaWMuc291cmNlPSclb3RscCUnIFRJTUVTRVJJRVMifV0sImluaXRpYWxDaGFydFNldHRpbmdzIjp7ImNoYXJ0VHlwZSI6IkNIQVJUX0xJTkUiLCJsaW1pdCI6NzU0MiwibGlua2VkRW50aXR5R3VpZCI6bnVsbCwibGlua2VkRGFzaGJvYXJkSWQiOm51bGwsInlTY2FsZSI6eyJzdGF0aWMiOmZhbHNlLCJkb21haW4iOltudWxsLG51bGxdfSwieVplcm8iOnRydWV9fQo=), [metrics](https://one.newrelic.com/launcher/nr1-core.explorer?overlay=eyJuZXJkbGV0SWQiOiJkYXRhLWV4cGxvcmF0aW9uLnF1ZXJ5LWJ1aWxkZXIiLCJpbml0aWFsQWN0aXZlSW50ZXJmYWNlIjoibnJxbEVkaXRvciIsImluaXRpYWxOcnFsVmFsdWUiOiIiLCJpbml0aWFsUXVlcmllcyI6W3sibnJxbCI6IkZST00gTWV0cmljIFNFTEVDVCBjb3VudCgqKSB3aGVyZSBuZXdyZWxpYy5zb3VyY2UgTElLRSAnJW90bHAlJyBUSU1FU0VSSUVTIn1dLCJpbml0aWFsQ2hhcnRTZXR0aW5ncyI6eyJjaGFydFR5cGUiOiJDSEFSVF9MSU5FIiwibGltaXQiOjc1NDIsImxpbmtlZEVudGl0eUd1aWQiOm51bGwsImxpbmtlZERhc2hib2FyZElkIjpudWxsLCJ5U2NhbGUiOnsic3RhdGljIjpmYWxzZSwiZG9tYWluIjpbbnVsbCxudWxsXX0sInlaZXJvIjp0cnVlfX0K), and [logs](https://one.newrelic.com/launcher/nr1-core.explorer?overlay=eyJuZXJkbGV0SWQiOiJkYXRhLWV4cGxvcmF0aW9uLnF1ZXJ5LWJ1aWxkZXIiLCJpbml0aWFsQWN0aXZlSW50ZXJmYWNlIjoibnJxbEVkaXRvciIsImluaXRpYWxOcnFsVmFsdWUiOiIiLCJpbml0aWFsUXVlcmllcyI6W3sibnJxbCI6IkZST00gTG9nIFNFTEVDVCBjb3VudCgqKSB3aGVyZSBuZXdyZWxpYy5zb3VyY2U9JyVvdGxwJScgVElNRVNFUklFUyJ9XSwiaW5pdGlhbENoYXJ0U2V0dGluZ3MiOnsiY2hhcnRUeXBlIjoiQ0hBUlRfTElORSIsImxpbWl0Ijo3NTQyLCJsaW5rZWRFbnRpdHlHdWlkIjpudWxsLCJsaW5rZWREYXNoYm9hcmRJZCI6bnVsbCwieVNjYWxlIjp7InN0YXRpYyI6ZmFsc2UsImRvbWFpbiI6W251bGwsbnVsbF19LCJ5WmVybyI6dHJ1ZX19Cg==). | ||
* See [OpenTelemetry APM UI](/docs/opentelemetry/get-started/apm-monitoring/opentelemetry-apm-ui) for more information. | ||
|
||
If you can't find your entity and don't see your data with NRQL, see [OTLP troubleshooting](/docs/opentelemetry/best-practices/opentelemetry-otlp-troubleshooting). | ||
<InstallFeedback /> | ||
</Step> | ||
</Steps> | ||
|
11 changes: 11 additions & 0 deletions
11
...se-notes/kubernetes-integration-release-notes/kubernetes-integration-3-29-1.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
subject: Kubernetes integration | ||
releaseDate: '2024-07-09' | ||
version: 3.29.1 | ||
--- | ||
|
||
For a detailed description of changes, see the [release notes](https://github.com/newrelic/nri-kubernetes/releases/tag/v3.29.1). | ||
|
||
This integration is included in the following chart versions: | ||
* [newrelic-infrastructure-3.34.1](https://github.com/newrelic/nri-kubernetes/releases/tag/newrelic-infrastructure-3.34.1) | ||
* [nri-bundle-5.0.85](https://github.com/newrelic/helm-charts/releases/tag/nri-bundle-5.0.85) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters