Metrics#
Otel and TimeMeasure Metrics#
The codebase uses OpenTelemetry for tracing and metrics. The following environment variables can be set to enable metrics:
export VIA_CTX_RAG_ENABLE_OTEL=true
export VIA_CTX_RAG_EXPORTER=otlp # or console
export VIA_CTX_RAG_OTEL_ENDPOINT=http://otel_collector:4318 # only used if VIA_CTX_RAG_EXPORTER is otlp
Traces capture TimeMeasure metrics which are used to monitor the execution time of the different components.
Example Span#
{
"name": "GraphRetrieval/Neo4jRetriever",
"context": {
"trace_id": "0x0ddaa0e6800dd0f4172746f53a3fc12b",
"span_id": "0xbf4c3dc3c9050e0e",
"trace_state": "[]"
},
"kind": "SpanKind.INTERNAL",
"parent_id": null,
"start_time": "2025-04-09T05:37:28.633505Z",
"end_time": "2025-04-09T05:37:28.752445Z",
"status": {
"status_code": "UNSET"
},
"attributes": {
"span name": "GraphRetrieval/Neo4jRetriever",
"execution_time_ms": 119.0345287322998
},
"events": [],
"links": [],
"resource": {
"attributes": {
"service.name": "vss-ctx-rag-default"
},
"schema_url": ""
}
}
Important TimeMeasure Metrics#
Context Manager#
context_manager/reset
: Time taken to reset the context managercontext_manager/call
: Time taken to call the context managercontext_manager/add_doc
: Time taken to add a document to the context managercontext_manager/aprocess_doc
: Time taken to process a document in the context manager
Document Processing#
Add Doc
: Time taken to add a document to the document processingmilvusdb/add caption
: Time taken to add a caption to the milvus databaseMilvus/AddSummries
: Time taken to add summaries to the milvus database
Graph RAG#
Graph Extraction#
GraphRAG/aprocess-doc
: Time taken to process a document in the graph extractionGraphRAG/aprocess-doc/graph-create
: Time taken to create a graph in the graph extractionGraphRAG/aprocess-doc/graph-create/create-relation
: Time taken to create a relation in the graph extractionGraphRAG/aprocess-doc/graph-create/combine-chunks
: Time taken to combine chunks in the graph extractionGraphRAG/aprocess-doc/graph-create/postprocessing
: Time taken to postprocess the graph in the graph extractionGraphRAG/aprocess-doc/graph-create/convert
: Time taken to convert the graph in the graph extractionGraphRAG/aprocess-doc/create-fulltext
: Time taken to create a fulltext in the graph extractionGraphExtraction/UpdateKNN
: Time taken to update the KNN in the graph extractionGraphExtraction/VectorIndex
: Time taken to create a vector index in the graph extractionGraphExtraction/FetchEntEmbd
: Time taken to fetch the entity embedding in the graph extractionGraphExtraction/UpdatEmbding
: Time taken to update the embedding in the graph extraction
Graph Retrieval#
GraphRetrieval/Neo4jRetriever
: Time taken to retrieve the graph in the graph retrievalGraphRetrieval/CreateDocRetChain
: Time taken to create a document retrieval chain in the graph retrievalGraphRetrieval/HumanMessage
: Time taken to create a human message in the graph retrievalGraphRetrieval/AIMsg
: Time taken to create a AI message in the graph retrievalGraphRetrieval/SummarizeChat
: Time taken to summarize the chat in the graph retrievalRetrive documents
: Time taken to retrieve the documents in the graph retrievalRetrieve documents with filter
: Time taken to retrieve the documents with filter in the graph retrievalchat/process documents
: Time taken to process the documents in the chat
Vector RAG#
VectorRAG/aprocess-doc/metrics_dump
: Time taken to dump the metrics in the vector RAGVectorRAG/retrieval
: Time taken to retrieve the documents in the vector RAG
Summarization#
OffBatchSumm/Acall
: Time taken to call the summarization in the summarizationsumm/acall/batch-aggregation-summary
: Time taken to aggregate the summary in the summarizationOffBatSumm/AggPipeline
: Time taken to aggregate the pipeline in the summarizationOffBatSumm/BaseCase
: Time taken to create a base case in the summarizationsumm/aprocess_doc
: Time taken to asynchronously process the document in the summarization
Notification#
notifier/llm_call
: Time taken to call the LLM in the notificationnotifier/notify_call
: Time taken to notify the user in the notification