-
Notifications
You must be signed in to change notification settings - Fork 422
support networkobserver e2e #2200
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
base: main
Are you sure you want to change the base?
Conversation
2. add some steps in e2e engine
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.
Pull Request Overview
This PR introduces end-to-end support for network observer by enhancing metric checks and extending configuration capabilities for various test scenarios. Key changes include:
- Updating the MetricCheck function to accept a new boolean parameter (ge) for flexible metric comparison and improving error messages.
- Adding new test step definitions for removing local configurations.
- Extending SLSSubscriber and NetworkObserverManager to support additional APM configuration and app info synchronization.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
test/engine/verify/count.go | Modified MetricCheck to accept a new parameter and updated error messages for metric count comparisons. |
test/engine/steps.go | Added new steps for removing local and HTTP configurations, as well as metric count checks for "less than" expectation. |
test/engine/setup/subscriber/sls.go | Extended configuration for APM gateway support in SLS flusher config and added new fields. |
test/engine/control/config.go | Added functions to remove local configuration via different environments. |
core/ebpf/plugin/network_observer/NetworkObserverManager.{h,cpp} | Introduced new API methods for initializing app tag events and updating app info with proper locking. |
core/ebpf/plugin/network_observer/Connection.cpp | Updated connection to attach L7 metadata using enum name. |
core/ebpf/include/export.h | Removed host-related fields from export options. |
core/ebpf/Config.cpp | Added optional parameters for AppId and AppName into network observer configuration. |
groups, err = subscriber.TestSubscriber.GetData(control.GetQuery(ctx), startTime) | ||
|
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.
The call to GetData using 'startTime' is immediately overwritten by a subsequent call with 'lastScrapeTime'. Consider removing the redundant call or consolidating the logic to avoid unintended data loss.
groups, err = subscriber.TestSubscriber.GetData(control.GetQuery(ctx), startTime) |
Copilot uses AI. Check for mistakes.
} | ||
} else { | ||
if count >= expect { | ||
return fmt.Errorf("metric count greate equal than expect, expect %d, got %d, from %d", expect, count, startTime) |
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.
There is a spelling error in the error message ('greate' should be 'greater').
return fmt.Errorf("metric count greate equal than expect, expect %d, got %d, from %d", expect, count, startTime) | |
return fmt.Errorf("metric count greater equal than expect, expect %d, got %d, from %d", expect, count, startTime) |
Copilot uses AI. Check for mistakes.
@@ -115,7 +116,7 @@ func LogCountLess(ctx context.Context, expect int) (context.Context, error) { | |||
return ctx, nil | |||
} | |||
|
|||
func MetricCheck(ctx context.Context, expect int, duration int64, checker func([]*protocol.LogGroup) error) (context.Context, error) { | |||
func MetricCheck(ctx context.Context, expect int, duration int64, ge bool, checker func([]*protocol.LogGroup) error) (context.Context, error) { |
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.
这个方法设计感觉不怎么合理啊。不应该是op可以取5种比较操作符么?
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.
还有一种不用改动框架代码的的方法,是写SQL,可以参考这种写法
When query through {* | with a as (select count(1) as cnt from e2e) select * from a where cnt < 30000}
Then there is {1} logs
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.
可以的,换成sql的这种的好了
No description provided.