microsoft / promptflow

Build high-quality LLM apps - from prototyping, testing to production deployment and monitoring.
https://microsoft.github.io/promptflow/
MIT License
9.19k stars 831 forks source link

[Contribution Request] Align promptflow traces and metrics with OpenLLMetry #2162

Open nirga opened 6 months ago

nirga commented 6 months ago

Is your contribution request related to a problem? Please describe. I'm the maintainer of OpenLLMetry where we instrument LLM providers for traces and metrics on top of OpenTelemetry. I'd like to align the way promptflow is reporting these metrics and traces by adopting the OpenLLMetry SDK here.

Detail the functionality and value. Aligning semantic conventions for LLM traces and metrics which can then be supported by different observability platforms; additional frameworks, models and vector dbs instrumented.

Additional context We're working with the otel community on making the attributes we defined the official semantic conventions, and I'm leading the LLM semantic conventions WG to do so.

wangchao1230 commented 6 months ago

Thanks @nirga, promptlfow is working on integrate with open telemetry, i.e. to emit trace produced by promptflow and internall call like OpenAI with open telemetry standard.

I wrote an example on this, which is demostrating Tracing LangChain apps using Prompt flow & OpenTelemery. This is not merged yet, so not fully ready for customer use. In this example, I used the use opentelemetry-instrumentation-langchain package provided by Traceloop. Which is provided by OPenLLMetry I think.

Is this something you epxect to align with?

nirga commented 6 months ago

Yes, but not just that. Also aligning on the spans created by Promptflow itself:

zzn2 commented 6 months ago

Thanks @nirga for reaching out to us. I have some comments in your PR, let's discuss the details there.

nirga commented 6 months ago

Thanks @zzn2! Afterwards, does it make sense to switch using these here as well?

zzn2 commented 6 months ago

Yes. We can align with the convention when it goes stable.