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

feat(config): update vector config #6365

Merged
merged 3 commits into from
Nov 5, 2024
Merged

Conversation

maverox
Copy link
Contributor

@maverox maverox commented Oct 18, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Fixes #6364

Description

  • adding a transform for sdk logs that fetches a value from an enrichment table sdk_map populated by file sdk_map.csv and updates the fields using this value.
  • adding some fields to ignore/except in opensearch logs sink
    Important Notes
    Please ensure that the sdk_map.csv file is properly formatted and accessible at the specified path. The name of the file should also match the name of the table in config i.e sdk_map.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

Prior Behaviour

  • sdk logs have a merchant_id field but it was being populated with publishable_key as value at source
    observed merchant_id: "pk_dev*****".
    expected merchant_id: "merchant_*****".
  • open search logs have certain fields like last_synced, sign_flag and clickhouse_database that needed to be ignored

Intentions

  • Ensuring correctness of logs and reduce log size by storing only relevant fields.

How did you test it?

Running it locally to check logs added in console (sdk) logs & opensearch

sdk_logs

I created a dummy_transform event that inserted a publishable_key in merchant_id field and passed it to the actual
transform function and then captured the output on a
console sink

  • test-code
Screenshot 2024-10-23 at 10 26 22 PM
  • sdk_map.csv (with dummy value 19999)
Screenshot 2024-10-23 at 10 27 26 PM
  • console output
Screenshot 2024-10-23 at 10 25 40 PM

opensearch logs

for this simply created a payment and compared the logs from kafka topics and opensearch entries

kafka ui
Screenshot 2024-10-23 at 10 44 45 PM

opensearch dashboard (no last_synced entry found)
Screenshot 2024-10-23 at 10 45 43 PM

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

- change the merchant_id value that contains publishable_key to actual
merchant_id value
- an sdk_map.csv is used to keep map of publishable_key -> merchant_id
@maverox maverox self-assigned this Oct 18, 2024
@maverox maverox requested a review from a team as a code owner October 18, 2024 10:13
Copy link

semanticdiff-com bot commented Oct 18, 2024

Review changes with  SemanticDiff

@maverox maverox added M-configuration-changes Metadata: This PR involves configuration changes C-feature Category: Feature request or enhancement labels Oct 18, 2024
@maverox maverox changed the title Feat(config): Update Vector Config feat(config): Update Vector Config Oct 18, 2024
@tsdk02 tsdk02 requested a review from lsampras October 22, 2024 08:33
@maverox maverox changed the title feat(config): Update Vector Config feat(config): update Vector Config Oct 23, 2024
@maverox maverox changed the title feat(config): update Vector Config feat(config): update ector config Oct 23, 2024
@maverox maverox changed the title feat(config): update ector config feat(config): update vector config Oct 23, 2024
Copy link
Member

@lsampras lsampras left a comment

Choose a reason for hiding this comment

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

Do we need to add a placeholder csv?

@maverox
Copy link
Contributor Author

maverox commented Oct 26, 2024

Do we need to add a placeholder csv?

Yes for the enrichment to work I think we need csv but I am not sure what you mean by placeholder?

@likhinbopanna likhinbopanna added this pull request to the merge queue Nov 4, 2024
github-merge-queue bot pushed a commit that referenced this pull request Nov 4, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 4, 2024
@likhinbopanna likhinbopanna added this pull request to the merge queue Nov 5, 2024
Merged via the queue into main with commit 2919db8 Nov 5, 2024
20 of 21 checks passed
@likhinbopanna likhinbopanna deleted the update-vector-config branch November 5, 2024 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: Feature request or enhancement M-configuration-changes Metadata: This PR involves configuration changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(config): update vector config
5 participants