Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 97 additions & 16 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,28 +89,53 @@
"group": "Observability",
"icon": "chart-column",
"pages": [
"features/observability",
"why-promptlayer/advanced-search",
"why-promptlayer/analytics",
"running-requests/traces",
"features/opentelemetry",
"features/integrations",
"features/observability/overview",
{
"group": "Advanced Logging",
"icon": "cassette-tape",
"group": "Request Logs",
"icon": "rectangle-list",
"pages": [
"features/prompt-history/request-id",
"features/prompt-history/tagging-requests",
"features/prompt-history/metadata",
"features/prompt-history/scoring-requests",
"features/prompt-history/tracking-templates",
"features/prompt-history/custom-logging",
"features/prompt-history/structured-output-logging",
"features/prompt-history/search-data-model"
"features/observability/request-logs",
"features/observability/request-logs/request-ids",
"features/observability/request-logs/tags",
"features/observability/request-logs/metadata",
"features/observability/request-logs/scores",
"features/observability/request-logs/tracking-templates",
"features/observability/request-logs/custom-logging",
"features/observability/request-logs/structured-outputs"
]
},
{
"group": "Traces",
"icon": "diagram-project",
"pages": [
"features/observability/traces",
"features/observability/traces/manual-tracing",
{
"group": "SDK Auto-Instrumentation",
"icon": "code",
"pages": [
"features/observability/traces/auto-instrumentation/overview",
"features/observability/traces/auto-instrumentation/openai",
"features/observability/traces/auto-instrumentation/anthropic",
"features/observability/traces/auto-instrumentation/google",
"features/observability/traces/auto-instrumentation/bedrock"
]
},
"features/observability/traces/opentelemetry",
"features/observability/traces/integrations"
]
}
]
},
{
"group": "Search & Analytics",
"icon": "chart-pie-simple",
"pages": [
"features/search-and-analytics/search",
"features/search-and-analytics/analytics",
"features/search-and-analytics/search-data-model"
]
},
"why-promptlayer/workflows",
{
"group": "Tool Registry",
Expand Down Expand Up @@ -512,6 +537,62 @@
}
},
"redirects": [
{
"source": "/features/observability",
"destination": "/features/observability/overview"
},
{
"source": "/running-requests/traces",
"destination": "/features/observability/traces"
},
{
"source": "/features/integrations",
"destination": "/features/observability/traces/integrations"
},
{
"source": "/features/opentelemetry",
"destination": "/features/observability/traces/opentelemetry"
},
{
"source": "/features/prompt-history/request-id",
"destination": "/features/observability/request-logs/request-ids"
},
{
"source": "/features/prompt-history/tagging-requests",
"destination": "/features/observability/request-logs/tags"
},
{
"source": "/features/prompt-history/metadata",
"destination": "/features/observability/request-logs/metadata"
},
{
"source": "/features/prompt-history/scoring-requests",
"destination": "/features/observability/request-logs/scores"
},
{
"source": "/features/prompt-history/tracking-templates",
"destination": "/features/observability/request-logs/tracking-templates"
},
{
"source": "/features/prompt-history/custom-logging",
"destination": "/features/observability/request-logs/custom-logging"
},
{
"source": "/features/prompt-history/structured-output-logging",
"destination": "/features/observability/request-logs/structured-outputs"
},
{
"source": "/features/prompt-history/search-data-model",
"destination": "/features/search-and-analytics/search-data-model"
},
{
"source": "/why-promptlayer/advanced-search",
"destination": "/features/search-and-analytics/search"
},
{
"source": "/why-promptlayer/analytics",
"destination": "/features/search-and-analytics/analytics"
},
{
"source": "/sdks/evals/setup-with-ai",
"destination": "/sdks/evals/quickstart"
Expand Down
6 changes: 3 additions & 3 deletions features/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Yes, PromptLayer supports multi-modal image models, including `gpt-4-vision-prev
To use `gpt-4-vision-preview` with PromptLayer, follow these steps:

1. Ensure you have the PromptLayer and OpenAI Python libraries installed.
2. Use the [`run()` method](/sdks/python#using-the-run-method-recommended) to execute prompts, or use [`log_request`](/features/prompt-history/custom-logging) to log requests made with your own client.
2. Use the [`run()` method](/sdks/python#using-the-run-method-recommended) to execute prompts, or use [`log_request`](/features/observability/request-logs/custom-logging) to log requests made with your own client.
3. Make your request to `gpt-4-vision-preview` with the necessary image inputs, either through image URLs or base64 encoded images.
4. Check the PromptLayer dashboard to see your request logged!

Expand All @@ -25,7 +25,7 @@ Multi-modal models are also supported in the Prompt Registry, Playground, and Ev

## Do you support OpenAI function calling?

Yes, we take great pride in staying up to date. PromptLayer supports [function calling](https://platform.openai.com/docs/guides/function-calling) through the `run()` method and via [custom logging](/features/prompt-history/custom-logging). You can also configure tool calling directly in the [Prompt Registry](/features/prompt-registry/tool-calling).
Yes, we take great pride in staying up to date. PromptLayer supports [function calling](https://platform.openai.com/docs/guides/function-calling) through the `run()` method and via [custom logging](/features/observability/request-logs/custom-logging). You can also configure tool calling directly in the [Prompt Registry](/features/prompt-registry/tool-calling).


## Does PromptLayer support streaming?
Expand Down Expand Up @@ -135,7 +135,7 @@ PromptLayer provides out-of-the-box support for Mistral in our logs, playground,

## What's the difference between tags and metadata?

Both [tags](/features/prompt-history/tagging-requests) and [metadata](/features/prompt-history/metadata) enable the addition of supplementary information to your request logs, yet they serve distinct purposes. Tags are ideal for classifying requests into a limited number of predefined categories, such as "prod" or "dev". Conversely, metadata is tailored for capturing unique, request-specific details like user IDs or session IDs.
Both [tags](/features/observability/request-logs/tags) and [metadata](/features/observability/request-logs/metadata) enable the addition of supplementary information to your request logs, yet they serve distinct purposes. Tags are ideal for classifying requests into a limited number of predefined categories, such as "prod" or "dev". Conversely, metadata is tailored for capturing unique, request-specific details like user IDs or session IDs.

## Why do I see extra input variables in my prompt template? Parsing does not seem to be working.

Expand Down
4 changes: 2 additions & 2 deletions features/image-generation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ PromptLayer automatically handles image storage for generated images:

## Logging Image Generation Requests

If you're making image generation calls with your own client, you can log them to PromptLayer using [`log_request`](/features/prompt-history/custom-logging). PromptLayer recognizes the following function names for image generation:
If you're making image generation calls with your own client, you can log them to PromptLayer using [`log_request`](/features/observability/request-logs/custom-logging). PromptLayer recognizes the following function names for image generation:

- `openai.images.generate`
- `openai.OpenAI.images.generate`
Expand All @@ -354,4 +354,4 @@ Image generation outputs work with PromptLayer's evaluation system. Generated im
- [Tool Calling (Built-in Tools)](/features/prompt-registry/tool-calling)
- [Python SDK Run Method](/sdks/python#using-the-run-method-recommended)
- [JavaScript SDK Run Method](/sdks/javascript#using-the-run-method-recommended)
- [Custom Logging](/features/prompt-history/custom-logging)
- [Custom Logging](/features/observability/request-logs/custom-logging)
84 changes: 0 additions & 84 deletions features/observability.mdx

This file was deleted.

72 changes: 72 additions & 0 deletions features/observability/overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
title: "Overview"
description: "Understand the request logs and traces that make up PromptLayer observability."
icon: "book"
---

Observability helps you inspect model calls and follow the execution of AI applications across prompts, agents, tools, and workflows.

PromptLayer organizes observability data into two artifacts:

| Artifact | Use it to |
| --- | --- |
| [**Request log**](/features/observability/request-logs) | Inspect one model call, including its input, output, model, timing, tokens, cost, status, metadata, and prompt association. |
| [**Trace**](/features/observability/traces) | Follow one end-to-end operation as a hierarchy of LLM calls, agents, tools, retrieval steps, and custom application spans. |

A trace can contain multiple model calls and therefore link to multiple request logs. Supported direct GenAI spans create request logs, while spans managed by `PromptLayer.run()` can link to the run's existing request log.

## Where to Go Next

<CardGroup cols={2}>
<Card
title="Request Logs"
icon="rectangle-list"
href="/features/observability/request-logs"
>
Review individual model calls, errors, inputs, outputs, usage, and cost.
</Card>
<Card
title="Traces"
icon="diagram-project"
href="/features/observability/traces"
>
Inspect the parent-child execution path across model calls, tools, agents, and application code.
</Card>
<Card
title="Search"
icon="magnifying-glass"
href="/features/search-and-analytics/search"
>
Find request logs or traces with content queries, structured filters, and date ranges.
</Card>
<Card
title="Analytics"
icon="chart-pie-simple"
href="/features/search-and-analytics/analytics"
>
Aggregate the current request-log or trace query into charts.
</Card>
</CardGroup>

## Configure Observability

Once you know which artifact you need, follow the setup path for the code that produces it:

<CardGroup cols={2}>
<Card
title="Configure Request Logging"
icon="rectangle-list"
href="/features/observability/request-logs"
>
Choose how requests are captured, then add IDs, tags, metadata, scores, and prompt associations.
</Card>
<Card
title="Configure Tracing"
icon="diagram-project"
href="/features/observability/traces"
>
Choose PromptLayer SDK spans, provider auto-instrumentation, a telemetry integration, or OpenTelemetry.
</Card>
</CardGroup>

For indexing details, see the [Search Data Model](/features/search-and-analytics/search-data-model).
57 changes: 57 additions & 0 deletions features/observability/request-logs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
title: "Overview"
description: "Inspect individual model calls, including their content, status, usage, cost, and metadata."
icon: "rectangle-list"
---

A request log records one model call. Use it to inspect exactly what your application sent and received, diagnose a failure, review latency and token usage, or connect production behavior to a prompt template.

Each request log can include:

- Model input and output
- Provider and model
- Start time, end time, and latency
- Input and output tokens
- Estimated cost
- Status and error details
- Prompt template association
- Tags, metadata, scores, and a PromptLayer request ID

## View Request Logs

Open **Request Logs** in the PromptLayer sidebar. The Requests table shows the model, prompt, status, timing, token usage, cost, and other fields for each call. Select a row to open its full details.

<Frame>
<img src="/new-quickstart-images/logs-table.png" alt="PromptLayer request logs table" />
</Frame>

To review logs for one prompt, open that prompt and select **Analytics & Logs**.

<Frame>
<img
src="/new-quickstart-images/logs-by-prompt-display.png"
alt="Request logs filtered to one prompt"
/>
</Frame>

## Find a Request

Use the date range, free-text query, and structured filters above the Requests table. You can filter by fields such as prompt, model, provider, status, tags, metadata, content, latency, tokens, and cost.

See [Search](/features/search-and-analytics/search) for the dashboard workflow, supported filter categories, and older-data behavior.

## Request Logs and Traces

A request log describes one model call. A [trace](/features/observability/traces) describes the complete operation around that call and can contain multiple request logs.

When PromptLayer receives a supported GenAI span, it creates a request log for the model call and links it to the trace. If `PromptLayer.run()` already created the request log, PromptLayer links the span to that log instead of creating a duplicate.

## Configure Request Logs

Use [tags](/features/observability/request-logs/tags), [metadata](/features/observability/request-logs/metadata), and [scores](/features/observability/request-logs/scores) to make requests easier to find and compare. Every log also has a [PromptLayer request ID](/features/observability/request-logs/request-ids) that you can store or use with tracking methods.

Use [Tracking Templates](/features/observability/request-logs/tracking-templates) to associate provider calls with PromptLayer prompts. For manual provider calls or unsupported models, use [Custom Logging](/features/observability/request-logs/custom-logging). If a provider returns JSON, see [Structured Outputs](/features/observability/request-logs/structured-outputs).

## Reuse Production Data

Select request logs from the table and add them to a [PromptLayer Table](/features/tables/overview#import-data). This lets you turn representative production examples or failures into evaluation and backtesting data.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ icon: "brackets-curly"
---


Custom logging creates [request logs](/features/observability/request-logs) for calls that PromptLayer does not capture automatically. Return to [Configure Request Logging](/features/observability/request-logs) to compare capture and enrichment options.

## When to Use Custom Logging

Use the `log_request` method when:
Expand Down
Loading
Loading