Skip to content
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

Add support for custom event writer #388

Merged
merged 10 commits into from
May 29, 2024

Conversation

sergiojrdotnet
Copy link
Contributor

This proposal enables users to supply their own event writers, while also honoring the serialization options they specify.
Furthermore, it introduces the capability to represent enums as strings, thereby enhancing flexibility and usability.

Generated files have been updated by Elastic.CommonSchema.Generator project

Copy link
Member

@Mpdreamz Mpdreamz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work @sergiojrdotnet ❤️

Added one small nag I am happy to take on, let me know if you want to address it.

@Mpdreamz
Copy link
Member

run docs-build

Copy link
Member

@Mpdreamz Mpdreamz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some integration test failures sadly:

Elastic.Extensions.Logging.IntegrationTests

  • .LoggingToDataStreamTests.SerializesAndDeserializesMessageTemplateAndScope [FAIL]
  • .LoggingToIndexTests.SerializesAndDeserializesMessageTemplateAndScope [FAIL]
  • .LoggingToIndexTests.LogsEndUpInCluster [FAIL]
  • .LoggingToDataStreamTests.MessageTemplateOnLogIsNotTemplatedScope [FAIL]
  • .LoggingToDataStreamTests.LogsEndUpInCluster [FAIL]
  Failed Elastic.Extensions.Logging.IntegrationTests.LoggingToDataStreamTests.SerializesAndDeserializesMessageTemplateAndScope [1 s]
  Error Message:
   Expected listener.PublishSuccess to be true because Failed publish over channel: EcsDataStreamChannel`1.
Exported Buffers: 1
Exported Items: 1
Export Responses: 0
Export Retries: 0
Export Exhausts: 0
Export Returned Items to retry: False
Inbound Buffer Read Loop Started: True
Inbound Buffer Publishes: 1
Inbound Buffer Publish Failures: 0
Outbound Buffer Read Loop Started: True
Outbound Buffer Read Loop Exited: False
Outbound Buffer Publishes: 1
Outbound Buffer Publish Failures: 0
Exception: Elastic.Transport.UnexpectedTransportException: JsonTypeInfo metadata for type 'System.String' was not provided by TypeInfoResolver of type 'Elastic.CommonSchema.Serialization.EcsJsonContext'. If using source generation, ensure that all root types passed to the serializer have been annotated with 'JsonSerializableAttribute', along with any types that might be serialized polymorphically. The unsupported member type is located on type 'Elastic.CommonSchema.Log'. Path: $.
 ---> System.NotSupportedException: JsonTypeInfo metadata for type 'System.String' was not provided by TypeInfoResolver of type 'Elastic.CommonSchema.Serialization.EcsJsonContext'. If using source generation, ensure that all root types passed to the serializer have been annotated with 'JsonSerializableAttribute', along with any types that might be serialized polymorphically. The unsupported member type is located on type 'Elastic.CommonSchema.Log'. Path: $.
 ---> System.NotSupportedException: JsonTypeInfo metadata for type 'System.String' was not provided by TypeInfoResolver of type 'Elastic.CommonSchema.Serialization.EcsJsonContext'. If using source generation, ensure that all root types passed to the serializer have been annotated with 'JsonSerializableAttribute', along with any types that might be serialized polymorphically.

@sergiojrdotnet
Copy link
Contributor Author

sergiojrdotnet commented May 28, 2024

It looks like there was a problem with my IDE regarding testing, so I didn’t catch the errors. I apologize for the oversight. I’m currently analyzing what happened.

@sergiojrdotnet sergiojrdotnet changed the title Add support to custom event writer Add support for custom event writer May 28, 2024
@sergiojrdotnet sergiojrdotnet marked this pull request as draft May 28, 2024 16:20
@sergiojrdotnet sergiojrdotnet marked this pull request as ready for review May 29, 2024 05:58
@Mpdreamz
Copy link
Member

run docs-build

@Mpdreamz Mpdreamz merged commit 6ce0252 into elastic:main May 29, 2024
5 checks passed
@Mpdreamz
Copy link
Member

Again fantastic work @sergiojrdotnet thank you so much for this contribution!

@sergiojrdotnet
Copy link
Contributor Author

Thanks @Mpdreamz for the speedy review. Next time I’m in Amsterdam, the coffee’s on me.
Happy to contribute. 🚀

@sergiojrdotnet sergiojrdotnet deleted the feature/custom-event-writer branch May 29, 2024 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants