| Status | |
|---|---|
| Stability | alpha: metrics, traces, logs |
| Issues | |
| Code Owners | @mx-psi, @codeboten, @Erog38, @bogdan-st |
This utility simulates a client generating traces, metrics, and logs. It is useful for testing and demonstration purposes.
To install the latest version run the following command:
go install github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen@latestCheck the go install reference to install specific versions.
You can build locally the Docker image with:
make docker-telemetrygenUsing github actions, we also push a docker image on commit to main or on release to this Github docker registry.
First, you'll need an OpenTelemetry Collector to receive the telemetry data. Follow the project's instructions for a detailed setting up guide. The following configuration file should be sufficient:
config.yaml:
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
exporters:
debug:
verbosity: detailed
service:
pipelines:
logs:
receivers: [otlp]
exporters: [debug]
metrics:
receivers: [otlp]
exporters: [debug]
traces:
receivers: [otlp]
exporters: [debug]Starting OpenTelemetry collector via docker:
docker run -p 4317:4317 -v $(pwd)/config.yaml:/etc/otelcol-contrib/config.yaml ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.149.0
Other options for running the collector are documented here https://opentelemetry.io/docs/collector/getting-started/
The maximum time to wait for signals to reach the destination can be configured with the following flag:
--timeout=10s #Defaults to 10sAll telemetry signals have batching capability configurable with the following flags:
--batch=false #Defaults to true, no flag needed for batching--batch-size=1000 #Defaults to 100Once the OpenTelemetry Collector instance is up and running, run telemetrygen for your desired telemetry:
telemetrygen traces --otlp-insecure --duration 5sOr, to generate a specific number of traces:
telemetrygen traces --otlp-insecure --traces 1Or, to generate traces continuously (use --duration inf with --rate for throttling):
telemetrygen traces --otlp-insecure --duration inf --rate 0.1To send traces in secure connection, see examples/secure-tracing
Check telemetrygen traces --help for all the options.
telemetrygen logs --otlp-insecure --duration 5sOr, to generate a specific number of logs:
telemetrygen logs --otlp-insecure --logs 1Or, to generate logs continuously:
telemetrygen logs --otlp-insecure --duration inf --rate 0.1To send logs in secure connection, see examples/secure-tracing
Check telemetrygen logs --help for all the options.
telemetrygen metrics --otlp-insecure --duration 5sOr, to generate a specific number of metrics:
telemetrygen metrics --otlp-insecure --metrics 1Or, to generate metrics continuously:
telemetrygen metrics --otlp-insecure --duration inf --rate 0.1To send metrics in secure connection, see examples/secure-tracing
Check telemetrygen metrics --help for all the options.