-
Notifications
You must be signed in to change notification settings - Fork 1.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
fix: use common timeout middleware #6866
Conversation
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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.
👍 Looks good to me! Reviewed everything up to 562a2be in 37 seconds
More details
- Looked at
142
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. pkg/query-service/constants/constants.go:257
- Draft comment:
Consider using amap[string]bool
forTimeoutExcludedRoutes
for consistency with other boolean maps in the codebase. - Reason this comment was not posted:
Confidence changes required:50%
The PR replaces the old timeout middleware with a new one from a common package. The old middleware functions are removed, and the new middleware is applied to both public and private servers. The change is consistent across the files, and the new middleware is correctly imported and used. The PR description aligns with the changes made.
2. pkg/query-service/constants/constants.go:258
- Draft comment:
Avoid using inline styles in React components. Use external stylesheets, CSS classes, or styled components instead. This comment applies to other similar instances in the code as well. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_KxbYuRZkk6m9NvNy
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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.
👍 Looks good to me! Incremental review on 22f823e in 47 seconds
More details
- Looked at
460
lines of code in12
files - Skipped
0
files when reviewing. - Skipped posting
6
drafted comments based on config settings.
1. pkg/apiserver/apiserver.go:11
- Draft comment:
Consider returning a slice instead of a map forGetTimeoutExcludedRoutes
as it represents a list of routes, and a slice would be more appropriate for this use case. - Reason this comment was not posted:
Confidence changes required:50%
The PR introduces a new interfaceAPIServer
with methods to get context timeout configurations. However, theGetTimeoutExcludedRoutes
method returns a map, which is not ideal for a list of routes. A slice would be more appropriate.
2. pkg/apiserver/config.go:38
- Draft comment:
TheValidate
method currently does nothing. Consider implementing validation logic for the configuration values to ensure they are within expected ranges or formats. - Reason this comment was not posted:
Confidence changes required:50%
TheNewConfigFactory
function inpkg/apiserver/config.go
correctly initializes a new config factory. However, theValidate
method currently does nothing. It might be beneficial to implement validation logic for the configuration values.
3. pkg/apiserver/provider.go:18
- Draft comment:
Consider adding validation for theconfig
parameter in theNew
function to ensure it contains valid values before using it to initialize the provider. - Reason this comment was not posted:
Confidence changes required:50%
TheNew
function inpkg/apiserver/provider.go
initializes a provider with the given config. However, it does not perform any validation on the config. It might be beneficial to validate the config before using it.
4. pkg/query-service/app/server.go:267
- Draft comment:
The use ofmiddleware.NewTimeout
with parameters froms.serverOptions.SigNoz.APIServer
is consistent with the PR's intent to use common timeout middleware. Ensure that theAPIServer
interface and its implementations provide the correct values. - Reason this comment was not posted:
Confidence changes required:30%
ThecreatePrivateServer
andcreatePublicServer
methods inpkg/query-service/app/server.go
use themiddleware.NewTimeout
function with parameters froms.serverOptions.SigNoz.APIServer
. This is consistent with the PR's intent to use common timeout middleware.
5. pkg/query-service/constants/constants.go:155
- Draft comment:
TheGetEvalDelay
function correctly usesGetOrDefaultEnv
to fetch environment variables, which is a good practice for configuration management. - Reason this comment was not posted:
Confidence changes required:10%
TheGetEvalDelay
function inpkg/query-service/constants/constants.go
usesGetOrDefaultEnv
to fetch environment variables. This is a good practice for configuration management.
6. pkg/query-service/app/server.go:265
- Draft comment:
Avoid using thecomponent/index.tsx
file structure approach, as it makes it difficult to debug and find components using global search tools like VS Code. This is applicable in other files as well. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_aEx3xjU2X7azdOVS
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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.
👍 Looks good to me! Incremental review on 47a517c in 32 seconds
More details
- Looked at
36
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. pkg/signoz/config.go:73
- Draft comment:
Ensure the environment variable value forCONTEXT_TIMEOUT
is a valid duration string before appending 's'. Appending 's' assumes the value is in seconds, which may not be the case if the value already includes a time unit. - Reason this comment was not posted:
Comment did not seem useful.
2. pkg/signoz/config.go:83
- Draft comment:
Ensure the environment variable value forCONTEXT_TIMEOUT_MAX_ALLOWED
is a valid duration string before appending 's'. Appending 's' assumes the value is in seconds, which may not be the case if the value already includes a time unit. - Reason this comment was not posted:
Comment did not seem useful.
Workflow ID: wflow_odYvTkNFEDByDM66
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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.
❌ Changes requested. Incremental review on 6367d42 in 52 seconds
More details
- Looked at
285
lines of code in12
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. pkg/signoz/signoz.go:70
- Draft comment:
TheAPIServer
field in theSigNoz
struct is no longer used and should be removed to avoid confusion and potential errors. - Reason this comment was not posted:
Comment was not on a valid diff hunk.
2. pkg/signoz/signoz.go:73
- Draft comment:
TheAPIServer
field in theSigNoz
struct is no longer used and should be removed to avoid confusion and potential errors. - Reason this comment was not posted:
Marked as duplicate.
3. pkg/apiserver/config.go:37
- Draft comment:
TheEnabled
field in theConfig
struct is not used and should be removed. - Reason this comment was not posted:
Comment was not on a valid diff hunk.
Workflow ID: wflow_T0kuF5TMV8YojOnp
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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.
👍 Looks good to me! Incremental review on 17b00f7 in 31 seconds
More details
- Looked at
151
lines of code in4
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. deploy/docker-swarm/clickhouse-setup/docker-compose.yaml:130
- Draft comment:
The PR description mentions using a common timeout middleware, but the changes here are primarily version updates. Ensure the description accurately reflects the changes made. - Reason this comment was not posted:
Confidence changes required:50%
The PR updates the image versions for several services in the docker-compose files. This is a straightforward change, but it's important to ensure that the new versions are compatible and do not introduce any breaking changes. The PR description mentions using a common timeout middleware, but the changes here are primarily version updates. The description might be misleading or incomplete. However, the version updates themselves seem consistent across the files.
2. deploy/docker-swarm/clickhouse-setup/docker-compose.yaml:133
- Draft comment:
Avoid using thecomponent/index.tsx
file structure approach, as it makes it difficult to debug and find components using global search tools like VS Code. - Reason this comment was not posted:
Confidence changes required:0%
The PR does not introduce any new inline styles or hardcoded color values, nor does it modify the ClickHouseReader interface. The file structure is not using thecomponent/index.tsx
approach. The changes are primarily version updates in Docker Compose files.
Workflow ID: wflow_1GmgSbIDvpEzOnWT
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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.
👍 Looks good to me! Incremental review on 0c0050e in 57 seconds
More details
- Looked at
189
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. pkg/signoz/config.go:72
- Draft comment:
The environment variableCONTEXT_TIMEOUT
is deprecated. Consider usingSIGNOZ_APISERVER_TIMEOUT_DEFAULT
instead, as per the updated configuration structure. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
While the comment correctly identifies that CONTEXT_TIMEOUT is deprecated, it suggests the wrong replacement variable name. The code clearly shows in the error message that SIGNOZ_APISERVER_CONTEXT_TIMEOUT is the new variable, not SIGNOZ_APISERVER_TIMEOUT_DEFAULT. Providing incorrect information is worse than no information at all.
The comment is about a real change in the code, and deprecation notices can be helpful. Maybe we should keep it but fix the variable name?
No - the code itself already prints a deprecation notice with the correct new variable name. The comment would be redundant even if it were correct.
Delete the comment because it provides incorrect information and is redundant with the built-in deprecation notice in the code.
2. pkg/signoz/config.go:82
- Draft comment:
The environment variableCONTEXT_TIMEOUT_MAX_ALLOWED
is deprecated. Consider usingSIGNOZ_APISERVER_TIMEOUT_MAX
instead, as per the updated configuration structure. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The code shows that CONTEXT_TIMEOUT_MAX_ALLOWED is indeed deprecated, but the comment suggests the wrong replacement variable name. The actual replacement shown in the code's print statement is SIGNOZ_APISERVER_CONTEXT_TIMEOUT_MAX_ALLOWED, not SIGNOZ_APISERVER_TIMEOUT_MAX. This makes the comment misleading and potentially harmful.
The comment is about a real deprecation, which suggests it might be valuable information. The code does show a deprecation notice being printed.
However, the deprecation notice is already printed in the code itself at line 81, making this comment redundant. More importantly, the comment provides incorrect information about the new variable name.
Delete the comment because it provides incorrect information about the replacement variable name, and the deprecation notice is already handled by the code's built-in print statement.
3. pkg/query-service/app/server.go:264
- Draft comment:
Avoid using thecomponent/index.tsx
file structure approach, as it makes it difficult to debug and find components using global search tools like VS Code. - Reason this comment was not posted:
Comment was not on a valid diff hunk.
4. ee/query-service/app/server.go:318
- Draft comment:
Avoid using thecomponent/index.tsx
file structure approach, as it makes it difficult to debug and find components using global search tools like VS Code. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_EGgxdRhO65t04MJN
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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.
❌ Changes requested. Incremental review on 56a566c in 38 seconds
More details
- Looked at
61
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. pkg/apiserver/config.go:9
- Draft comment:
Avoid using thecomponent/index.tsx
file structure approach, as it makes it difficult to debug and find components using global search tools like VS Code. - Reason this comment was not posted:
Confidence changes required:0%
The changes in the PR do not violate any of the specified rules. The changes are related to configuration and do not involve any hardcoded colors, inline styles, or inappropriate file structures.
Workflow ID: wflow_eIRW7jLlpW7gHemS
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
👍 Looks good to me! Incremental review on 6f2450a in 15 seconds
More details
- Looked at
13
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. pkg/signoz/config.go:87
- Draft comment:
The error message was updated to correctly referenceCONTEXT_TIMEOUT_MAX_ALLOWED
, which matches the environment variable being checked. This change is correct and improves clarity. - Reason this comment was not posted:
Confidence changes required:0%
The change in the error message is consistent with the environment variable being checked. The previous message was incorrect.
2. pkg/signoz/config.go:87
- Draft comment:
No issues found related to the specified rules. - Reason this comment was not posted:
Confidence changes required:0%
The code does not violate any of the specified rules. The change is a simple string update in a log message, which is not related to any of the rules about design tokens, inline styles, ClickHouseReader interface, or file structure.
Workflow ID: wflow_qrR0mPcE8ZSvq6Ni
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
Part of https://github.com/SigNoz/platform-pod/issues/406
Important
Replaces custom timeout middleware with a common one, updates configurations, and adjusts tests accordingly.
setTimeoutMiddleware
withmiddleware.NewTimeout
inserver.go
inee/query-service/app
andpkg/query-service/app
.setTimeoutMiddleware
and related functions fromserver.go
inee/query-service/app
andpkg/query-service/app
.Config
struct inpkg/apiserver/config.go
for timeout settings.example.yaml
withapiserver.timeout
settings.CONTEXT_TIMEOUT
andCONTEXT_TIMEOUT_MAX_ALLOWED
inpkg/signoz/config.go
.config_test.go
inpkg/apiserver
to test environment variable configuration.timeout_test.go
inpkg/http/middleware
to test new timeout middleware behavior.This description was created by for 6f2450a. It will automatically update as commits are pushed.