Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Saturn logging fixes #38

Closed
guanzo opened this issue Feb 21, 2023 · 0 comments · Fixed by #40
Closed

Saturn logging fixes #38

guanzo opened this issue Feb 21, 2023 · 0 comments · Fixed by #40
Assignees

Comments

@guanzo
Copy link
Contributor

guanzo commented Feb 21, 2023

There's a few issues that need to be fixed for Saturn logging.

  • The URL should be the URL that was requested. Currently it's an ip address

    caboose/pool.go

    Line 368 in ebf9e25

    URL: from,

    It should be this template with values filled in.

    caboose/pool.go

    Line 342 in ebf9e25

    var saturnReqTmpl = "https://%s/ipfs/%s?format=raw"

  • Rename localTime to startTime

    caboose/pool.go

    Line 369 in ebf9e25

    LocalTime: start,

  • Rename requestDuration to requestDurationSec

    caboose/pool.go

    Line 372 in ebf9e25

    RequestDuration: durationSecs,

  • Log is missing a nodeId field. The value is obtained from the Saturn-Node-Id response header.

  • requestId should be obtained from the Saturn-Transfer-Id response header instead of generating a UUID.

    caboose/pool.go

    Line 346 in ebf9e25

    requestId := uuid.NewString()

  • cacheHit should be obtained from the Saturn-Cache-Status response header instead of hardcoding to false.
    Check if the response header value equals HIT.

    caboose/pool.go

    Line 367 in ebf9e25

    CacheHit: false,

  • numBytesSent should include the size of the headers.

    caboose/pool.go

    Lines 370 to 371 in ebf9e25

    // TODO: does this include header sizes?
    NumBytesSent: received,

  • clientAddress and userAgent do not need to be set in the logs as the receiving server can obtain both fields from the request.

    caboose/pool.go

    Line 378 in ebf9e25

    ClientAddress: "",

  • If a range request was sent, the value should have the same format as the Range request header ( bytes=<start>-<end>). Otherwise an empty string is fine.

    caboose/pool.go

    Line 379 in ebf9e25

    Range: "",

  • Log is missing an ifNetworkError field. If a request fails due to a network error (a connection was never established, a response was never received, a TLS error, etc), this value should be set with the error message. It doesn't need to be sent if null.

  • Please add a nodeIpAddress field. The IP address of the saturn node you sent the request to.

  • The log POST request should include this request header: Authorization: Bearer <base64_jwt>.
    The jwt will be provided to the Caboose DRI.

More info here: https://www.notion.so/pl-strflt/Saturn-Payments-Logging-8db8d7b691a9471aaf786947a6b8b0a6

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants