Skip to content

Tool for generating OpenTelemetry tracing decorators.

License

Notifications You must be signed in to change notification settings

KazanExpress/tracegen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tracegen Actions Status go report card PkgGoDev

Tool for generating OpenTelemetry tracing decorators.

Installation

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 and tests 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.

About

Tool for generating OpenTelemetry tracing decorators.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published