{"id":20388582,"url":"https://github.com/efureev/tracefall","last_synced_at":"2026-05-29T21:31:03.712Z","repository":{"id":57495668,"uuid":"149088731","full_name":"efureev/tracefall","owner":"efureev","description":"tracer logs","archived":false,"fork":false,"pushed_at":"2019-02-15T10:46:35.000Z","size":868,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-15T09:02:37.263Z","etag":null,"topics":["debug","go","logs","trace","tracer"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/efureev.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-17T07:51:56.000Z","updated_at":"2022-03-16T19:21:49.000Z","dependencies_parsed_at":"2022-09-02T19:51:57.381Z","dependency_job_id":null,"html_url":"https://github.com/efureev/tracefall","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efureev%2Ftracefall","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efureev%2Ftracefall/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efureev%2Ftracefall/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efureev%2Ftracefall/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/efureev","download_url":"https://codeload.github.com/efureev/tracefall/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241940541,"owners_count":20045878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debug","go","logs","trace","tracer"],"created_at":"2024-11-15T03:11:40.191Z","updated_at":"2026-05-29T21:31:03.677Z","avatar_url":"https://github.com/efureev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/efureev/tracefall.svg?branch=master)](https://travis-ci.org/efureev/tracefall)\n[![Version](https://img.shields.io/badge/version-1.0.2-blueviolet.svg)](https://travis-ci.org/efureev/tracefall)\n[![Maintainability](https://api.codeclimate.com/v1/badges/c933f06740177611ff5a/maintainability)](https://codeclimate.com/github/efureev/tracefall/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/c933f06740177611ff5a/test_coverage)](https://codeclimate.com/github/efureev/tracefall/test_coverage)\n[![Go Report Card](https://goreportcard.com/badge/github.com/efureev/tracefall)](https://goreportcard.com/report/github.com/efureev/tracefall)\n[![codecov](https://codecov.io/gh/efureev/tracefall/branch/master/graph/badge.svg)](https://codecov.io/gh/efureev/tracefall)\n\n## Info\nPackage for sending logs to the storage, for the subsequent withdrawal of the traceViewer service and display there.\n\nSupported storage drivers:  \n- [x] Console // invalid realisation\n- [x] Postgres // invalid realisation\n- [ ] Algolia\n- [ ] ElasticSearch \n\n## Content\n- Thread Line: Line of logs. Contains Logs. Thread ID = First root Log ID \n- Log: data node. May contents other Logs as children\n\n## ScreenShort of TraceViewer based on traceFall\n![screen of trace viewer](./static/screenshort.png)\n\n## Union Logs\nIndependent Logs may union to one log thread via `LogParentShadow`\n```go\nlogChild := tracefall.NewLog(`prepare Scrapping`).SetApplication(`micro.1`)\nlogChild.ParentFromShadow(job.LogShadow)\n```\n#### Example\n`microservice #1`\n```go\nlogParent := tracefall.NewLog(`Start`)\n// send to RabbitMQ job with logParent.ToShadow() data\n```\n`microservice #2`\n```go\n// get from RabbitMQ job with logParent.ToShadow() data\nlogChild := tracefall.NewLog(`prepare Scrapping`).SetApplication(`micro.2`)\nlogChild.ParentFromShadow(job.LogShadow)\n```\nNow `logChild` has parent `logParent`\n\n## Use\n\n**Create new Log node**\n```go\nimport \"github.com/efureev/tracefall\"\n// ...\nlog := tracefall.NewLog(`test log`)\n```\n\n**Finish log**\n```go\nlog := tracefall.NewLog(`test log`)\n\n// with fail result\nlog.Fail(err error)\n\n// with success result \nlog.Success()\n\n// without result: set finish time of the log\nlog.FinishTimeEnd()\n\n```\n**Finish thred of logs**\n```go\nlog.ThreadFinish()\n```\n\n**Add extra data to Log**\n```go\nlog := tracefall.NewLog(`test log`)\nlog.Data.Set(`url`, `http://google.com`).Set(`service`, service.Name)\n```\n\n**Add notes to Log**\n```go\nlog.Notes.Add(`send to redis`, `ok`).Add(`send to rabbit`, `ok`)\n//or\nlog.Notes.AddGroup(`send to redis`, [`ping`,`processing`,`done`])\n```\n\n\n**Sending logs to storage**\n```go\nvar logStorage *tracefall.DB\nfunc tracerLogStart(tracerHost, tracerUser, tracerPassword, tracerDbName, tracerTable string) {\n\tvar err error\n\n\tlogStorage, err = tracefall.Open(`postgres`, postgres.GetConnParams(tracerHost, tracerDbName, tracerTable, tracerUser, tracerPassword))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\nfunc send(m) {\n\tif logStorage == nil {\n        return\n    }\n\t_, err := logStorage.Send(m *tracefall.Log)\n    if err != nil {\n        fmt.Println(`[error sent to trace logs] -\u003e ` + err.Error())\n    }\n}\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefureev%2Ftracefall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fefureev%2Ftracefall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefureev%2Ftracefall/lists"}