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

chore: add stage to transformer request time metric #4848

Merged
merged 2 commits into from
Jul 1, 2024

Conversation

cisse21
Copy link
Member

@cisse21 cisse21 commented Jun 28, 2024

Description

  • Added stage in transformer request time metric
  • Remove unused fastHttp package

Linear Ticket

Fixes PIPE-1243

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

Copy link
Contributor

coderabbitai bot commented Jun 28, 2024

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Tip

Early access features: enabled

We are currently testing the following features in early access:

  • OpenAI gpt-4o model for code reviews and chat: OpenAI claims that this model is better at understanding and generating code than the previous models. We seek your feedback over the next few weeks before making it generally available.

Note:

  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.
  • Please join our Discord Community to provide feedback and report issues.
  • OSS projects are currently opted into early access features by default.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Jun 28, 2024

Codecov Report

Attention: Patch coverage is 81.48148% with 5 lines in your changes missing coverage. Please review.

Project coverage is 74.46%. Comparing base (7b905a5) to head (93b23fa).
Report is 1 commits behind head on master.

Files Patch % Lines
runner/runner.go 44.44% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4848      +/-   ##
==========================================
+ Coverage   74.28%   74.46%   +0.17%     
==========================================
  Files         418      418              
  Lines       49092    48998      -94     
==========================================
+ Hits        36469    36486      +17     
+ Misses      10239    10135     -104     
+ Partials     2384     2377       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cisse21 cisse21 force-pushed the chore.addStageToMetrics branch 5 times, most recently from d9fe0ca to 6736ba7 Compare June 28, 2024 06:31
@cisse21 cisse21 force-pushed the chore.addStageToMetrics branch 2 times, most recently from efdfe4a to 82f2bc5 Compare July 1, 2024 03:24
@cisse21 cisse21 marked this pull request as ready for review July 1, 2024 04:39
Copy link

@ktgowtham ktgowtham left a comment

Choose a reason for hiding this comment

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

LGTM. added a minor comment. fasthttp client didn't help and hence we're removing it?

destType := clientEvents[0].Destination.DestinationDefinition.Name
transformURL := trans.destTransformURL(destType)
return trans.transform(ctx, clientEvents, transformURL, batchSize, destTransformerStage)
return trans.transform(ctx, clientEvents, trans.destTransformURL(clientEvents[0].Destination.DestinationDefinition.Name), batchSize, destTransformerStage)

Choose a reason for hiding this comment

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

Shouldn't it be safe to check the length? even if the current caller ensures a empty slice is not sent?

Copy link
Member Author

Choose a reason for hiding this comment

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

We have a check in the caller here

We can be safe but we should be safe even in UserTransform and Validate too as they are similar. Felt removing is the best way forward

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just looking at this function: It is just doing a pass through. Couldn't we just get rid of this and rename trans.transform to trans.Transform?

Copy link
Member Author

Choose a reason for hiding this comment

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

@sivashanmukh will take it up in a new PR. Will merge this PR for now

@cisse21
Copy link
Member Author

cisse21 commented Jul 1, 2024

LGTM. added a minor comment. fasthttp client didn't help and hence we're removing it?

We had a CFD after enabling fasthttp with transformer receiving invalid json for a very small percentage of requests

}
bodyBytes, err := io.ReadAll(resp.Body)
if err != nil {
fmt.Println("Unable to read response into bytes with error : ", err.Error())
Copy link
Member

Choose a reason for hiding this comment

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

Should we use a logger here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I wanted to get rid of this function too if we were okay with it

Copy link
Collaborator

Choose a reason for hiding this comment

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

I didn't see transformer_build_version set in either of user_transformer or dest_transformer pods enviornments in multi-tenant rudder-transformer and user-transformer. Not sure if its being set from elsewhere.

Can potentially get rid of this altogether 👍

@cisse21 cisse21 merged commit 2bbd6e8 into master Jul 1, 2024
50 checks passed
@cisse21 cisse21 deleted the chore.addStageToMetrics branch July 1, 2024 11:06
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

5 participants