Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceException when log event is missing body #6703

Open
1 task done
codefromthecrypt opened this issue Nov 18, 2024 · 0 comments · May be fixed by #6725
Open
1 task done

NullReferenceException when log event is missing body #6703

codefromthecrypt opened this issue Nov 18, 2024 · 0 comments · May be fixed by #6725

Comments

@codefromthecrypt
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

opentelemetry-instrumentation-openai-v2 has a configuration that results in log events missing a body. Specifically this is when OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=false.

Right now, these aren't processed properly and result in an error in the console.

Expected Behavior

log events without a body, should be processed and result in a row saying either nothing for the "message" or something like N/A

Steps To Reproduce

send a message like this to aspire's grpc endpoint

{
    "body": null,
    "severity_number": "<SeverityNumber.INFO: 9>",
    "severity_text": null,
    "attributes": {
        "gen_ai.system": "openai",
        "event.name": "gen_ai.user.message"
    },
    "dropped_attributes": 0,
    "timestamp": "2024-11-18T01:35:17.645811Z",
    "observed_timestamp": "2024-11-18T01:35:17.645818Z",
    "trace_id": "0x686742abcda6e1f53351a1b160449a75",
    "span_id": "0x77f0e85389d498f8",
    "trace_flags": 1,
    "resource": {
        "attributes": {
            "telemetry.sdk.language": "python",
            "telemetry.sdk.name": "opentelemetry",
            "telemetry.sdk.version": "1.28.1",
            "telemetry.auto.version": "0.49b1",
            "service.name": "unknown_service"
        },
        "schema_url": ""
    }
}

Exceptions (if any)

info: Aspire.Dashboard.Otlp.Storage.TelemetryRepository[0]
      Error adding log entry.
      System.NullReferenceException: Object reference not set to an instance of an object.
         at Aspire.Dashboard.Otlp.Model.OtlpHelpers.GetString(AnyValue value) in /_/src/Aspire.Dashboard/Otlp/Model/OtlpHelpers.cs:line 96
         at Aspire.Dashboard.Otlp.Model.OtlpLogEntry..ctor(LogRecord record, OtlpApplicationView logApp, OtlpScope scope, OtlpContext context) in /_/src/Aspire.Dashboard/Otlp/Model/OtlpLogEntry.cs:line 55
         at Aspire.Dashboard.Otlp.Storage.TelemetryRepository.AddLogsCore(AddContext context, OtlpApplicationView applicationView, RepeatedField`1 scopeLogs) in /_/src/Aspire.Dashboard/Otlp/Storage/TelemetryRepository.cs:line 320

.NET Version info

No response

Anything else?

I used docker run --rm -it -p 18888:18888 -p 4317:18889 --name aspire-dashboard mcr.microsoft.com/dotnet/aspire-dashboard:9.0

@joperezr joperezr added the untriaged New issue has not been triaged label Nov 18, 2024
@JamesNK JamesNK self-assigned this Nov 19, 2024
@JamesNK JamesNK linked a pull request Nov 19, 2024 that will close this issue
18 tasks
@JamesNK JamesNK removed the untriaged New issue has not been triaged label Nov 19, 2024
@JamesNK JamesNK modified the milestone: 9.1 Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants