Ascent Quick Start Guide
Ascent Quick Start Guide for AI and LLM Observability
The Apica full-stack observability platform combined with the OpenTelemetry SDK can seamlessly provide comprehensive insights into Large Language Models (LLMs) in production environments. By observing AI models, businesses can make informed decisions, optimize performance, and ensure compliance with emerging AI regulations.
This guide will walk you through setting up OpenTelemetry Auto Instrumentation for traces and metrics to fully monitor your LLM application using Apica Ascent. Once the quick setup is complete, you can easily track and analyze the performance and usage of your LLM applications.
Here are the main configuration steps required within your application code:
Deploy OpenTelemetry SDK
Follow the steps below for either traces or metrics (or both). Also, we provide the links to the OTEL deployment guides if needed.
OTEL tracing setup guide: https://opentelemetry.io/docs/concepts/signals/traces/
OTEL metrics setup guide: https://opentelemetry.io/docs/specs/otel/metrics/
Instrument your Application
Configure OTEL to send traces and/or metrics into Ascent (depending on how you want to visualize the data). Below are example(s) of code required to enable instrumentation of OTEL – traces.
TRACING code examples:
Imports (FastAPI might differ depending on what framework your app is created with):
Tracing configuration:
Instrument App (Otel supports more than just FastAPI, simply import correct API in step #1):
Add tracer to each API call you would like to track. In this example we are adding a trace on “create_chat_completion” with a span called “chat_completion”:
To add custom attributes such as prompt tokens to the trace:
METRICS code examples:
Imports:
Metric Configuration:
Creating a metric:
Assigning the metric a value:
In this example we are grabbing prompt_tokens from the LLM response and assigning it to the “prompt_tokens_counter” metric. We also added some metadata to the metric by adding “model_name”.
Collect and store data
Data is stored in Ascent Lake
Visualize data
View individual traces and metrics within Ascent Explore. Use data explorer to visualize data – creating a widget for each desired “metric” to visualize within a dashboard – follow dashboard configuration steps:
Metric data – follow the data explorer for metrics
Trace data – use log2metric to visualize traces
Alerting
Configure alerts as required within Ascent.
Last updated
Was this helpful?