Prompt flow

Create flows using Microsoft PromptFlow and send their traces to the Arize platform. Traces are fully OpenTelemetry compatible and can be sent to any OpenTelemetry collector for viewing.

This integration will allow you to trace Microsoft PromptFlow flows and send their traces into Arize.

pip install arize-otel promptflow

Import arize_otel and other dependencies required for setup.

import os
from arize_otel import register_otel, Endpoints
from opentelemetry.sdk.environment_variables import OTEL_EXPORTER_OTLP_ENDPOINT
from promptflow.tracing._start_trace import setup_exporter_from_environ

Set up OpenTelemetry using our convenience function: register_otel with your Arize credentials.

# Setup OTEL via our convenience function
register_otel(
    endpoints = Endpoints.ARIZE,
    space_id = "INSERT_YOUR_ARIZE_SPACE_ID_HERE", # in app space settings page
    api_key = "INSERT_YOUR_ARIZE_API_KEY_HERE", # in app space settings page
    model_id = "INSERT_MODEL_NAME_HERE", # name this to whatever you would like
)

Then set up the OpenTelemetry endpoint to be Arize and use Prompt flow's setup_exporter_from_environ to start tracing any further flows and LLM calls.

os.environ[OTEL_EXPORTER_OTLP_ENDPOINT] = Endpoints.ARIZE
setup_exporter_from_environ()

Proceed with creating Prompt flow flows as usual. See this example notebook for inspiration.

Last updated

Copyright © 2023 Arize AI, Inc