-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into OPIK-444
- Loading branch information
Showing
33 changed files
with
217 additions
and
20 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
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
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
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
81 changes: 81 additions & 0 deletions
81
apps/opik-documentation/documentation/docs/tracing/production_monitoring.md
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,81 @@ | ||
--- | ||
sidebar_position: 1 | ||
sidebar_label: Production Monitoring | ||
toc_min_heading_level: 2 | ||
toc_max_heading_level: 4 | ||
--- | ||
|
||
# Production Monitoring | ||
|
||
Opik has been designed from the ground up to support high volumes of traces making it the ideal tool for monitoring your production LLM applications. | ||
|
||
You can use the Opik dashboard to review your feedback scores, trace count and tokens over time at both a daily and hourly granularity. | ||
|
||
![Opik monitoring dashboard](/img/tracing/opik_monitoring_dashboard.png) | ||
|
||
In addition to viewing scores over time, you can also view the average feedback scores for all the traces in your project from the traces table. | ||
|
||
## Logging feedback scores | ||
|
||
To monitor the performance of your LLM application, you can log feedback scores using the [Python SDK and through the UI](/tracing/annotate_traces.md). | ||
|
||
### Logging feedback scores alongside traces | ||
|
||
Feedback scores can be logged while you are logging traces: | ||
|
||
```python | ||
from opik import track, opik_context | ||
|
||
@track | ||
def llm_chain(input_text): | ||
# LLM chain code | ||
# ... | ||
|
||
# Update the trace | ||
opik_context.update_current_trace( | ||
feedback_scores=[ | ||
{"name": "user_feedback", "value": 1.0, "reason": "The response was helpful and accurate."} | ||
] | ||
) | ||
``` | ||
|
||
### Updating traces with feedback scores | ||
|
||
You can also update traces with feedback scores after they have been logged. For this we are first going to fetch all the traces using the search API and then update the feedback scores for the traces we want to annotate. | ||
|
||
#### Fetching traces using the search API | ||
|
||
You can use the [`Opik.search_traces`](https://www.comet.com/docs/opik/python-sdk-reference/Opik.html#opik.Opik.search_traces) method to fetch all the traces you want to annotate. | ||
|
||
```python | ||
import opik | ||
|
||
opik_client = opik.Opik() | ||
|
||
traces = opik_client.search_traces( | ||
project_name="Default Project", | ||
start_time="2024-01-01", | ||
end_time="2025-01-01", | ||
) | ||
``` | ||
|
||
:::tip | ||
|
||
The `search_traces` method allows you to fetch traces based on any of trace attributes, you can learn more about the different search parameters in the [search traces documentation](/tracing/export_data.md). | ||
|
||
::: | ||
|
||
#### Updating feedback scores | ||
|
||
Once you have fetched the traces you want to annotate, you can update the feedback scores using the [`Opik.log_traces_feedback_scores`](https://www.comet.com/docs/opik/python-sdk-reference/Opik.html#opik.Opik.log_traces_feedback_scores) method. | ||
|
||
```python | ||
for trace in traces: | ||
opik_client.log_traces_feedback_scores( | ||
project_name="Default Project", | ||
trace_ids=[i.id], | ||
feedback_scores=[{"name": "user_feedback", "value": 1.0, "reason": "The response was helpful and accurate."}], | ||
) | ||
``` | ||
|
||
You will now be able to see the feedback scores in the Opik dashboard and track the changes over time. |
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 added
BIN
+378 KB
...cumentation/documentation/static/img/changelog/2024-11-25/project_dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+22.5 KB
(100%)
...documentation/documentation/static/img/evaluation/compare_experiment_config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+185 KB
(130%)
apps/opik-documentation/documentation/static/img/evaluation/dataset_items_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+277 KB
(160%)
apps/opik-documentation/documentation/static/img/evaluation/linked_prompt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+241 KB
(130%)
...opik-documentation/documentation/static/img/home/traces_page_for_quickstart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+822 KB
(960%)
apps/opik-documentation/documentation/static/img/home/traces_page_with_sidebar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+673 KB
(570%)
apps/opik-documentation/documentation/static/img/opik-production.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+657 KB
(600%)
apps/opik-documentation/documentation/static/img/opik-project-dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+255 KB
(140%)
apps/opik-documentation/documentation/static/img/tracing/annotate_traces.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+426 KB
(260%)
apps/opik-documentation/documentation/static/img/tracing/download_traces.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+241 Bytes
(100%)
apps/opik-documentation/documentation/static/img/tracing/introduction.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+106 KB
(130%)
...opik-documentation/documentation/static/img/tracing/llama_index_integration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+378 KB
...ik-documentation/documentation/static/img/tracing/opik_monitoring_dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+313 KB
(180%)
apps/opik-documentation/documentation/static/img/tracing/ragas_opik_trace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.