A modular Go CLI application for generating OpenTelemetry logs, metrics, and traces. Designed for maintainability, scalability, and robust handling of sensitive data—ideal for regulated environments (healthcare, finance, etc.).
- Generate OpenTelemetry logs, metrics, and traces
- Flexible CLI and YAML config file support
- Mock data generation with gofakeit
- Sensitive data flagging for attributes and headers
- Human-friendly terminal output and machine-readable JSON logs
- Config diff display: see only non-default config at startup
- Distributed tracing and metrics with OpenTelemetry
Install with Homebrew:
brew tap medxops/toolkit
brew install trazr-gen
You can generate signals right away if you have a collector setup at localhost:4318
:
trazr-gen logs --logs 10
docker pull ghcr.io/medxops/trazr-gen:latest
Same example as above:
docker run --rm ghcr.io/medxops/trazr-gen:latest logs --logs 10 --otlp-endpoint host.docker.internal:4318
Note: Use
host.docker.internal
for the OTLP endpoint to connect to a collector running on your host (macOS/Windows). On Linux, use--network=host
andlocalhost
.
- Download the latest prebuilt binary from the Releases page.
- Choose the appropriate
.tar.gz
or.zip
file for your platform and architecture (e.g.,trazr-gen_windows_amd64.tar.gz
). - Unpack it (using 7-Zip, WinRAR, or built-in tools), then run
trazr-gen.exe
from the extracted folder:.\trazr-gen.exe logs --logs 10
- Choose the appropriate
-
Install with Go (requires Go 1.20+):
go install github.com/medxops/trazr-gen@latest
-
Build from source:
git clone https://github.com/medxops/trazr-gen.git cd trazr-gen go build -o trazr-gen.exe ./cmd/trazr-gen
Generate 10 logs with mock data (collector at http://localhost:4318):
trazr-gen logs --logs 10
Generate metrics for 5 seconds:
trazr-gen metrics --duration 5s
Generate traces with 3 child spans:
trazr-gen traces --child-spans 3
TRAZR-GEN supports configuration via CLI flags or a YAML config file. See all options in config.yaml.
trazr-gen [command] [flags]
logs
Generate OpenTelemetry logsmetrics
Generate OpenTelemetry metricstraces
Generate OpenTelemetry traces
--config
Path to config file--mock-data
Enable mock data templates--otlp-endpoint
OTLP exporter endpoint--service
Service name--log-level
Log level (debug, info, warn, error)--terminal-output
Enable/disable terminal output instead of json log
See trazr-gen [command] --help
or config.yaml for all options.
TRAZR-GEN uses gofakeit for mock data. You can use any gofakeit template in attributes, headers, or log bodies.
Example: Healthcare mock data from a config file:
otlp-attributes:
host.ip: '{{IPv4Address}}'
telemetry-attributes:
patient.name: '{{Name}}'
patient.ssn: '{{SSN}}'
patient.dob: '{{DateRange (ToDate "1924-01-01") (ToDate "2024-12-31")}}'
encounter.procedure: "{{LoremIpsumSentence 10}}"
encounter.type: '{{RandomString (SliceString "inpatient" "outpatient" "emergency")}}'
credit.card.number: '{{CreditCard}}'
sensitive-data:
- patient.name
- patient.ssn
- patient.dob
- host.ip
- credit.card.number
- Body
logs:
body: "{{ErrorDatabase}} - Patient Not Found: MRN{{Number 100000 999999}}"
Sample output from a log collector:
Resource attributes:
-> host.ip: Str(129.108.24.106)
-> trazr.mock.data: Str(host.ip)
-> trazr.sensitive.data: Str(host.ip)
InstrumentationScope
LogRecord #0
ObservedTimestamp: 1970-01-01 00:00:00 +0000 UTC
Timestamp: 2025-06-02 15:32:48.151832 +0000 UTC
SeverityText: Info
SeverityNumber: Info(9)
Body: Str(destination pointer is nil - Patient Not Found: MRN577540)
Attributes:
-> service.name: Str(trazr-gen)
-> credit.card.number: Str({UnionPay 341945079096768 02/30 916})
-> patient.name: Str(Elsie Barton)
-> patient.dob: Str(2010-04-17 06:22:29.470008037 +0000 UTC)
-> patient.ssn: Int(898828744)
-> encounter.procedure: Str(Voluptas recusandae dolores rerum nisi ducimus quasi qui ut accusamus.)
-> encounter.type: Str(inpatient)
-> trazr.sensitive.data: Str(patient.name, patient.ssn, patient.dob, credit.card.number, body)
-> trazr.mock.data: Str(credit.card.number, patient.name, patient.dob, patient.ssn, encounter.procedure, encounter.type, body)
Generate 100 logs with random severity:
trazr-gen logs --logs 100 --severity-number "{{Number 1 24}}" --mock-data true
Generate metrics with custom attributes:
trazr-gen metrics --metrics 5 --otlp-attributes env=prod
Generate traces with a custom span duration:
trazr-gen traces --span-duration 500ms
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
TRAZR-GEN is licensed under the Apache 2.0 License.
2025 Medoya LLC