// Code generated by Fern. DO NOT EDIT.

package opentelemetry

import (
    core "pentagi/pkg/observability/langfuse/api/core"
    internal "pentagi/pkg/observability/langfuse/api/internal"
    context "context"
    api "pentagi/pkg/observability/langfuse/api"
    option "pentagi/pkg/observability/langfuse/api/option"
)


type Client struct {
    WithRawResponse *RawClient

    options *core.RequestOptions
    baseURL string
    caller *internal.Caller
}

func NewClient(options *core.RequestOptions) *Client {
    return &Client{
        WithRawResponse: NewRawClient(options),
        options: options,
        baseURL: options.BaseURL,
        caller: internal.NewCaller(
            &internal.CallerParams{
                Client: options.HTTPClient,
                MaxAttempts: options.MaxAttempts,
            },
        ),
    }
}

// **OpenTelemetry Traces Ingestion Endpoint**
// 
// This endpoint implements the OTLP/HTTP specification for trace ingestion, providing native OpenTelemetry integration for Langfuse Observability.
// 
// **Supported Formats:**
// - Binary Protobuf: `Content-Type: application/x-protobuf`
// - JSON Protobuf: `Content-Type: application/json`
// - Supports gzip compression via `Content-Encoding: gzip` header
// 
// **Specification Compliance:**
// - Conforms to [OTLP/HTTP Trace Export](https://opentelemetry.io/docs/specs/otlp/#otlphttp)
// - Implements `ExportTraceServiceRequest` message format
// 
// **Documentation:**
// - Integration guide: https://langfuse.com/integrations/native/opentelemetry
// - Data model: https://langfuse.com/docs/observability/data-model
func (c *Client) Exporttraces(
    ctx context.Context,
    request *api.OpentelemetryExportTracesRequest,
    opts ...option.RequestOption,
) (*api.OtelTraceResponse, error){
    response, err := c.WithRawResponse.Exporttraces(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

