Gregor Zeitlinger
f01718262a
promql: Extend testing framework to support native histograms This includes both the internal testing framework as well as the rules unit test feature of promtool. This also adds a bunch of basic tests. Many of the code level tests can now be converted to tests within the framework, and more tests can be added easily. --------- Signed-off-by: Harold Dost <h.dost@criteo.com> Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> Signed-off-by: Stephen Lang <stephen.lang@grafana.com> Co-authored-by: Harold Dost <h.dost@criteo.com> Co-authored-by: Stephen Lang <stephen.lang@grafana.com> Co-authored-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> |
1 year ago | |
---|---|---|
.. | ||
prometheus |
…
|
|
prometheusremotewrite |
…
|
|
README.md |
…
|
|
update-copy.sh |
…
|
README.md
Copying from opentelemetry/opentelemetry-collector-contrib
This files in the prometheus/
and prometheusremotewrite/
are copied from the OpenTelemetry Project1.
This is done instead of adding a go.mod dependency because OpenTelemetry depends on prometheus/prometheus
and a cyclic dependency will be created. This is just a temporary solution and the long-term solution is to move the required packages from OpenTelemetry into prometheus/prometheus
.
We don't copy in ./prometheus
through this script because that package imports a collector specific featuregate package we don't want to import. The featuregate package is being removed now, and in the future we will copy this folder too.
To update the dependency is a multi-step process:
- Vendor the latest
prometheus/prometheus
@main
intoopentelemetry/opentelemetry-collector-contrib
- Update the VERSION in
update-copy.sh
. - Run
./update-copy.sh
.
Why copy?
This is because the packages we copy depend on the prompb
package. While the package is relatively stable, there are still changes. For example, https://github.com/prometheus/prometheus/pull/11935 changed the types.
This means if we depend on the upstream packages directly, we will never able to make the changes like above. Hence we're copying the code for now.
I need to manually change these files
When we do want to make changes to the types in prompb
, we might need to edit the files directly. That is OK, please let @gouthamve or @jesusvazquez know so they can take care of updating the upstream code (by vendoring in prometheus/prometheus
upstream and resolving conflicts) and then will run the copy
script again to keep things updated.