-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[exporter/prometheusremotewrite] feat: prom rw exporter add support for rw2 #35888
base: main
Are you sure you want to change the base?
[exporter/prometheusremotewrite] feat: prom rw exporter add support for rw2 #35888
Conversation
Signed-off-by: Juraj Michalek <[email protected]>
exporter/prometheusremotewriteexporter/generated_component_telemetry_test.go
Outdated
Show resolved
Hide resolved
exporter/prometheusremotewriteexporter/internal/metadata/generated_telemetry.go
Outdated
Show resolved
Hide resolved
exporter/prometheusremotewriteexporter/internal/metadata/generated_telemetry_test.go
Outdated
Show resolved
Hide resolved
Co-authored-by: Bartlomiej Plotka <[email protected]>
Co-authored-by: Bartlomiej Plotka <[email protected]>
Co-authored-by: Bartlomiej Plotka <[email protected]>
Co-authored-by: Bartlomiej Plotka <[email protected]>
Co-authored-by: Bartlomiej Plotka <[email protected]>
Co-authored-by: Bartlomiej Plotka <[email protected]>
Co-authored-by: Bartlomiej Plotka <[email protected]>
needs rebase :/ |
req.Header.Set("Content-Type", "application/x-protobuf;proto=io.prometheus.write.v2.Request") | ||
req.Header.Set("X-Prometheus-Remote-Write-Version", "2.0.0") | ||
default: | ||
return errors.New("proto message validated earlier") |
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.
nit: if we do err check vs panic here, let's do it properly (it's true a later version of this code could by accident remove pre-validation.
return errors.New("proto message validated earlier") | |
return fmt.Errorf("unsupported remote-write protobuf message: %v (should be validated earlier)", prwe.RemoteWriteProtoMsg) |
ok := proto.Unmarshal(dest, wr) | ||
require.NoError(t, ok) | ||
assert.Len(t, wr.Timeseries, expected) | ||
// TODO check labels |
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.
Should there be a GH issue about it to not forget? Or todo now?
buf.protobuf.Reset() | ||
defer bufferPool.Put(buf) | ||
|
||
// Uses proto.Marshal to convert the WriteRequest into bytes array |
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.
This comments repeats in multiple places. Is it really useful?
|
||
// Uses proto.Marshal to convert the WriteRequest into bytes array. | ||
if errMarshal := buf.protobuf.Marshal(request); errMarshal != nil { | ||
errs = multierr.Append(errs, consumererror.NewPermanent(errMarshal)) |
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.
ditto: risk of race here (errs shared by multiple goroutines and not locked)
} | ||
|
||
// TODO implement batching | ||
// TODO how do we handle symbolsTable with batching? |
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.
You have to build separate symbol tables or use a bigger single one, whatever is cheaper.
Description
Draft PR for adding rw2 support in the prometheus remote write exporter.
Very much a draft, not full implementation of the spec with a lot of code duplication and no tests WIP.
TODO:
Link to tracking issue #33661
Fixes
Testing
Documentation