-
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
[receiver/kafkareceiver] Feature/kafkareceiver avro #21068
[receiver/kafkareceiver] Feature/kafkareceiver avro #21068
Conversation
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.
Those changes look fantastic. Would you be open to becoming a codeowner of this code specifically so we can use your expertise to maintain it going forward?
Sounds good. Only for the avro part? |
Yes? I’m offering but it’s not really up to me. The existing codeowners will weigh in. Given the complexity of the code, I am sure they would be more comfortable with it if you stick around. |
Yes of course. |
Please add yourself in |
0ce432e
to
39902ad
Compare
9155c14
to
c27c617
Compare
c27c617
to
39902ad
Compare
39902ad
to
b5ceb8e
Compare
@atoulme do you know how it is possible to specify ownership for single files? |
Oh just run |
c3225ea
to
52a1ba8
Compare
Rebased main again and removed the file ownership which seems to not work. |
02d9e00
to
a925d08
Compare
All should be good now |
a925d08
to
b55de84
Compare
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.
Could I ask you to update the following:
- Load definition from a provided configuration
- Provide a means of creating immutable Avro serialises
I really worry that it will over complicate the required logic to make it both concurrency safe and feel more at ease with static serialisers.
It is my understanding that Avro will need definition so it knows how to translate the values, hence the Init
method?
I think it makes sense to update the marshaler's loaders to include reading from *Config.Encoding
(I forget the actual type, but something to that affect).
I have a few other comments elsewhere but it is more to improve my understand and provide more help.
} | ||
|
||
func newAVROFileSchemaDeserializer(path string) (avroDeserializer, error) { | ||
schema, err := loadAVROSchemaFromFile(path) |
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.
If possible, could we avoid having a strict method to read from disk when ideally we'd want to read the definition from the configuration?
If you want to make it easier to test with, I changing the method handler to:
func readAVROSchema(r io.Reader) (schema, error)
This would allow you to use bytes.NewBuffer
, strings.Reader
, or os.File
without needing to change the code path that does the main work and make it easier to test.
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.
Another reason we'd want to avoid it to require loading from disk is that we also have to considering the potential security vector that someone could try load from incorrect path (ie: ../../../../../../../../../etc/passwd
).
The config loaders can do this for us to make life easier and not having to repeat the same work again*
*Unless we really must have to.
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.
Thanks for your comments, i'll address them.
b55de84
to
4fa0447
Compare
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
4fa0447
to
9a8a506
Compare
Who needs to sign off on this PR? |
@MovieStoreGuy is the right person to review. I have also triggered the tests just now and removed the stale tag. Please follow up if tests fail. |
5cc6a5d
to
250a3d4
Compare
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
@MovieStoreGu'm can you or someone else please review this PR? @atoulme @pavolloffay Is there a larger group of maintainers that could review this PR? |
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.
The changes make sense to me but I would like to see a exporter definition in a future PR please.
|
||
func setAttribute(attributes *pcommon.Map, key string, value interface{}) { | ||
attribute := attributes.PutEmpty(key) | ||
_ = attribute.FromRaw(value) |
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.
Is this the error being ignored?
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.
Sorry, this should have read, Why is this error be ignored?
kafka: | ||
encoding: avro | ||
avro: | ||
schema: | |
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.
Is there a reference to an external resource that would help someone who is new to avro to understand what is best to put here?
Apologies that I hadn't reviewed this sooner. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
please reopen, pushed the reimplementation based on my comments from #21067 |
Description: Adding avro encoding for kafkareceiver.
Link to tracking Issue: #21067
Testing: added basic test for the new functionality and new yaml config structures
Documentation: added documentation for new config items and an extra example showing how to use Avro structured logging with field mapping and schema referencing