doc.go 1.8 KB

123456789101112131415161718192021222324
  1. // Copyright The OpenTelemetry Authors
  2. // SPDX-License-Identifier: Apache-2.0
  3. // Package metrics contains functionality for testing an otelcol pipeline end to end for metric correctness.
  4. // Partly because of how Prometheus works (being pull-based) metrics correctness works differently than
  5. // the performance testbed in the parent directory. Whereas performance testing sends a relatively large
  6. // number of data-points into the collector, this package sends metrics in one at a time, and only sends the
  7. // next datapoint when the previous datapoint has been processed and compared to the original.
  8. //
  9. // Mostly similar to the performance testing pipeline, this pipeline looks like the following:
  10. // [testbed exporter] -> [otelcol receiver] -> [otelcol exporter] -> [testbed receiver] -> [test harness]
  11. //
  12. // the difference being the testHarness, which is connected to [testbed receiver] as its metrics
  13. // consumer, listening for data-points. To start the process, one datapoint is sent into the testbed
  14. // exporter, it goes through the pipeline, and arrives at the testbed receiver, which passes it along to the
  15. // test harness. The test harness compares the received datapoint to the original datapoint it sent, and saves
  16. // any diffs it found in a diffAccumulator instance. Then it sends the next datapoint. This continues until
  17. // there are no more data-points. The simple diagram above should have a loop, where [test harness] connects
  18. // back to [testbed exporter].
  19. //
  20. // Data-points are supplied to the testHarness by a metricSupplier, which receives all of the metrics it needs
  21. // upfront. Those metrics are in turn generated by a metricGenerator, which receives its config from a PICT
  22. // generated file, as the trace correctness functionality does.
  23. package metrics // import "github.com/open-telemetry/opentelemetry-collector-contrib/testbed/correctnesstests/metrics"