Skip to content

Collect label and metadata from header #79

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

Merged
merged 5 commits into from
Aug 30, 2022
Merged

Conversation

trueleo
Copy link
Contributor

@trueleo trueleo commented Aug 29, 2022

Fixes #75 .

Description

This PR allows for metadata and tags to be fetched from headers instead of body of the event. This gives some flexibility in schema and multiple sources with different schema for available metadata can send logs to the same stream.

Client needs to use prefix x-p-meta- and x-p-tags- in headers to send key value pairs in a server post event. These headers are parsed and validated before being merged into body with p_metadata and p_tags field respectively

Changes

  • introduced header_parsing::collect_labelled which parses headers key value pairs and gives a string formatted as "k1=v1,k2=v2"
  • New Error type ParseHeaderError which implements ResponseError.
  • Use above types in post event handler

This PR has:

  • been tested to ensure log ingestion and log query works.
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added documentation for new or modified features or behaviors.

@trueleo trueleo marked this pull request as ready for review August 30, 2022 13:33
Copy link
Member

@nitisht nitisht left a comment

Choose a reason for hiding this comment

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

Looking great, some comments for readability

@trueleo trueleo requested a review from nitisht August 30, 2022 15:51
Copy link
Member

@nitisht nitisht left a comment

Choose a reason for hiding this comment

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

👍🏽

@nitisht nitisht merged commit c48c163 into parseablehq:main Aug 30, 2022
@trueleo trueleo deleted the metadata branch August 30, 2022 16:18
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.

Console needs to decouple from a specific schema
2 participants