tracegen

module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2021 License: MIT

README

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.

Directories

Path Synopsis
cmd
Code generated by tracegen.
Code generated by tracegen.
bar
foo
Package tracegen provides generator for the OpenTelemetry tracing decorators.
Package tracegen provides generator for the OpenTelemetry tracing decorators.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL