Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kazanexpress/tracegen
Tool for generating OpenTelemetry tracing decorators.
https://github.com/kazanexpress/tracegen
golang opentelemetry
Last synced: about 2 months ago
JSON representation
Tool for generating OpenTelemetry tracing decorators.
- Host: GitHub
- URL: https://github.com/kazanexpress/tracegen
- Owner: KazanExpress
- License: mit
- Created: 2021-09-25T16:09:08.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-03-02T15:56:53.000Z (almost 2 years ago)
- Last Synced: 2024-06-20T12:24:42.812Z (7 months ago)
- Topics: golang, opentelemetry
- Language: Go
- Homepage:
- Size: 29.3 KB
- Stars: 7
- Watchers: 7
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# tracegen [![Actions Status](https://github.com/KazanExpress/tracegen/actions/workflows/go.yaml/badge.svg?branch=master)](https://github.com/KazanExpress/tracegen/actions) [![go report card](https://goreportcard.com/badge/github.com/KazanExpress/tracegen)](https://goreportcard.com/report/github.com/KazanExpress/tracegen) [![PkgGoDev](https://pkg.go.dev/badge/github.com/KazanExpress/tracegen)](https://pkg.go.dev/github.com/KazanExpress/tracegen)
Tool for generating OpenTelemetry tracing decorators.
## Installation
```shell
go get -u github.com/KazanExpress/tracegen/cmd/...
```## Usage
```
tracegen generates OpenTelemetry tracing decorators.It scans the public interfaces in the specified source file and generates a
decorator for each one. Use @trace annotation in the method doc to specify the
traceable parameters (comma separated list). You can access nested fields and
types (Array, Bool, Int,Int64, Float64, String, Unknown). If no type is
specified, Unknown will be used by default. Values with Unknown type will be
JSON encoded or formatted to string, according to the Go formatting rules, if
the former is not possible. Example: "@trace Int64:id".Requirements and restrictions:
- each interface method must have "ctx context.Context" parameter;
- don't combine parameters of the same type (for example "Do(a, b string)");Params:
-destination string
Output file; defaults to stdout.
-source string
Input file; defaults to $GOFILE.
```## Examples
See [examples](./examples) and [tests](./tracegen/tracegen_test.go) for more information.
## Issue tracker
Please report any bugs and enhancement ideas using the GitHub issue tracker:
https://github.com/KazanExpress/tracegen/issues
Feel free to also ask questions on the tracker.