New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OTLP: Use optimized OTel metric translator, converting directly to Mimir format #7957
base: main
Are you sure you want to change the base?
Conversation
144d40d
to
6ecf12a
Compare
383bb02
to
67cc712
Compare
954bd60
to
c4ec41e
Compare
676a2d6
to
2cd0094
Compare
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
de15a8c
to
88ba95d
Compare
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
88ba95d
to
2ea6c1a
Compare
generate-otlp: | ||
cd pkg/distributor/otlp && go generate | ||
|
||
.PHONY: check-generated-otlp-code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the weekly: we have a general pattern to pick up changes: first delete the generated files *_generated.go
and then re-generate and check if there's any change picked up by git. See the use of ./tools/find-diff-or-untracked.sh
in the Makefile. This handles files missing/added and if the generator itself fails.
return check(sourceRefPath) | ||
} | ||
|
||
sources, sourceRef, err := downloadSources(sourceRefPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand why we need to download the sources? If we put a reference to the sources anywhere (make a test/dummy command), they would be downloaded by go mod vendor
wouldn't they?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea @krajorama - my thinking was that these sources wouldn't be vendored. I guess it's preferable to rely on vendoring.
What this PR does
Use optimized OTel metric translator in OTLP endpoint, converting directly to Mimir format.
The translation code is generated by downloading Go sources from mimir-prometheus, and transforming them to use Mimir protobuf types and enums via the gopatch tool. The generated files (_generated.go suffix) are checked into Git, and CI verifies that they are up to date with the mimir-prometheus version depended on.
The workflow should be that when we update the mimir-prometheus dependency, we should also execute
make generate-otlp
, to make sure we have the latest translation code. It's a minor hassle, but I think the performance gains are worth it.TODO
Benchmark results
Which issue(s) this PR fixes or relates to
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
.about-versioning.md
updated with experimental features.