Giter Club home page Giter Club logo

Comments (3)

wxpjimmy avatar wxpjimmy commented on July 18, 2024

OTLPSpanExporter expects an endpoint of: OTLPSpanExporter(endpoint="/v1/traces")
OTLPMetricExporter expects an endpoint of: OTLPMetricExporter(endpoint="/v1/metrics")

Could you provide more details on this? I don't think the suffix is needed here if you use OTEL_EXPORTER_OTLP_ENDPOINT.

In the latest code, this is what promptflow supported now:

  • Support trace/metrics/log exporter, you can configure it via a common OTEL_EXPORTER_OTLP_ENDPOINT or you can configure to enable each one separately with OTEL_EXPORTER_OTLP_METRICS_ENDPOINT, OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, OTEL_EXPORTER_OTLP_LOGS_ENDPOINT;
  • Support both http and grpc OTLP collector, by default it's http, you can use a grpc server by
    • add the opentelemetry-exporter-otlp-proto-grpc dependency in your requirements.txt
    • configure OTEL_EXPORTER_OTLP_PROTOCOL=grpc

I'll close this first, let me know whether this can meet your expectation. @joshuaphelpsms, if not, feel free to re-open and we can continue the discussion.

from promptflow.

joshuaphelpsms avatar joshuaphelpsms commented on July 18, 2024

Since the endpoint is passed explicitly to the OTLPMetricExporter and OTLPSpanExporter's, it must have the /v1/traces or /v1/metrics in the endpoint.

If no endpoint is passed then it will fall back to the environment variables. See how the endpoint is currently passed to the constructor for prompt flow:

https://github.com/microsoft/promptflow/blob/main/src/promptflow-core/promptflow/core/_serving/extension/otel_exporter_provider_factory.py#L182

Looking through the OpenTelemetry code for http/proto, the order of precedence for traces would be:

  1. Endpoint is passed explicitly to the constructor (must include /v1/traces)
  2. OTEL_EXPORTER_OTLP_TRACES_ENDPOINT environment var- (must include /v1/traces)
  3. OTEL_EXPORTER_OTLP_ENDPOINT environment var - (/v1/traces is appended to the endpoint for us, so we do not include /v1/traces)
  4. If no endpoint or environment variables are set, it defaults to http://localhost:4318/v1/traces

I think what you probably want is to not pass the endpoint explicitly and rely on the environment variables to set the endpoint.

from promptflow.

joshuaphelpsms avatar joshuaphelpsms commented on July 18, 2024

FYI: I am unable to reopen the issue because it was not closed by me

from promptflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.