8000 Recording OTel LLM metrics to .NET Aspire fails · Issue #1407 · dotnet/dev-proxy · GitHub
[go: up one dir, main page]

Skip to content

Recording OTel LLM metrics to .NET Aspire fails #1407

@waldekmastykarz

Description

@waldekmastykarz

Recording OTel LLM metrics to .NET Aspire fails with the following exception:

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
      An unhandled exception has occurred while executing the request.
      Google.Protobuf.InvalidProtocolBufferException: String is invalid UTF-8.
       ---> System.Text.DecoderFallbackException: Unable to translate bytes [88] at index 1 from specified code page to Unicode.
         at System.Text.DecoderExceptionFallbackBuffer.Throw(Byte[] bytesUnknown, Int32 index)
         at System.Text.DecoderExceptionFallbackBuffer.Fallback(Byte[] bytesUnknown, Int32 index)
         at System.Text.Encoding.GetCharCountWithFallback(ReadOnlySpan`1 bytes, Int32 originalBytesLength, DecoderNLS decoder)
         at System.Text.Encoding.GetCharCountWithFallback(Byte* pBytesOriginal, Int32 originalByteCount, Int32 bytesConsumedSoFar)
         at Google.Protobuf.ParsingPrimitives.ReadRawString(ReadOnlySpan`1& buffer, ParserInternalState& state, Int32 length)
         --- End of inner exception stack trace ---
         at Google.Protobuf.ParsingPrimitives.ReadRawString(ReadOnlySpan`1& buffer, ParserInternalState& state, Int32 length)
         at OpenTelemetry.Proto.Common.V1.KeyValue.pb::Google.Protobuf.IBufferMessage.InternalMergeFrom(ParseContext& input) in /_/artifacts/obj/Aspire.Dashboard/linux-x64/Release/net8.0/linux-x64/opentelemetry/proto/common/v1/Common.cs:line 1254
         at Google.Protobuf.ParsingPrimitivesMessages.ReadMessage(ParseContext& ctx, IMessage message)
         at Google.Protobuf.Collections.RepeatedField`1.AddEntriesFrom(ParseContext& ctx, FieldCodec`1 codec)
         at OpenTelemetry.Proto.Trace.V1.Span.pb::Google.Protobuf.IBufferMessage.InternalMergeFrom(ParseContext& input) in /_/artifacts/obj/Aspire.Dashboard/linux-x64/Release/net8.0/linux-x64/opentelemetry/proto/trace/v1/Trace.cs:line 1615
         at Google.Protobuf.ParsingPrimitivesMessages.ReadMessage(ParseContext& ctx, IMessage message)
         at Google.Protobuf.Collections.RepeatedField`1.AddEntriesFrom(ParseContext& ctx, FieldCodec`1 codec)
         at OpenTelemetry.Proto.Trace.V1.ScopeSpans.pb::Google.Protobuf.IBufferMessage.InternalMergeFrom(ParseContext& input) in /_/artifacts/obj/Aspire.Dashboard/linux-x64/Release/net8.0/linux-x64/opentelemetry/proto/trace/v1/Trace.cs:line 844
         at Google.Protobuf.ParsingPrimitivesMessages.ReadMessage(ParseContext& ctx, IMessage message)
         at Google.Protobuf.Collections.RepeatedField`1.AddEntriesFrom(ParseContext& ctx, FieldCodec`1 codec)
         at OpenTelemetry.Proto.Trace.V1.ResourceSpans.pb::Google.Protobuf.IBufferMessage.InternalMergeFrom(ParseContext& input) in /_/artifacts/obj/Aspire.Dashboard/linux-x64/Release/net8.0/linux-x64/opentelemetry/proto/trace/v1/Trace.cs:line 560
         at Google.Protobuf.ParsingPrimitivesMessages.ReadMessage(ParseContext& ctx, IMessage message)
         at Google.Protobuf.Collections.RepeatedField`1.AddEntriesFrom(ParseContext& ctx, FieldCodec`1 codec)
         at OpenTelemetry.Proto.Collector.Trace.V1.ExportTraceServiceRequest.pb::Google.Protobuf.IBufferMessage.InternalMergeFrom(ParseContext& input) in /_/artifacts/obj/Aspire.Dashboard/linux-x64/Release/net8.0/linux-x64/opentelemetry/proto/collector/trace/v1/TraceService.cs:line 241
         at Aspire.Dashboard.Otlp.Http.OtlpHttpEndpointsBuilder.MessageBindable`1.<>c.<BindAsync>b__5_0(ReadOnlySequence`1 data) in /_/src/Aspire.Dashboard/Otlp/Http/OtlpHttpEndpointsBuilder.cs:line 121
         at Aspire.Dashboard.Otlp.Http.OtlpHttpEndpointsBuilder.ReadOtlpData[T](HttpContext httpContext, Func`2 exporter)
         at Aspire.Dashboard.Otlp.Http.OtlpHttpEndpointsBuilder.MessageBindable`1.BindAsync(HttpContext context, ParameterInfo parameter)
         at Microsoft.AspNetCore.Http.ParameterBindingMethodCache.<ConvertValueTask>g__ConvertAwaited|26_0[T](ValueTask`1 typedValueTask)
         at Microsoft.AspNetCore.Http.RequestDelegateFactory.<>c__DisplayClass101_0.<<HandleRequestBodyAndCompileRequestDelegate>b__0>d.MoveNext()
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)

As a result, no metrics are recorded and displayed in the dashboard. Spans show just fine.

To reproduce, track LLM usage from Azure OpenAI using Dev Proxy v1.2.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0