@oscar-js/explain-my-trace
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

@oscar-js/explain-my-trace

NPM Published Version

About

This module provides a simple way to breakdown OpenTelemetry based traces into human words, explaining the entire process, finding bugs and providing useful insights using OpenAI and LanChain. Currently only supports Jaeger and Tempo export formats.

Install

Using npm:

npm install @oscar-js/explain-my-trace

Using npx:

# OPENAI_API_KEY=<your-key> or use the --apikey flag
npx @oscar-js/explain-my-trace --path ./trace.json --apikey <your-key> --model "gpt-4o" --type jaeger/tempo --docslimit 10 --format pretty

Usage

To include it as part of a Node.js app, use the following:

import explain from '@oscar-js/explain-my-trace';
import trace from './trace.json';

const response = explain({
  raw: JSON.stringify(trace), // the raw string version
  type: 'tempo', // Only tempo and jaeger are available
  apiKey: '<your-openapi-api-key>', // Or it can be hoisted in the process.env as OPENAI_API_KEY
  model: 'gpt-4o', // The model to use, defaults to gpt-4o
  docslimit: 10, // Uses as a limit of documents sent to the model to avoid expensive queries $$$, defaults to 100
});

console.log(response)

Readme

Keywords

Package Sidebar

Install

npm i @oscar-js/explain-my-trace

Weekly Downloads

3

Version

0.0.7

License

ISC

Unpacked Size

127 kB

Total Files

20

Last publish

Collaborators

  • xoscar