diff --git a/pkg/accesslog/collector/connect.go b/pkg/accesslog/collector/connect.go index 9d266e81..ecd04a39 100644 --- a/pkg/accesslog/collector/connect.go +++ b/pkg/accesslog/collector/connect.go @@ -143,6 +143,7 @@ func (c *ConnectCollector) buildSocketFromConnectEvent(event *events.SocketConne connectLogger.Debugf("found the connection from the socket, connection ID: %d, randomID: %d", event.ConID, event.RandomID) pair.Role = enums.ConnectionRole(event.Role) + c.fixSocketFamilyIfNeed(event, pair) c.tryToUpdateSocketFromConntrack(event, pair) return pair } diff --git a/pkg/tools/ip/conntrack.go b/pkg/tools/ip/conntrack.go index 40248419..0ad7095f 100644 --- a/pkg/tools/ip/conntrack.go +++ b/pkg/tools/ip/conntrack.go @@ -18,13 +18,14 @@ package ip import ( - "golang.org/x/sys/unix" "net" "syscall" "github.com/apache/skywalking-rover/pkg/logger" "github.com/florianl/go-conntrack" + + "golang.org/x/sys/unix" ) var log = logger.GetLogger("tools", "ip") diff --git a/test/e2e/base/env b/test/e2e/base/env index a4a264b7..8ee90056 100644 --- a/test/e2e/base/env +++ b/test/e2e/base/env @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -SW_CTL_COMMIT=6b2eb0011e38b630db6af7203db215806bd141ed +SW_CTL_COMMIT=ee371a210afe2dc6e65c2229b6a0519f8a4a2752 SW_OAP_COMMIT=7a8bbacd20381bc780c48abf5706fd6e529c9872 SW_KUBERNETES_COMMIT_SHA=a14f386063fffc61ed9b396e1328b76d33239aba diff --git a/test/e2e/cases/access_log/expected/dependency-services.yml b/test/e2e/cases/access_log/expected/dependency-services.yml index fb4b5554..bbe6f29a 100644 --- a/test/e2e/cases/access_log/expected/dependency-services.yml +++ b/test/e2e/cases/access_log/expected/dependency-services.yml @@ -19,18 +19,22 @@ nodes: name: productpage.default type: null isreal: true + layers: [] - id: {{ b64enc "details.default"}}.1 name: details.default type: http isreal: true + layers: [] - id: {{ b64enc "ratings.default" }}.1 name: ratings.default type: http isreal: true + layers: [] - id: {{ b64enc "reviews.default" }}.1 name: reviews.default type: http isreal: true + layers: [] {{- end }} calls: {{- contains .calls }} diff --git a/test/e2e/cases/profiling/continuous/http_avg_response_time/e2e.yaml b/test/e2e/cases/profiling/continuous/http_avg_response_time/e2e.yaml index fd1e103e..5cfea254 100644 --- a/test/e2e/cases/profiling/continuous/http_avg_response_time/e2e.yaml +++ b/test/e2e/cases/profiling/continuous/http_avg_response_time/e2e.yaml @@ -98,8 +98,8 @@ verify: # check profiling metrics - query: | - swctl --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql --display yaml metrics multiple-linear \ - --service-name test-continuous --instance-name test-instance --process-name response_timeout --name continuous_profiling_http_avg_response_time |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' - + swctl --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql --display yaml metrics exec --expression=continuous_profiling_http_avg_response_time \ + --service-name test-continuous --instance-name test-instance --process-name response_timeout expected: expected/metrics-has-value-labeld.yml # check triggered profiling task diff --git a/test/e2e/cases/profiling/continuous/http_avg_response_time/expected/metrics-has-value-labeld.yml b/test/e2e/cases/profiling/continuous/http_avg_response_time/expected/metrics-has-value-labeld.yml index c57e8dda..fb41e2cd 100644 --- a/test/e2e/cases/profiling/continuous/http_avg_response_time/expected/metrics-has-value-labeld.yml +++ b/test/e2e/cases/profiling/continuous/http_avg_response_time/expected/metrics-has-value-labeld.yml @@ -13,13 +13,23 @@ # See the License for the specific language governing permissions and # limitations under the License. -{{- contains . }} -- key: {{ notEmpty .key }} - value: - {{- contains .value }} - - key: {{ notEmpty .key }} - value: - value: {{ ge .value.value 1 }} - isemptyvalue: false - {{- end }} -{{- end }} \ No newline at end of file +type: TIME_SERIES_VALUES +results: + {{- contains .results }} + - metric: + labels: + {{- contains .metric.labels }} + - key: {{ .key }} + value: {{ .value }} + {{- end}} + values: + {{- contains .values }} + - id: {{ notEmpty .id }} + value: {{ .value }} + traceid: null + - id: {{ notEmpty .id }} + value: null + traceid: null + {{- end}} + {{- end}} +error: null diff --git a/test/e2e/cases/profiling/continuous/http_error_rate/e2e.yaml b/test/e2e/cases/profiling/continuous/http_error_rate/e2e.yaml index 02941684..406da6ab 100644 --- a/test/e2e/cases/profiling/continuous/http_error_rate/e2e.yaml +++ b/test/e2e/cases/profiling/continuous/http_error_rate/e2e.yaml @@ -98,8 +98,8 @@ verify: # check profiling metrics - query: | - swctl --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql --display yaml metrics multiple-linear \ - --service-name test-continuous --instance-name test-instance --process-name response_error --name continuous_profiling_http_error_rate |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' - + swctl --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql --display yaml metrics exec --expression=continuous_profiling_http_error_rate \ + --service-name test-continuous --instance-name test-instance --process-name response_error expected: expected/metrics-has-value-labeld.yml # check triggered profiling task diff --git a/test/e2e/cases/profiling/continuous/http_error_rate/expected/metrics-has-value-labeld.yml b/test/e2e/cases/profiling/continuous/http_error_rate/expected/metrics-has-value-labeld.yml index c57e8dda..fb41e2cd 100644 --- a/test/e2e/cases/profiling/continuous/http_error_rate/expected/metrics-has-value-labeld.yml +++ b/test/e2e/cases/profiling/continuous/http_error_rate/expected/metrics-has-value-labeld.yml @@ -13,13 +13,23 @@ # See the License for the specific language governing permissions and # limitations under the License. -{{- contains . }} -- key: {{ notEmpty .key }} - value: - {{- contains .value }} - - key: {{ notEmpty .key }} - value: - value: {{ ge .value.value 1 }} - isemptyvalue: false - {{- end }} -{{- end }} \ No newline at end of file +type: TIME_SERIES_VALUES +results: + {{- contains .results }} + - metric: + labels: + {{- contains .metric.labels }} + - key: {{ .key }} + value: {{ .value }} + {{- end}} + values: + {{- contains .values }} + - id: {{ notEmpty .id }} + value: {{ .value }} + traceid: null + - id: {{ notEmpty .id }} + value: null + traceid: null + {{- end}} + {{- end}} +error: null diff --git a/test/e2e/cases/profiling/task/network/base-cases.yaml b/test/e2e/cases/profiling/task/network/base-cases.yaml index 2a068ea0..7fe4adcb 100644 --- a/test/e2e/cases/profiling/task/network/base-cases.yaml +++ b/test/e2e/cases/profiling/task/network/base-cases.yaml @@ -63,32 +63,27 @@ cases: # histogram value of process relation, client side write_rtt/write_exe/read time - query: | - swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics multiple-linear \ + swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics exec --expression=process_relation_client_write_rtt_time_percentile \ --service-name service --instance-name test --process-name service \ - --dest-service-name service --dest-instance-name test --dest-process-name UNKNOWN_REMOTE \ - --name=process_relation_client_write_rtt_time_percentile|yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' - + --dest-service-name service --dest-instance-name test --dest-process-name UNKNOWN_REMOTE expected: expected/metrics-has-value-label.yml - query: | - swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics multiple-linear \ + swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics exec --expression=process_relation_client_write_exe_time_percentile \ --service-name service --instance-name test --process-name service \ - --dest-service-name service --dest-instance-name test --dest-process-name UNKNOWN_REMOTE \ - --name=process_relation_client_write_exe_time_percentile|yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' - + --dest-service-name service --dest-instance-name test --dest-process-name UNKNOWN_REMOTE expected: expected/metrics-has-value-label.yml - query: | - swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics multiple-linear \ + swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics exec --expression=process_relation_server_write_rtt_time_percentile \ --service-name service --instance-name test --process-name UNKNOWN_REMOTE \ - --dest-service-name service --dest-instance-name test --dest-process-name service \ - --name=process_relation_server_write_rtt_time_percentile|yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' - + --dest-service-name service --dest-instance-name test --dest-process-name service expected: expected/metrics-has-value-label.yml - query: | - swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics multiple-linear \ + swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics exec --expression=process_relation_server_write_exe_time_percentile \ --service-name service --instance-name test --process-name UNKNOWN_REMOTE \ - --dest-service-name service --dest-instance-name test --dest-process-name service \ - --name=process_relation_server_write_exe_time_percentile|yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' - + --dest-service-name service --dest-instance-name test --dest-process-name service expected: expected/metrics-has-value-label.yml - query: | - swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics multiple-linear \ + swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics exec --expression=process_relation_server_write_exe_time_percentile \ --service-name service --instance-name test --process-name UNKNOWN_REMOTE \ - --dest-service-name service --dest-instance-name test --dest-process-name service \ - --name=process_relation_server_write_exe_time_percentile|yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' - + --dest-service-name service --dest-instance-name test --dest-process-name service expected: expected/metrics-has-value-label.yml \ No newline at end of file diff --git a/test/e2e/cases/profiling/task/network/envoy/e2e.yaml b/test/e2e/cases/profiling/task/network/envoy/e2e.yaml index e3114db0..bfae32a8 100644 --- a/test/e2e/cases/profiling/task/network/envoy/e2e.yaml +++ b/test/e2e/cases/profiling/task/network/envoy/e2e.yaml @@ -144,40 +144,34 @@ verify: # histogram value of process relation, client side write_rtt/write_exe/read time - query: | - swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics multiple-linear \ + swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics exec --expression=process_relation_client_write_rtt_time_percentile \ --service-name productpage.default --instance-name productpage --process-name envoy \ --dest-service-name productpage.default --dest-instance-name productpage --dest-process-name /usr/local/bin/python \ - --name=process_relation_client_write_rtt_time_percentile|yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' - expected: expected/metrics-has-value-label.yml - query: | - swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics multiple-linear \ + swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics exec --expression=process_relation_client_write_exe_time_percentile \ --service-name productpage.default --instance-name productpage --process-name envoy \ - --dest-service-name productpage.default --dest-instance-name productpage --dest-process-name /usr/local/bin/python \ - --name=process_relation_client_write_exe_time_percentile|yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' - + --dest-service-name productpage.default --dest-instance-name productpage --dest-process-name /usr/local/bin/python expected: expected/metrics-has-value-label.yml - query: | - swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics multiple-linear \ + swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics exec --expression=process_relation_client_read_exe_time_percentile \ --service-name productpage.default --instance-name productpage --process-name envoy \ - --dest-service-name productpage.default --dest-instance-name productpage --dest-process-name /usr/local/bin/python \ - --name=process_relation_client_read_exe_time_percentile|yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' - + --dest-service-name productpage.default --dest-instance-name productpage --dest-process-name /usr/local/bin/python expected: expected/metrics-has-value-label.yml - query: | - swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics multiple-linear \ + swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics exec --expression=process_relation_server_write_rtt_time_percentile \ --service-name productpage.default --instance-name productpage --process-name envoy \ - --dest-service-name productpage.default --dest-instance-name productpage --dest-process-name /usr/local/bin/python \ - --name=process_relation_server_write_rtt_time_percentile|yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' - + --dest-service-name productpage.default --dest-instance-name productpage --dest-process-name /usr/local/bin/python expected: expected/metrics-has-value-label.yml - query: | - swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics multiple-linear \ + swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics exec --expression=process_relation_server_write_exe_time_percentile \ --service-name productpage.default --instance-name productpage --process-name envoy \ - --dest-service-name productpage.default --dest-instance-name productpage --dest-process-name /usr/local/bin/python \ - --name=process_relation_server_write_exe_time_percentile|yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' - + --dest-service-name productpage.default --dest-instance-name productpage --dest-process-name /usr/local/bin/python expected: expected/metrics-has-value-label.yml - query: | - swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics multiple-linear \ + swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics exec --expression=process_relation_server_write_exe_time_percentile \ --service-name productpage.default --instance-name productpage --process-name envoy \ - --dest-service-name productpage.default --dest-instance-name productpage --dest-process-name /usr/local/bin/python \ - --name=process_relation_server_write_exe_time_percentile|yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' - + --dest-service-name productpage.default --dest-instance-name productpage --dest-process-name /usr/local/bin/python expected: expected/metrics-has-value-label.yml # HTTP1 analyzer @@ -200,10 +194,9 @@ verify: --name process_relation_http1_response_package_size|yq e 'to_entries' - expected: expected/metrics-has-value.yml - query: | - swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics multiple-linear \ + swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics exec --expression=process_relation_http1_request_package_size_percentile \ --service-name productpage.default --instance-name productpage --process-name envoy \ - --dest-service-name productpage.default --dest-instance-name productpage --dest-process-name /usr/local/bin/python \ - --name process_relation_http1_request_package_size_percentile|yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' - + --dest-service-name productpage.default --dest-instance-name productpage --dest-process-name /usr/local/bin/python expected: expected/metrics-has-value-label.yml - query: | swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics linear \ diff --git a/test/e2e/cases/profiling/task/network/envoy/expected/metrics-has-value-label.yml b/test/e2e/cases/profiling/task/network/envoy/expected/metrics-has-value-label.yml index 8093415b..fb41e2cd 100644 --- a/test/e2e/cases/profiling/task/network/envoy/expected/metrics-has-value-label.yml +++ b/test/e2e/cases/profiling/task/network/envoy/expected/metrics-has-value-label.yml @@ -13,13 +13,23 @@ # See the License for the specific language governing permissions and # limitations under the License. -{{- contains . }} -- key: {{ notEmpty .key }} - value: - {{- contains .value }} - - key: {{ notEmpty .key }} - value: - value: {{ ge .value.value 1 }} - isemptyvalue: false - {{- end }} -{{- end }} +type: TIME_SERIES_VALUES +results: + {{- contains .results }} + - metric: + labels: + {{- contains .metric.labels }} + - key: {{ .key }} + value: {{ .value }} + {{- end}} + values: + {{- contains .values }} + - id: {{ notEmpty .id }} + value: {{ .value }} + traceid: null + - id: {{ notEmpty .id }} + value: null + traceid: null + {{- end}} + {{- end}} +error: null diff --git a/test/e2e/cases/profiling/task/network/expected/metrics-has-value-label.yml b/test/e2e/cases/profiling/task/network/expected/metrics-has-value-label.yml index c57e8dda..fb41e2cd 100644 --- a/test/e2e/cases/profiling/task/network/expected/metrics-has-value-label.yml +++ b/test/e2e/cases/profiling/task/network/expected/metrics-has-value-label.yml @@ -13,13 +13,23 @@ # See the License for the specific language governing permissions and # limitations under the License. -{{- contains . }} -- key: {{ notEmpty .key }} - value: - {{- contains .value }} - - key: {{ notEmpty .key }} - value: - value: {{ ge .value.value 1 }} - isemptyvalue: false - {{- end }} -{{- end }} \ No newline at end of file +type: TIME_SERIES_VALUES +results: + {{- contains .results }} + - metric: + labels: + {{- contains .metric.labels }} + - key: {{ .key }} + value: {{ .value }} + {{- end}} + values: + {{- contains .values }} + - id: {{ notEmpty .id }} + value: {{ .value }} + traceid: null + - id: {{ notEmpty .id }} + value: null + traceid: null + {{- end}} + {{- end}} +error: null diff --git a/test/e2e/cases/profiling/task/network/http1-metrics-cases.yaml b/test/e2e/cases/profiling/task/network/http1-metrics-cases.yaml index 511d0b19..25733ddd 100644 --- a/test/e2e/cases/profiling/task/network/http1-metrics-cases.yaml +++ b/test/e2e/cases/profiling/task/network/http1-metrics-cases.yaml @@ -34,16 +34,14 @@ cases: --name process_relation_http1_response_package_size|yq e 'to_entries' - expected: expected/metrics-has-value.yml - query: | - swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics multiple-linear \ + swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics exec --expression=process_relation_http1_request_package_size_percentile \ --service-name service --instance-name test --process-name service \ - --dest-service-name service --dest-instance-name test --dest-process-name UNKNOWN_REMOTE \ - --name process_relation_http1_request_package_size_percentile|yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' - + --dest-service-name service --dest-instance-name test --dest-process-name UNKNOWN_REMOTE expected: expected/metrics-has-value-label.yml - query: | - swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics multiple-linear \ + swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics exec --expression=process_relation_http1_response_package_size_percentile \ --service-name service --instance-name test --process-name service \ - --dest-service-name service --dest-instance-name test --dest-process-name UNKNOWN_REMOTE \ - --name process_relation_http1_response_package_size_percentile|yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' - + --dest-service-name service --dest-instance-name test --dest-process-name UNKNOWN_REMOTE expected: expected/metrics-has-value-label.yml - query: | swctl --display yaml --base-url=http://${service_skywalking_ui_host}:${service_skywalking_ui_80}/graphql metrics linear \