Skip to content

otel-cli exec doesn't successfully parse a result from an HTTP service #262

@parsonsmatt

Description

@parsonsmatt

While diagnosing how to make trapping signals work in Go, I identified that using an HTTP client has a bug. The call to processHTTPStatus here goes on to do proto.Unmarshal. When communicating with Honeycomb, this causes an error, because Honeycomb returns JSON.

Debug output:

guess we're almost done. resp:  &{200 OK 200 HTTP/1.1 1 1 map[Access-Control-Allow-Origin:[*] Connection:[keep-alive] Content-Length:[2] Content-Type:[application/json] Date:[Fri, 08 Sep 2023 02:16:22 GMT] Vary:[Accept-Encoding]] 0xc000674300 2 [] false false map[] 0xc00015e400 0xc000197a20}

Specifically Content-Type:[application/json].

Changing proto.Unmarshal to json.Unmarshal appears to fix the issue for the Honeycomb case, but i suspect that you'd want to use the content-type to determine the exact unmarshal function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions