open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
2.92k stars 2.29k forks source link

New component: telemetrygen #9597

Closed mx-psi closed 1 year ago

mx-psi commented 2 years ago

Writing this as a new component proposal, even though this is a separate tool like tracegen and not something that would be added to the collector binary

The purpose and use-cases of the new component

Similar to tracegen (see #955) a new telemetrygen tool with support for metrics would be useful for generating a controlled stream of metrics of a given type. This would be useful for:

tracegen is currently provided both as a binary and Docker image. While we don't have exact usage numbers, the Docker image seems to average ~10 downloads per day and there is user interest on keeping the tool working and adding new features as demonstrated by issues like #7308, #7080 and #6671. We expect metricgen would have similar user adoption.

Existing solutions (e.g. using a language library) lack support for legacy metric types like summaries and are cumbersome to use for load testing.

Example configuration for the component

As much as possible, the new tool would adopt the CLI interface from tracegen (by creating a common internal module used by both tools). When generating metrics, it would need to have options for specifying the OTLP metric type to be generated, its aggregation temporality and monotonicity. As an example (modulo defaults and name bikesheding to be decided during implementation):

# Generate default metric type (gauge) for the specified duration
telemetrygen metrics -otlp-insecure -duration 5s

# Generate cumulative monotonic sums indefinitely
telemetrygen metrics -otlp-insecure -type sum -temporality cumulative -monotonic 

Telemetry data types supported

telemetrygen would support traces (by including the code from tracegen) and we would add support for metrics. Eventually, logs support could be added too.

All metric types should be supported, including those that are not generated by language libraries like Summaries.

Sponsor (Optional)

I am happy to sponsor this. Other Datadog employees will contribute in the development and maintenance.

Roadmap

This roadmap will be kept updated to track issues related to telemetrygen.

Phase 1: Moving from tracegen to telemetrygen

mx-psi commented 2 years ago

@open-telemetry/collector-contrib-approvers, two questions about this:

  1. Do you think this needs a sponsor (given it is not a component but a separate tool)? If it needs one, should be someone other than me (or at least a separate approver that says 'this makes sense to add to this repo')? I will review PRs and be a codeowner regardless, but it feels weird to write a proposal and automatically approve it just because I am an approver.
  2. Do you think this should be a separate tool, or would it make sense to unify tracegen and metricgen into a single otlpgen tool?
codeboten commented 2 years ago

I think having this become a telemetrygen makes sense to me, as it's likely the same tool would also be useful for logs. I'm happy to sponsor it.

bogdandrutu commented 2 years ago

+1 for one telemetrygen binary. Consider also to move it to /cmd/telemetrygen, maybe we can also publish the docker :)

TylerHelmuth commented 2 years ago

Publishing an image would be awesome

spencergilbert commented 2 years ago

I didn't see a separate issue for telemetrygen logs - should that be included here or raised in another issue?

mx-psi commented 2 years ago

I didn't see a separate issue for telemetrygen logs - should that be included here or raised in another issue?

I think this should be a separate issue

github-actions[bot] commented 1 year ago

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

atoulme commented 1 year ago

All 3 subtasks are complete, shall we close this issue?

mx-psi commented 1 year ago

I think we can close this yes