telemetrygen

command module
v0.102.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

README

Telemetry generator for OpenTelemetry

Status
Stability development: metrics, logs
alpha: traces
Issues Open issues Closed issues
Code Owners @mx-psi, @codeboten

This utility simulates a client generating traces, metrics, and logs. It is useful for testing and demonstration purposes.

Installing

To install the latest version run the following command:

go install github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen@latest

Check the go install reference to install specific versions.

Docker build

You can build locally the Docker image with:

make docker-telemetrygen

Using github actions, we also push a docker image on commit to main or on release to this Github docker registry.

Running

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

processors:
  batch:

exporters:
  debug:
    verbosity: detailed

service:
  pipelines:
    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [debug]
    metrics:
      receivers: [otlp]
      processors: [batch]
      exporters: [debug]
    traces:
      receivers: [otlp]
      processors: [batch]
      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.86.0

Other options for running the collector are documented here https://opentelemetry.io/docs/collector/getting-started/

Once the OpenTelemetry Collector instance is up and running, run telemetrygen for your desired telemetry:

Traces
telemetrygen traces --otlp-insecure --duration 5s

Or, to generate a specific number of traces:

telemetrygen traces --otlp-insecure --traces 1

To send traces in secure connection, see examples/secure-tracing

Check telemetrygen traces --help for all the options.

Logs
telemetrygen logs --duration 5s --otlp-insecure
Metrics
telemetrygen metrics --duration 5s --otlp-insecure

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
e2etest Module

Jump to

Keyboard shortcuts

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