Crates.io Workflow Status

tracebuild

A small binary to instrument builds in systems like GitHub Actions, Travis CI, etc. It uses OpenTelemetry under the hood, which means you should be able to integrate it in your existing telemetry platform.

Usage

Install the binary in your build:

curl -L -o tracebuild https://github.com/frigus02/tracebuild/releases/latest/download/tracebuild-linux-amd64 chmod +x tracebuild

Generate IDs and start times

BUILD_ID=$(tracebuild id) STEP_ID=$(tracebuild id) BUILD_START=$(tracebuild now) STEP_START=$(tracebuild now)

Wrap each command in:

tracebuild cmd --build $BUILD_ID [--step $PARENT_SPAN_ID] -- my-cmd --with params

After each step:

tracebuild step --build $BUILD_ID [--step $PARENT_SPAN_ID] --id $STEP_ID --start-time $STEP_START [--name $STEP_NAME] [--status <success|failure>]

After the entire build:

tracebuild build --id $BUILD_ID --start-time $BUILD_START [--name $BUILD_NAME] [--branch $BRANCH] [--commit --$COMMIT] [--status <success|failure>]

Configuration

Configure the exporter using environment variables.

| Variable | Description | Default | | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ---------------------- | | OTELTRACESEXPORTER | OpenTelemetry trace exporter to use. Supported are: otlp, jaeger | otlp | | OTELEXPORTEROTLPENDPOINT | | https://localhost:4317 | | OTELEXPORTEROTLPTRACESENDPOINT | | https://localhost:4317 | | OTELEXPORTERJAEGERAGENTHOST | | 127.0.0.1 | | OTELEXPORTERJAEGERAGENTPORT | | 6831 | | OTELEXPORTERJAEGERENDPOINT | Jaeger collector endpoint. If specified, this is used instead of the Jaeger agent. Example: http://localhost:14268/api/traces | | | OTELEXPORTERJAEGERUSER | Jaeger collector user for basic auth. | | | OTELEXPORTERJAEGERPASSWORD | Jaeger collector password for basic auth. | |