메인 콘텐츠로 건너뛰기

개요

Weave는 전용 엔드포인트를 통해 OpenTelemetry 호환 트레이스 데이터 수집을 지원합니다. 이 엔드포인트를 사용하면 OTLP(OpenTelemetry Protocol) 형식의 트레이스 데이터를 Weave 프로젝트로 직접 전송할 수 있습니다.

엔드포인트 세부 정보

경로: /otel/v1/traces
메서드: POST
Content-Type: application/x-protobuf
기본 URL: OTEL trace 엔드포인트의 기본 URL은 사용하는 W&B 배포 유형에 따라 달라집니다:
  • 멀티 테넌트 Cloud:
    https://trace.wandb.ai/otel/v1/traces
  • Dedicated Cloud 및 Self-Managed 인스턴스:
    https://<your-subdomain>.wandb.io/traces/otel/v1/traces
<your-subdomain>을 조직의 고유한 W&B 도메인으로 바꾸세요. 예: acme.wandb.io.

인증

표준 W&B 인증을 사용합니다. 추적 데이터를 보내려는 프로젝트에 대한 쓰기 권한이 있어야 합니다.

필수 헤더

  • project_id: <your_entity>/<your_project_name>
  • Authorization=Basic <Base64 Encoding of api:$WANDB_API_KEY>

예시

다음 예시는 Python과 TypeScript를 사용해 OpenTelemetry 트레이스를 Weave로 전송하는 방법을 보여줍니다. 아래 코드 샘플을 실행하기 전에 다음 항목을 설정하십시오.
  1. WANDB_API_KEY: User Settings에서 확인할 수 있습니다.
  2. Entity: 접근 권한이 있는 엔터티의 프로젝트에만 트레이스를 기록할 수 있습니다. [https://wandb.ai/home]에서 자신의 W&B 대시보드로 이동한 뒤, 왼쪽 사이드바의 Teams 항목을 확인해 엔터티 이름을 찾을 수 있습니다.
  3. Project Name: 원하는 이름을 지정하십시오.
  4. OPENAI_API_KEY: OpenAI 대시보드에서 발급받을 수 있습니다.

OpenInference 계측

이 예제는 OpenAI 계측을 사용하는 방법을 보여줍니다. 더 많은 예시는 공식 저장소에서 확인할 수 있습니다: https://github.com/Arize-ai/openinference 먼저, 필요한 종속 항목을 설치합니다:
pip install openai openinference-instrumentation-openai opentelemetry-exporter-otlp-proto-http
성능 권장 사항: Weave로 trace를 전송할 때는 항상 SimpleSpanProcessor 대신 BatchSpanProcessor를 사용하십시오. SimpleSpanProcessor는 span을 동기적으로 내보내므로 다른 워크로드의 성능에 영향을 줄 수 있습니다. 이 예제에서는 BatchSpanProcessor 사용 방법을 보여주며, 이는 span을 비동기적으로 효율적으로 배치 처리하므로 운영 환경에서 사용을 권장합니다.
다음 코드를 openinference_example.py와 같은 Python 파일에 붙여넣습니다:
import base64
import openai
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk import trace as trace_sdk
from opentelemetry.sdk.trace.export import ConsoleSpanExporter, BatchSpanProcessor
from openinference.instrumentation.openai import OpenAIInstrumentor

OPENAI_API_KEY="YOUR_OPENAI_API_KEY"
WANDB_BASE_URL = "https://trace.wandb.ai"
PROJECT_ID = "<your-entity>/<your-project>"

OTEL_EXPORTER_OTLP_ENDPOINT = f"{WANDB_BASE_URL}/otel/v1/traces"

# https://wandb.ai/settings 에서 API key를 생성하세요
WANDB_API_KEY = "<your-wandb-api-key>"
AUTH = base64.b64encode(f"api:{WANDB_API_KEY}".encode()).decode()

OTEL_EXPORTER_OTLP_HEADERS = {
    "Authorization": f"Basic {AUTH}",
    "project_id": PROJECT_ID,
}

tracer_provider = trace_sdk.TracerProvider()

# OTLP exporter 구성
exporter = OTLPSpanExporter(
    endpoint=OTEL_EXPORTER_OTLP_ENDPOINT,
    headers=OTEL_EXPORTER_OTLP_HEADERS,
)

# tracer provider에 exporter 추가
tracer_provider.add_span_processor(BatchSpanProcessor(exporter))

# 선택 사항: 콘솔에 스팬을 출력합니다.
tracer_provider.add_span_processor(BatchSpanProcessor(ConsoleSpanExporter()))

OpenAIInstrumentor().instrument(tracer_provider=tracer_provider)

def main():
    client = openai.OpenAI(api_key=OPENAI_API_KEY)
    response = client.chat.completions.create(
        model="gpt-3.5-turbo",
        messages=[{"role": "user", "content": "Describe OTEL in a single sentence."}],
        max_tokens=20,
        stream=True,
        stream_options={"include_usage": True},
    )
    for chunk in response:
        if chunk.choices and (content := chunk.choices[0].delta.content):
            print(content, end="")

if __name__ == "__main__":
    main()
코드를 실행하세요:
python openinference_example.py

OpenLLMetry 계측

다음 예제는 OpenAI 계측을 사용하는 방법을 보여줍니다. 추가 예제는 https://github.com/traceloop/openllmetry/tree/main/packages에서 확인할 수 있습니다. 먼저 필요한 종속 패키지를 설치합니다:
pip install openai opentelemetry-instrumentation-openai opentelemetry-exporter-otlp-proto-http
다음 코드를 openllmetry_example.py와 같은 Python 파일에 붙여넣습니다. 이 코드는 위의 코드와 동일하지만, OpenAIInstrumentoropeninference.instrumentation.openai가 아니라 opentelemetry.instrumentation.openai에서 import 한다는 점만 다릅니다.
import base64
import openai
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk import trace as trace_sdk
from opentelemetry.sdk.trace.export import ConsoleSpanExporter, BatchSpanProcessor
from opentelemetry.instrumentation.openai import OpenAIInstrumentor

OPENAI_API_KEY="YOUR_OPENAI_API_KEY"
WANDB_BASE_URL = "https://trace.wandb.ai"
PROJECT_ID = "<your-entity>/<your-project>"

OTEL_EXPORTER_OTLP_ENDPOINT = f"{WANDB_BASE_URL}/otel/v1/traces"

# https://wandb.ai/settings 에서 API key를 생성하세요
WANDB_API_KEY = "<your-wandb-api-key>"
AUTH = base64.b64encode(f"api:{WANDB_API_KEY}".encode()).decode()

OTEL_EXPORTER_OTLP_HEADERS = {
    "Authorization": f"Basic {AUTH}",
    "project_id": PROJECT_ID,
}

tracer_provider = trace_sdk.TracerProvider()

# OTLP exporter 구성
exporter = OTLPSpanExporter(
    endpoint=OTEL_EXPORTER_OTLP_ENDPOINT,
    headers=OTEL_EXPORTER_OTLP_HEADERS,
)

# tracer provider에 exporter 추가
tracer_provider.add_span_processor(BatchSpanProcessor(exporter))

# 선택 사항: 콘솔에 span을 출력합니다.
tracer_provider.add_span_processor(BatchSpanProcessor(ConsoleSpanExporter()))

OpenAIInstrumentor().instrument(tracer_provider=tracer_provider)

def main():
    client = openai.OpenAI(api_key=OPENAI_API_KEY)
    response = client.chat.completions.create(
        model="gpt-3.5-turbo",
        messages=[{"role": "user", "content": "Describe OTEL in a single sentence."}],
        max_tokens=20,
        stream=True,
        stream_options={"include_usage": True},
    )
    for chunk in response:
        if chunk.choices and (content := chunk.choices[0].delta.content):
            print(content, end="")

if __name__ == "__main__":
    main()
코드를 실행하세요:
python openllmetry_example.py

계측 도구 없이 사용하기

계측용 패키지 대신 OTEL을 직접 사용하려면 그렇게 할 수 있습니다. Span 속성은 https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/에 설명된 OpenTelemetry 의미 체계 규칙에 따라 해석됩니다. 먼저 필요한 종속성을 설치합니다:
pip install openai opentelemetry-sdk opentelemetry-api opentelemetry-exporter-otlp-proto-http
opentelemetry_example.py와 같은 Python 파일에 다음 코드를 붙여넣으세요:
import json
import base64
import openai
from opentelemetry import trace
from opentelemetry.sdk import trace as trace_sdk
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.trace.export import ConsoleSpanExporter, BatchSpanProcessor

OPENAI_API_KEY = "YOUR_OPENAI_API_KEY"
WANDB_BASE_URL = "https://trace.wandb.ai"
PROJECT_ID = "<your-entity>/<your-project>"

OTEL_EXPORTER_OTLP_ENDPOINT = f"{WANDB_BASE_URL}/otel/v1/traces"

# https://wandb.ai/settings 에서 API key를 생성하세요
WANDB_API_KEY = "<your-wandb-api-key>"
AUTH = base64.b64encode(f"api:{WANDB_API_KEY}".encode()).decode()

OTEL_EXPORTER_OTLP_HEADERS = {
    "Authorization": f"Basic {AUTH}",
    "project_id": PROJECT_ID,
}

tracer_provider = trace_sdk.TracerProvider()

# OTLP 익스포터 구성
exporter = OTLPSpanExporter(
    endpoint=OTEL_EXPORTER_OTLP_ENDPOINT,
    headers=OTEL_EXPORTER_OTLP_HEADERS,
)

# 트레이서 프로바이더에 익스포터 추가
tracer_provider.add_span_processor(BatchSpanProcessor(exporter))

# 선택 사항: 스팬을 콘솔에 출력합니다.
tracer_provider.add_span_processor(BatchSpanProcessor(ConsoleSpanExporter()))

trace.set_tracer_provider(tracer_provider)
# 전역 트레이서 프로바이더에서 트레이서를 생성합니다
tracer = trace.get_tracer(__name__)
tracer.start_span('name=standard-span')

def my_function():
    with tracer.start_as_current_span("outer_span") as outer_span:
        client = openai.OpenAI()
        input_messages=[{"role": "user", "content": "Describe OTEL in a single sentence."}]
        # 사이드 패널에만 표시됩니다
        outer_span.set_attribute("input.value", json.dumps(input_messages))
        # 규칙을 따르며 대시보드에 표시됩니다
        outer_span.set_attribute("gen_ai.system", 'openai')
        response = client.chat.completions.create(
            model="gpt-3.5-turbo",
            messages=input_messages,
            max_tokens=20,
            stream=True,
            stream_options={"include_usage": True},
        )
        out = ""
        for chunk in response:
            if chunk.choices and (content := chunk.choices[0].delta.content):
                out += content
        # 사이드 패널에만 표시됩니다
        outer_span.set_attribute("output.value", json.dumps({"content": out}))

if __name__ == "__main__":
    my_function()
코드를 실행하세요:
python opentelemetry_example.py
스팬 속성의 접두사인 gen_aiopeninference는 트레이스를 해석할 때, 적용할 규약이 있을 경우 어떤 규약을 사용할지 결정하는 데 사용됩니다. 두 접두사 모두 감지되지 않으면 모든 스팬 속성이 트레이스 뷰에 표시됩니다. 트레이스를 선택하면 전체 스팬을 사이드 패널에서 확인할 수 있습니다.

OTEL trace를 스레드로 구성하기

특정 span 속성을 추가하여 OpenTelemetry trace를 Weave 스레드로 구성한 다음, Weave의 Thread UI를 사용해 멀티턴 대화나 사용자 세션과 같이 연관된 작업을 분석합니다. 다음 속성을 OTEL span에 추가하여 스레드 단위 그룹화를 활성화합니다:
  • wandb.thread_id: span을 특정 스레드로 그룹화합니다
  • wandb.is_turn: span을 대화 턴으로 표시합니다(스레드 뷰에서 하나의 행으로 나타납니다)
다음 예제는 OTEL trace를 Weave 스레드로 구성하는 방법을 보여줍니다. 여기서는 wandb.thread_id를 사용해 연관된 작업을 그룹화하고, wandb.is_turn을 사용해 스레드 뷰에서 행으로 나타나는 상위 수준 작업을 표시합니다.
이 구성을 사용하여 아래 예제를 실행합니다:
import base64
import json
import os
from opentelemetry import trace
from opentelemetry.sdk import trace as trace_sdk
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.trace.export import ConsoleSpanExporter, BatchSpanProcessor

# 구성
ENTITY = "YOUR_ENTITY"
PROJECT = "YOUR_PROJECT"
PROJECT_ID = f"{ENTITY}/{PROJECT}"
WANDB_API_KEY = os.environ["WANDB_API_KEY"]

# OTLP endpoint 및 헤더 설정
OTEL_EXPORTER_OTLP_ENDPOINT="https://trace.wandb.ai/otel/v1/traces"
AUTH = base64.b64encode(f"api:{WANDB_API_KEY}".encode()).decode()
OTEL_EXPORTER_OTLP_HEADERS = {
    "Authorization": f"Basic {AUTH}",
    "project_id": PROJECT_ID,
}

# tracer provider 초기화
tracer_provider = trace_sdk.TracerProvider()

# OTLP exporter 구성
exporter = OTLPSpanExporter(
    endpoint=OTEL_EXPORTER_OTLP_ENDPOINT,
    headers=OTEL_EXPORTER_OTLP_HEADERS,
)

# tracer provider에 exporter 추가
tracer_provider.add_span_processor(BatchSpanProcessor(exporter))

# 선택적으로 span을 콘솔에 출력
tracer_provider.add_span_processor(BatchSpanProcessor(ConsoleSpanExporter()))

# tracer provider 설정
trace.set_tracer_provider(tracer_provider)

# 전역 tracer provider에서 tracer 생성
tracer = trace.get_tracer(__name__)
def example_1_basic_thread_and_turn():
    """Example 1: Basic thread with a single turn"""
    print("\n=== Example 1: Basic Thread and Turn ===")

    # 스레드 컨텍스트 생성
    thread_id = "thread_example_1"

    # 이 span은 하나의 턴(스레드의 직속 자식)을 나타냅니다
    with tracer.start_as_current_span("process_user_message") as turn_span:
        # 스레드 속성 설정
        turn_span.set_attribute("wandb.thread_id", thread_id)
        turn_span.set_attribute("wandb.is_turn", True)

        # 예시 속성 추가
        turn_span.set_attribute("input.value", "Hello, help me with setup")

        # 중첩 span으로 작업을 시뮬레이션합니다
        with tracer.start_as_current_span("generate_response") as nested_span:
            # 이는 턴 내부의 중첩 호출이므로 is_turn은 false이거나 설정되지 않아야 합니다
            nested_span.set_attribute("wandb.thread_id", thread_id)
            # 중첩 호출에서는 wandb.is_turn을 설정하지 않거나 False로 둡니다

            response = "I'll help you get started with the setup process."
            nested_span.set_attribute("output.value", response)

        turn_span.set_attribute("output.value", response)
        print(f"Turn completed in thread: {thread_id}")

def main():
    example_1_basic_thread_and_turn()

if __name__ == "__main__":
    main()
def example_2_multiple_turns():
    """Example 2: Multiple turns in a single thread"""
    print("\n=== Example 2: Multiple Turns in Thread ===")

    thread_id = "thread_conversation_123"

    # 턴 1
    with tracer.start_as_current_span("process_message_turn1") as turn1_span:
        turn1_span.set_attribute("wandb.thread_id", thread_id)
        turn1_span.set_attribute("wandb.is_turn", True)
        turn1_span.set_attribute("input.value", "What programming languages do you recommend?")

        # 중첩된 작업
        with tracer.start_as_current_span("analyze_query") as analyze_span:
            analyze_span.set_attribute("wandb.thread_id", thread_id)
            # 중첩 span에는 is_turn attribute를 설정하지 않거나 False로 설정

        response1 = "I recommend Python for beginners and JavaScript for web development."
        turn1_span.set_attribute("output.value", response1)
        print(f"Turn 1 completed in thread: {thread_id}")

    # 턴 2
    with tracer.start_as_current_span("process_message_turn2") as turn2_span:
        turn2_span.set_attribute("wandb.thread_id", thread_id)
        turn2_span.set_attribute("wandb.is_turn", True)
        turn2_span.set_attribute("input.value", "Can you explain Python vs JavaScript?")

        # 중첩된 작업
        with tracer.start_as_current_span("comparison_analysis") as compare_span:
            compare_span.set_attribute("wandb.thread_id", thread_id)
            compare_span.set_attribute("wandb.is_turn", False)  # 중첩 span에 대해 명시적으로 False 설정

        response2 = "Python excels at data science while JavaScript dominates web development."
        turn2_span.set_attribute("output.value", response2)
        print(f"Turn 2 completed in thread: {thread_id}")

def main():
    example_2_multiple_turns()

if __name__ == "__main__":
    main()
def example_3_complex_nested_structure():
    """Example 3: Complex nested structure with multiple levels"""
    print("\n=== Example 3: Complex Nested Structure ===")

    thread_id = "thread_complex_456"

    # 여러 단계로 중첩된 turn
    with tracer.start_as_current_span("handle_complex_request") as turn_span:
        turn_span.set_attribute("wandb.thread_id", thread_id)
        turn_span.set_attribute("wandb.is_turn", True)
        turn_span.set_attribute("input.value", "Analyze this code and suggest improvements")

        # 1단계 중첩된 operation
        with tracer.start_as_current_span("code_analysis") as analysis_span:
            analysis_span.set_attribute("wandb.thread_id", thread_id)
            # 중첩된 operation에는 is_turn을 사용하지 않음

            # 2단계 중첩된 operation
            with tracer.start_as_current_span("syntax_check") as syntax_span:
                syntax_span.set_attribute("wandb.thread_id", thread_id)
                syntax_span.set_attribute("result", "No syntax errors found")

            # 또 다른 2단계 중첩된 operation
            with tracer.start_as_current_span("performance_check") as perf_span:
                perf_span.set_attribute("wandb.thread_id", thread_id)
                perf_span.set_attribute("result", "Found 2 optimization opportunities")

        # 또 다른 1단계 중첩된 operation
        with tracer.start_as_current_span("generate_suggestions") as suggest_span:
            suggest_span.set_attribute("wandb.thread_id", thread_id)
            suggestions = ["Use list comprehension", "Consider caching results"]
            suggest_span.set_attribute("suggestions", json.dumps(suggestions))

        turn_span.set_attribute("output.value", "Analysis complete with 2 improvement suggestions")
        print(f"Complex turn completed in thread: {thread_id}")

def main():
    example_3_complex_nested_structure()

if __name__ == "__main__":
    main()
def example_4_non_turn_operations():
    """Example 4: Operations that are part of a thread but not turns"""
    print("\n=== Example 4: Non-Turn Thread Operations ===")

    thread_id = "thread_background_789"

    # 스레드의 일부이지만 턴은 아닌 백그라운드 작업
    with tracer.start_as_current_span("background_indexing") as bg_span:
        bg_span.set_attribute("wandb.thread_id", thread_id)
        # wandb.is_turn이 설정되지 않았거나 False이면 - 이 작업은 턴이 아님
        bg_span.set_attribute("wandb.is_turn", False)
        bg_span.set_attribute("operation", "Indexing conversation history")
        print(f"Background operation in thread: {thread_id}")

    # 동일한 스레드의 실제 턴
    with tracer.start_as_current_span("user_query") as turn_span:
        turn_span.set_attribute("wandb.thread_id", thread_id)
        turn_span.set_attribute("wandb.is_turn", True)
        turn_span.set_attribute("input.value", "Search my previous conversations")
        turn_span.set_attribute("output.value", "Found 5 relevant conversations")
        print(f"Turn completed in thread: {thread_id}")

def main():
    example_4_non_turn_operations()

if __name__ == "__main__":
    main()
이러한 트레이스를 전송한 후에는 Weave UI의 Threads 탭에서 확인할 수 있습니다. 여기에서 thread_id별로 그룹화되고, 각 턴은 별도의 행으로 표시됩니다.

속성 매핑

Weave는 다양한 계측 프레임워크의 OpenTelemetry span 속성을 자동으로 내부 데이터 모델에 매핑합니다. 여러 속성 이름이 동일한 필드에 매핑되는 경우, Weave는 우선순위에 따라 적용하여 서로 다른 프레임워크가 동일한 트레이스에서 공존할 수 있도록 합니다.

지원되는 프레임워크

Weave는 다음과 같은 관측(Observability) 프레임워크 및 SDK의 속성 컨벤션을 지원합니다:
  • OpenTelemetry GenAI: 생성형 AI를 위한 표준 시맨틱 컨벤션 (gen_ai.*)
  • OpenInference: Arize AI의 계측 라이브러리 (input.value, output.value, llm.*, openinference.*)
  • Vercel AI SDK: Vercel AI SDK 속성 (ai.prompt, ai.response, ai.model.*, ai.usage.*)
  • MLflow: MLflow 트래킹 속성 (mlflow.spanInputs, mlflow.spanOutputs)
  • Traceloop: OpenLLMetry 계측 (traceloop.entity.*, traceloop.span.kind)
  • Google Vertex AI: Vertex AI 에이전트 속성 (gcp.vertex.agent.*)
  • OpenLit: OpenLit 관측 속성 (gen_ai.content.completion)
  • Langfuse: Langfuse 트레이싱 속성 (langfuse.startTime, langfuse.endTime)

속성 참조

속성 필드명W&B 매핑설명타입예시
ai.promptinputs사용자 프롬프트 텍스트 또는 메시지문자열(String), 리스트(list), 딕셔너리(dict)"여름에 대한 짧은 하이쿠를 작성하세요."
gen_ai.promptinputsAI 모델 프롬프트 또는 메시지의 배열리스트(list), 딕셔너리(dict), 문자열(String)[{"role":"user","content":"abc"}]
input.valueinputs모델 호출에 사용되는 입력 값문자열(String), 리스트(list), 딕셔너리(dict){"text":"농담 하나 해 줘"}
mlflow.spanInputsinputs스팬 입력 데이터문자열(String), 리스트(list), 딕셔너리(dict)["프롬프트 텍스트"]
traceloop.entity.inputinputs엔터티 입력 데이터문자열(String), 리스트(list), 딕셔너리(dict)"이 문장을 프랑스어로 번역해 주세요"
gcp.vertex.agent.tool_call_argsinputs도구 호출 인수딕셔너리(dict){"args":{"query":"weather in SF"}}
gcp.vertex.agent.llm_requestinputsLLM 요청 페이로드딕셔너리(dict){"contents":[{"role":"user","parts":[...]}]}
inputinputs일반적인 입력 값문자열(String), 리스트(list), 딕셔너리(dict)"이 텍스트를 요약해 주세요"
inputsinputs일반적인 입력 배열리스트(list), 딕셔너리(dict), 문자열(String)["이 텍스트를 요약해 주세요"]
ai.responseoutputs모델 응답 텍스트 또는 데이터문자열(String), 리스트(list), 딕셔너리(dict)"하이쿠를 하나 지어 봤어요..."
gen_ai.completionoutputsAI 컴플리션 결과값문자열(String), 리스트(list), 딕셔너리(dict)"Completion text"
output.valueoutputs모델에서 생성된 출력 값문자열(String), 리스트(list), 딕셔너리(dict){"text":"Answer text"}
mlflow.spanOutputsoutputs스팬 출력 데이터문자열(String), 리스트(list), 딕셔너리(dict)["answer"]
gen_ai.content.completionoutputs콘텐츠 컴플리션 결과값문자열(String)"Answer text"
traceloop.entity.outputoutputs엔터티 출력 데이터문자열(String), 리스트(list), 딕셔너리(dict)"Answer text"
gcp.vertex.agent.tool_responseoutputs도구 실행 응답값딕셔너리(dict), 문자열(String){"toolResponse":"ok"}
gcp.vertex.agent.llm_responseoutputsLLM 응답 페이로드딕셔너리(dict), 문자열(String){"candidates":[...]}
outputoutputs일반적인 출력 값문자열, 리스트 또는 딕셔너리"Answer text"
outputsoutputs일반적인 출력 배열입니다.리스트, 딕셔너리 또는 문자열["Answer text"]
gen_ai.usage.input_tokensusage.input_tokens사용된 입력 토큰 수.정수42
gen_ai.usage.prompt_tokensusage.prompt_tokens사용된 프롬프트 토큰 수.정수30
llm.token_count.promptusage.prompt_tokens프롬프트 토큰 수.정수30
ai.usage.promptTokensusage.prompt_tokens사용된 프롬프트 토큰 수.정수30
gen_ai.usage.completion_tokensusage.completion_tokens생성된 완료 토큰 수.정수40
llm.token_count.completionusage.completion_tokens완료 토큰 수.정수40
ai.usage.completionTokensusage.completion_tokens생성된 완료 토큰 수.정수40
llm.usage.total_tokensusage.total_tokens요청에 사용된 전체 토큰 수.정수70
llm.token_count.totalusage.total_tokens전체 토큰 수.정수70
gen_ai.systemattributes.system시스템 프롬프트 또는 지침.문자열"당신은 도움이 되는 어시스턴트입니다."
llm.systemattributes.system시스템 프롬프트 또는 지침.문자열"당신은 도움이 되는 어시스턴트입니다."
weave.span.kindattributes.kind스팬의 유형 또는 범주.문자열"llm"
traceloop.span.kindattributes.kind스팬의 유형 또는 범주.문자열"llm"
openinference.span.kindattributes.kind스팬의 유형 또는 범주.문자열"llm"
gen_ai.response.modelattributes.model모델 식별자.문자열"gpt-4o"
llm.model_nameattributes.model모델 식별자.문자열"gpt-4o-mini"
ai.model.idattributes.model모델 식별자.문자열"gpt-4o"
llm.providerattributes.provider모델 제공자 이름.문자열"openai"
ai.model.providerattributes.provider모델 제공자 이름.String"openai"
gen_ai.requestattributes.model_parameters모델 생성에 사용할 매개변수입니다.Dict{"temperature":0.7,"max_tokens":256}
llm.invocation_parametersattributes.model_parameters모델 호출에 사용할 매개변수입니다.Dict{"temperature":0.2}
wandb.display_namedisplay_nameUI에서 사용할 사용자 정의 표시 이름입니다.String"사용자 메시지"
gcp.vertex.agent.session_idthread_id세션 또는 스레드 식별자입니다.String"thread_123"
wandb.thread_idthread_id대화용 스레드 식별자입니다.String"thread_123"
wb_run_idwb_run_id관련된 W&B 실행의 식별자입니다.String"abc123"
wandb.wb_run_idwb_run_id관련된 W&B 실행의 식별자입니다.String"abc123"
gcp.vertex.agent.session_idis_turn이 스팬을 대화 턴으로 표시합니다.Booleantrue
wandb.is_turnis_turn이 스팬을 대화 턴으로 표시합니다.Booleantrue
langfuse.startTimestart_time (재정의)스팬 시작 타임스탬프를 재정의하는 값입니다.Timestamp (ISO8601/unix ns)"2024-01-01T12:00:00Z"
langfuse.endTimeend_time (오버라이드)스팬 종료 타임스탬프를 재정의하는 값입니다.Timestamp (ISO8601/unix ns)"2024-01-01T12:00:01Z"

제한 사항

  • Weave UI는 Chat 뷰에서 OTEL trace tool 호출을 렌더링하는 기능을 지원하지 않습니다. 대신 원시 JSON 형식으로 표시됩니다.