All Projects → rakyll → log-to-xray

rakyll / log-to-xray

Licence: other
Write log entries, get X-Ray traces.

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

logtoxray

Write to logs, get X-Ray traces. No distributed tracing instrumenation library required.

🚧 🚧 🚧 THIS PROJECT IS A WORK-IN-PROGRESS PROTOTYPE.

Installation

$ go get github.com/rakyll/log-to-xray/cmd/logtoxray
$ my_program | logtoxray

Usage

Users should include trace_id and span_id in every entry.

In order to start a new segment, log an entry with start_time.

{
    "trace_id": "1-581cf771-a006649127e371903a2de979",
    "id": "70de5b6f19ff9a0b",
    "name": "auth.CurrentUser",
    "start_time": "2021-06-28 17:09:12.0 -0700 PDT"
}

Append as many as changes with new log entries. Note that trace_id, span_id, start_time and end_time are immutable.

{
    "trace_id": "1-581cf771-a006649127e371903a2de979",
    "id": "70de5b6f19ff9a0b",
    "annotations": {
        "service": "auth",
        "region": "us-east-1"
    }
}

In order to finish a segment, write an entry with end_time:

{
    "trace_id": "1-581cf771-a006649127e371903a2de979",
    "id": "70de5b6f19ff9a0b",
    "end_time": "2021-06-28 17:10:26.086625 -0700 PDT"
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].