You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2022/03/30 04:11:51 UTC
[skywalking] branch master updated: Support eBPF Profiling E2E (#8761)
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git
The following commit(s) were added to refs/heads/master by this push:
new 2a8bf4d Support eBPF Profiling E2E (#8761)
2a8bf4d is described below
commit 2a8bf4deff2dd44f5d9092d40a818f04be0c4f18
Author: mrproliu <74...@qq.com>
AuthorDate: Wed Mar 30 04:11:30 2022 +0000
Support eBPF Profiling E2E (#8761)
---
.github/workflows/skywalking.yaml | 31 +++++++----
CHANGES.md | 2 +
.../query/EBPFProfilingScheduleEsDAO.java | 3 +-
.../query/EBPFProfilingTaskEsDAO.java | 7 +--
.../storage/plugin/influxdb/base/MetricsDAO.java | 29 +++++++----
.../influxdb/query/EBPFProfilingDataQuery.java | 4 +-
.../influxdb/query/EBPFProfilingScheduleQuery.java | 4 +-
.../influxdb/query/EBPFProfilingTaskQuery.java | 16 +++---
.../plugin/influxdb/query/MetadataQuery.java | 6 +--
.../iotdb/query/IoTDBEBPFProfilingDataDAO.java | 9 ++--
.../iotdb/query/IoTDBEBPFProfilingScheduleDAO.java | 5 +-
.../iotdb/query/IoTDBEBPFProfilingTaskDAO.java | 21 ++++----
test/e2e-v2/cases/kafka/profile/e2e.yaml | 2 +-
.../cases/profile/expected/profile-cases.yaml | 59 ---------------------
test/e2e-v2/cases/profile/mysql/e2e.yaml | 37 -------------
test/e2e-v2/cases/profiling/ebpf/Dockerfile.sqrt | 23 +++++++++
.../h2 => profiling/ebpf}/docker-compose.yml | 60 +++++++++++-----------
.../ebpf}/es/docker-compose.yml | 39 ++++++++------
.../{profile/iotdb => profiling/ebpf/es}/e2e.yaml | 6 +--
.../ebpf/expected/instance.yml} | 10 ++--
.../ebpf/expected/process.yml} | 41 +++++++--------
.../ebpf/expected/profiling-analysis.yml} | 19 ++++---
.../ebpf/expected/profiling-create.yml} | 3 +-
.../ebpf/expected/profiling-schedule-list.yml} | 46 ++++++++---------
.../ebpf/expected/profiling-task-list.yml} | 17 ++++--
.../ebpf/expected/service.yml} | 11 ++--
.../ebpf}/h2/docker-compose.yml | 37 ++++++++-----
.../{profile/iotdb => profiling/ebpf/h2}/e2e.yaml | 6 +--
.../ebpf}/influxdb/docker-compose.yml | 39 ++++++++------
.../iotdb => profiling/ebpf/influxdb}/e2e.yaml | 6 +--
.../ebpf}/iotdb/docker-compose.yml | 41 +++++++++------
.../{profile => profiling/ebpf}/iotdb/e2e.yaml | 6 +--
.../ebpf}/mysql/docker-compose.yml | 39 ++++++++------
.../iotdb => profiling/ebpf/mysql}/e2e.yaml | 6 +--
.../cases/profiling/ebpf/profiling-cases.yaml | 49 ++++++++++++++++++
test/e2e-v2/cases/profiling/ebpf/sqrt.go | 32 ++++++++++++
.../trace}/es/docker-compose.yml | 4 +-
.../{profile/iotdb => profiling/trace/es}/e2e.yaml | 4 +-
.../trace}/expected/profile-create.yml | 0
.../trace}/expected/profile-list-finished.yml | 0
.../trace}/expected/profile-list-notified.yml | 0
.../trace}/expected/profile-segment-analyze.yml | 0
.../trace}/expected/profile-segment-detail.yml | 0
.../trace}/expected/profile-segment-list.yml | 0
.../trace}/expected/service-endpoint.yml | 0
.../trace}/expected/service-instance.yml | 0
.../trace}/expected/service.yml | 0
.../trace}/expected/traces-list.yml | 0
.../trace}/h2/docker-compose.yml | 6 +--
.../cases/{profile => profiling/trace}/h2/e2e.yaml | 4 +-
.../trace}/influxdb/docker-compose.yml | 4 +-
.../es => profiling/trace/influxdb}/e2e.yaml | 4 +-
.../trace}/iotdb/docker-compose.yml | 4 +-
.../influxdb => profiling/trace/iotdb}/e2e.yaml | 4 +-
.../trace}/mysql/docker-compose.yml | 4 +-
.../iotdb => profiling/trace/mysql}/e2e.yaml | 4 +-
.../trace/profiling-cases.yaml} | 30 +++++------
.../cases/satellite/native-protocols/e2e.yaml | 24 ++++-----
test/e2e-v2/cases/storage/storage-cases.yaml | 24 ++++-----
test/e2e-v2/script/env | 3 +-
.../prepare/setup-e2e-shell/install-swctl.sh | 3 +-
61 files changed, 495 insertions(+), 402 deletions(-)
diff --git a/.github/workflows/skywalking.yaml b/.github/workflows/skywalking.yaml
index 4af8000..fccf4ee 100644
--- a/.github/workflows/skywalking.yaml
+++ b/.github/workflows/skywalking.yaml
@@ -385,16 +385,27 @@ jobs:
config: test/e2e-v2/cases/log/fluent-bit/e2e.yaml
env: ES_VERSION=7.15.0
- - name: Profiling H2
- config: test/e2e-v2/cases/profile/h2/e2e.yaml
- - name: Profiling ES
- config: test/e2e-v2/cases/profile/es/e2e.yaml
- - name: Profiling MySQL
- config: test/e2e-v2/cases/profile/mysql/e2e.yaml
- - name: Profiling InfluxDB
- config: test/e2e-v2/cases/profile/influxdb/e2e.yaml
- - name: Profiling IoTDB
- config: test/e2e-v2/cases/profile/iotdb/e2e.yaml
+ - name: Trace Profiling H2
+ config: test/e2e-v2/cases/profiling/trace/h2/e2e.yaml
+ - name: Trace Profiling ES
+ config: test/e2e-v2/cases/profiling/trace/es/e2e.yaml
+ - name: Trace Profiling MySQL
+ config: test/e2e-v2/cases/profiling/trace/mysql/e2e.yaml
+ - name: Trace Profiling InfluxDB
+ config: test/e2e-v2/cases/profiling/trace/influxdb/e2e.yaml
+ - name: Trace Profiling IoTDB
+ config: test/e2e-v2/cases/profiling/trace/iotdb/e2e.yaml
+
+ - name: eBPF Profiling H2
+ config: test/e2e-v2/cases/profiling/ebpf/h2/e2e.yaml
+ - name: eBPF Profiling ES
+ config: test/e2e-v2/cases/profiling/ebpf/es/e2e.yaml
+ - name: eBPF Profiling MySQL
+ config: test/e2e-v2/cases/profiling/ebpf/mysql/e2e.yaml
+ - name: eBPF Profiling InfluxDB
+ config: test/e2e-v2/cases/profiling/ebpf/influxdb/e2e.yaml
+ - name: eBPF Profiling IoTDB
+ config: test/e2e-v2/cases/profiling/ebpf/iotdb/e2e.yaml
- name: Kafka Basic
config: test/e2e-v2/cases/kafka/simple-so11y/e2e.yaml
diff --git a/CHANGES.md b/CHANGES.md
index d2b2849..4fb9b78 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -124,6 +124,8 @@ Release Notes.
* Add complexity limitation for GraphQL query to avoid malicious query.
* Add `Column.shardingKeyIdx` for column definition for BanyanDB.
* Fix the configuration of `Aggregation` and `GC Count` metrics for oap self observability
+* E2E: Add verify OAP eBPF Profiling.
+* Let `multiGet` could query without tag value in the `InfluxDB` storage plugin.
```
Sharding key is used to group time series data per metric of one entity in one place (same sharding and/or same
diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/EBPFProfilingScheduleEsDAO.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/EBPFProfilingScheduleEsDAO.java
index 15473e2..1c4343f 100644
--- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/EBPFProfilingScheduleEsDAO.java
+++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/EBPFProfilingScheduleEsDAO.java
@@ -27,7 +27,6 @@ import org.apache.skywalking.library.elasticsearch.response.search.SearchHit;
import org.apache.skywalking.library.elasticsearch.response.search.SearchResponse;
import org.apache.skywalking.oap.server.core.analysis.TimeBucket;
import org.apache.skywalking.oap.server.core.profiling.ebpf.storage.EBPFProfilingScheduleRecord;
-import org.apache.skywalking.oap.server.core.profiling.ebpf.storage.EBPFProfilingTaskRecord;
import org.apache.skywalking.oap.server.core.query.type.EBPFProfilingSchedule;
import org.apache.skywalking.oap.server.core.storage.profiling.ebpf.IEBPFProfilingScheduleDAO;
import org.apache.skywalking.oap.server.library.client.elasticsearch.ElasticSearchClient;
@@ -58,7 +57,7 @@ public class EBPFProfilingScheduleEsDAO extends EsDAO implements IEBPFProfilingS
.gte(TimeBucket.getTimestamp(startTimeBucket))
.lte(TimeBucket.getTimestamp(endTimeBucket)));
final SearchBuilder search = Search.builder().query(query)
- .sort(EBPFProfilingTaskRecord.CREATE_TIME, Sort.Order.DESC)
+ .sort(EBPFProfilingScheduleRecord.START_TIME, Sort.Order.DESC)
.size(scheduleTaskSize);
final SearchResponse response = getClient().search(index, search.build());
diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/EBPFProfilingTaskEsDAO.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/EBPFProfilingTaskEsDAO.java
index 2834335..0c3a1c1 100644
--- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/EBPFProfilingTaskEsDAO.java
+++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/EBPFProfilingTaskEsDAO.java
@@ -34,6 +34,7 @@ import org.apache.skywalking.oap.server.core.query.type.EBPFProfilingTask;
import org.apache.skywalking.oap.server.core.storage.profiling.ebpf.EBPFProfilingProcessFinder;
import org.apache.skywalking.oap.server.core.storage.profiling.ebpf.IEBPFProfilingTaskDAO;
import org.apache.skywalking.oap.server.library.client.elasticsearch.ElasticSearchClient;
+import org.apache.skywalking.oap.server.library.util.StringUtil;
import org.apache.skywalking.oap.server.storage.plugin.elasticsearch.StorageModuleElasticsearchConfig;
import org.apache.skywalking.oap.server.storage.plugin.elasticsearch.base.EsDAO;
import org.apache.skywalking.oap.server.storage.plugin.elasticsearch.base.IndexController;
@@ -59,10 +60,10 @@ public class EBPFProfilingTaskEsDAO extends EsDAO implements IEBPFProfilingTaskD
if (finder.getFinderType() != null) {
query.must(Query.term(EBPFProfilingTaskRecord.PROCESS_FIND_TYPE, finder.getFinderType().value()));
}
- if (finder.getServiceId() != null) {
+ if (StringUtil.isNotEmpty(finder.getServiceId())) {
query.must(Query.term(EBPFProfilingTaskRecord.SERVICE_ID, finder.getServiceId()));
}
- if (finder.getInstanceId() != null) {
+ if (StringUtil.isNotEmpty(finder.getInstanceId())) {
query.must(Query.term(EBPFProfilingTaskRecord.INSTANCE_ID, finder.getInstanceId()));
}
if (finder.getProcessIdList() != null) {
@@ -95,7 +96,7 @@ public class EBPFProfilingTaskEsDAO extends EsDAO implements IEBPFProfilingTaskD
task.setServiceName(IDManager.ServiceID.analysisId(serviceId).getName());
final String instanceId = (String) hit.getSource().get(EBPFProfilingTaskRecord.INSTANCE_ID);
task.setInstanceId(instanceId);
- task.setServiceName(IDManager.ServiceInstanceID.analysisId(instanceId).getName());
+ task.setInstanceName(IDManager.ServiceInstanceID.analysisId(instanceId).getName());
task.setProcessId((String) hit.getSource().get(EBPFProfilingTaskRecord.PROCESS_ID));
task.setProcessName((String) hit.getSource().get(EBPFProfilingTaskRecord.PROCESS_NAME));
task.setTaskStartTime(((Number) hit.getSource().get(EBPFProfilingTaskRecord.START_TIME)).longValue());
diff --git a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/base/MetricsDAO.java b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/base/MetricsDAO.java
index 078892e..b9d7a5f 100644
--- a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/base/MetricsDAO.java
+++ b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/base/MetricsDAO.java
@@ -27,8 +27,9 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
-import java.util.function.Function;
import java.util.stream.Collectors;
+
+import io.vavr.Function2;
import lombok.extern.slf4j.Slf4j;
import org.apache.skywalking.oap.server.core.analysis.TimeBucket;
import org.apache.skywalking.oap.server.core.analysis.manual.endpoint.EndpointTraffic;
@@ -44,12 +45,14 @@ import org.apache.skywalking.oap.server.core.storage.type.StorageDataComplexObje
import org.apache.skywalking.oap.server.library.client.request.InsertRequest;
import org.apache.skywalking.oap.server.library.client.request.UpdateRequest;
import org.apache.skywalking.oap.server.library.util.CollectionUtils;
+import org.apache.skywalking.oap.server.library.util.StringUtil;
import org.apache.skywalking.oap.server.storage.plugin.influxdb.InfluxClient;
import org.apache.skywalking.oap.server.storage.plugin.influxdb.InfluxConstants.TagName;
import org.apache.skywalking.oap.server.storage.plugin.influxdb.TableMetaInfo;
import org.influxdb.dto.Query;
import org.influxdb.dto.QueryResult;
-import org.influxdb.querybuilder.clauses.Clause;
+import org.influxdb.querybuilder.SelectQueryImpl;
+import org.influxdb.querybuilder.WhereQueryImpl;
import static org.apache.skywalking.oap.server.storage.plugin.influxdb.InfluxConstants.ALL_FIELDS;
import static org.apache.skywalking.oap.server.storage.plugin.influxdb.InfluxConstants.ID_COLUMN;
@@ -72,31 +75,30 @@ public class MetricsDAO implements IMetricsDAO {
final TableMetaInfo metaInfo = TableMetaInfo.get(model.getName());
final String queryStr;
if (model.getName().endsWith("_traffic")) {
- final Function<Metrics, Clause> clauseFunction;
+ final Function2<Metrics, WhereQueryImpl<SelectQueryImpl>, WhereQueryImpl<SelectQueryImpl>> clauseFunction;
switch (model.getName()) {
case EndpointTraffic.INDEX_NAME: {
- clauseFunction = m -> eq(TagName.SERVICE_ID, ((EndpointTraffic) m).getServiceId());
+ clauseFunction = (m, query) -> appendEqualsClause(query, TagName.SERVICE_ID, ((EndpointTraffic) m).getServiceId());
break;
}
case ServiceTraffic.INDEX_NAME: {
- clauseFunction = m -> eq(TagName.NAME, ((ServiceTraffic) m).getName());
+ clauseFunction = (m, query) -> appendEqualsClause(query, TagName.NAME, ((ServiceTraffic) m).getName());
break;
}
case InstanceTraffic.INDEX_NAME: {
- clauseFunction = m -> eq(TagName.SERVICE_ID, ((InstanceTraffic) m).getServiceId());
+ clauseFunction = (m, query) -> appendEqualsClause(query, TagName.SERVICE_ID, ((InstanceTraffic) m).getServiceId());
break;
}
case ProcessTraffic.INDEX_NAME: {
- clauseFunction = m -> eq(TagName.SERVICE_ID, ((ProcessTraffic) m).getServiceId());
+ clauseFunction = (m, query) -> appendEqualsClause(query, TagName.SERVICE_ID, ((ProcessTraffic) m).getServiceId());
break;
}
default:
throw new IOException("Unknown metadata type, " + model.getName());
}
- queryStr = metrics.stream().map(m -> select().raw(ALL_FIELDS)
+ queryStr = metrics.stream().map(m -> clauseFunction.apply(m, select().raw(ALL_FIELDS)
.from(client.getDatabase(), model.getName())
- .where(clauseFunction.apply(m))
- .and(eq(ID_COLUMN, m.id()))
+ .where(eq(ID_COLUMN, m.id())))
.buildQueryString()
).collect(Collectors.joining(";"));
} else {
@@ -148,6 +150,13 @@ public class MetricsDAO implements IMetricsDAO {
return newMetrics;
}
+ private WhereQueryImpl<SelectQueryImpl> appendEqualsClause(WhereQueryImpl<SelectQueryImpl> base, String key, String value) {
+ if (StringUtil.isEmpty(value)) {
+ return base;
+ }
+ return base.and(eq(key, value));
+ }
+
@Override
public InsertRequest prepareBatchInsert(Model model, Metrics metrics) {
final long timestamp = TimeBucket.getTimestamp(metrics.getTimeBucket(), model.getDownsampling());
diff --git a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/EBPFProfilingDataQuery.java b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/EBPFProfilingDataQuery.java
index ba8bc38..41eb505 100644
--- a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/EBPFProfilingDataQuery.java
+++ b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/EBPFProfilingDataQuery.java
@@ -87,8 +87,8 @@ public class EBPFProfilingDataQuery implements IEBPFProfilingDataDAO {
} else {
data.setStacksBinary(new byte[0]);
}
- data.setStackDumpCount((Long) values.get(5));
- data.setUploadTime((Long) values.get(6));
+ data.setStackDumpCount(((Number) values.get(5)).longValue());
+ data.setUploadTime(((Number) values.get(6)).longValue());
dataList.add(data);
}
diff --git a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/EBPFProfilingScheduleQuery.java b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/EBPFProfilingScheduleQuery.java
index 7bc9dce..32aa85b 100644
--- a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/EBPFProfilingScheduleQuery.java
+++ b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/EBPFProfilingScheduleQuery.java
@@ -81,8 +81,8 @@ public class EBPFProfilingScheduleQuery implements IEBPFProfilingScheduleDAO {
schedule.setScheduleId((String) values.get(1));
schedule.setTaskId((String) values.get(2));
schedule.setProcessId((String) values.get(3));
- schedule.setStartTime((long) values.get(4));
- schedule.setEndTime((long) values.get(5));
+ schedule.setStartTime(((Number) values.get(4)).longValue());
+ schedule.setEndTime(((Number) values.get(5)).longValue());
schedules.add(schedule);
}
return schedules;
diff --git a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/EBPFProfilingTaskQuery.java b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/EBPFProfilingTaskQuery.java
index 2fd2182..4b2eb84 100644
--- a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/EBPFProfilingTaskQuery.java
+++ b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/EBPFProfilingTaskQuery.java
@@ -82,7 +82,7 @@ public class EBPFProfilingTaskQuery implements IEBPFProfilingTaskDAO {
query.and(eq(EBPFProfilingTaskRecord.INSTANCE_ID, finder.getInstanceId()));
}
if (CollectionUtils.isNotEmpty(finder.getProcessIdList())) {
- query.and(regex(EBPFProfilingTaskRecord.PROCESS_ID, Joiner.on("|").join(finder.getProcessIdList())));
+ query.and(regex(EBPFProfilingTaskRecord.PROCESS_ID, "/" + Joiner.on("|").join(finder.getProcessIdList()) + "/"));
}
if (targetType != null) {
query.and(eq(EBPFProfilingTaskRecord.TARGET_TYPE, targetType.value()));
@@ -111,7 +111,7 @@ public class EBPFProfilingTaskQuery implements IEBPFProfilingTaskDAO {
for (List<Object> values : series.getValues()) {
final EBPFProfilingTask task = new EBPFProfilingTask();
task.setTaskId((String) values.get(1));
- task.setProcessFinderType(EBPFProfilingProcessFinderType.valueOf((int) values.get(2)));
+ task.setProcessFinderType(EBPFProfilingProcessFinderType.valueOf(((Number) values.get(2)).intValue()));
final String serviceId = (String) values.get(3);
task.setServiceId(serviceId);
task.setServiceName(IDManager.ServiceID.analysisId(serviceId).getName());
@@ -120,12 +120,12 @@ public class EBPFProfilingTaskQuery implements IEBPFProfilingTaskDAO {
task.setInstanceName(IDManager.ServiceInstanceID.analysisId(instanceId).getName());
task.setProcessId((String) values.get(5));
task.setProcessName((String) values.get(6));
- task.setTaskStartTime((long) values.get(7));
- task.setTriggerType(EBPFProfilingTriggerType.valueOf((int) values.get(8)));
- task.setFixedTriggerDuration((long) values.get(9));
- task.setTargetType(EBPFProfilingTargetType.valueOf((int) values.get(10)));
- task.setCreateTime((long) values.get(11));
- task.setLastUpdateTime((long) values.get(12));
+ task.setTaskStartTime(((Number) values.get(7)).longValue());
+ task.setTriggerType(EBPFProfilingTriggerType.valueOf(((Number) values.get(8)).intValue()));
+ task.setFixedTriggerDuration(((Number) values.get(9)).longValue());
+ task.setTargetType(EBPFProfilingTargetType.valueOf(((Number) values.get(10)).intValue()));
+ task.setCreateTime(((Number) values.get(11)).longValue());
+ task.setLastUpdateTime(((Number) values.get(12)).longValue());
tasks.add(task);
}
diff --git a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/MetadataQuery.java b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/MetadataQuery.java
index e5a64e3..1f2016d 100644
--- a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/MetadataQuery.java
+++ b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/MetadataQuery.java
@@ -160,7 +160,7 @@ public class MetadataQuery implements IMetadataQueryDAO {
@Override
public List<Process> listProcesses(String serviceId, String instanceId, String agentId) throws IOException {
final SelectQueryImpl query = select(
- ID_COLUMN, ProcessTraffic.NAME, ProcessTraffic.SERVICE_ID, ProcessTraffic.INSTANCE_ID,
+ ID_COLUMN, NAME, ProcessTraffic.SERVICE_ID, ProcessTraffic.INSTANCE_ID,
ProcessTraffic.LAYER, ProcessTraffic.AGENT_ID, ProcessTraffic.DETECT_TYPE, ProcessTraffic.PROPERTIES)
.from(client.getDatabase(), ProcessTraffic.INDEX_NAME);
final WhereQueryImpl<SelectQueryImpl> whereQuery = query.where();
@@ -180,10 +180,10 @@ public class MetadataQuery implements IMetadataQueryDAO {
@Override
public Process getProcess(String processId) throws IOException {
final WhereQueryImpl<SelectQueryImpl> where = select(
- ID_COLUMN, ProcessTraffic.NAME, ProcessTraffic.SERVICE_ID, ProcessTraffic.INSTANCE_ID,
+ ID_COLUMN, NAME, ProcessTraffic.SERVICE_ID, ProcessTraffic.INSTANCE_ID,
ProcessTraffic.LAYER, ProcessTraffic.AGENT_ID, ProcessTraffic.DETECT_TYPE, ProcessTraffic.PROPERTIES)
.from(client.getDatabase(), ProcessTraffic.INDEX_NAME)
- .where(eq(TagName.ID_COLUMN, processId));
+ .where(eq(ID_COLUMN, processId));
final List<Process> processes = buildProcesses(where);
return processes.size() > 0 ? processes.get(0) : null;
}
diff --git a/oap-server/server-storage-plugin/storage-iotdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/iotdb/query/IoTDBEBPFProfilingDataDAO.java b/oap-server/server-storage-plugin/storage-iotdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/iotdb/query/IoTDBEBPFProfilingDataDAO.java
index 1970e37..b8d1a12 100644
--- a/oap-server/server-storage-plugin/storage-iotdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/iotdb/query/IoTDBEBPFProfilingDataDAO.java
+++ b/oap-server/server-storage-plugin/storage-iotdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/iotdb/query/IoTDBEBPFProfilingDataDAO.java
@@ -21,7 +21,6 @@ package org.apache.skywalking.oap.server.storage.plugin.iotdb.query;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.skywalking.oap.server.core.profiling.ebpf.storage.EBPFProfilingDataRecord;
-import org.apache.skywalking.oap.server.core.profiling.ebpf.storage.EBPFProfilingScheduleRecord;
import org.apache.skywalking.oap.server.core.storage.StorageData;
import org.apache.skywalking.oap.server.core.storage.profiling.ebpf.IEBPFProfilingDataDAO;
import org.apache.skywalking.oap.server.core.storage.type.StorageBuilder;
@@ -45,12 +44,12 @@ public class IoTDBEBPFProfilingDataDAO implements IEBPFProfilingDataDAO {
query.append("select * from ");
query = client.addModelPath(query, EBPFProfilingDataRecord.INDEX_NAME);
Map<String, String> indexAndValueMap = new HashMap<>();
- query = client.addQueryIndexValue(EBPFProfilingScheduleRecord.INDEX_NAME, query, indexAndValueMap);
+ query = client.addQueryIndexValue(EBPFProfilingDataRecord.INDEX_NAME, query, indexAndValueMap);
StringBuilder where = new StringBuilder(" where ");
where.append(EBPFProfilingDataRecord.TASK_ID).append(" = \"").append(taskId).append("\" and ");
- where.append(IoTDBClient.TIME).append(" >= ").append(beginTime).append(" and ");
- where.append(IoTDBClient.TIME).append(" <= ").append(endTime).append(" and ");
+ where.append(EBPFProfilingDataRecord.UPLOAD_TIME).append(" >= ").append(beginTime).append(" and ");
+ where.append(EBPFProfilingDataRecord.UPLOAD_TIME).append(" <= ").append(endTime).append(" and ");
if (where.length() > 7) {
int length = where.length();
where.delete(length - 5, length);
@@ -58,7 +57,7 @@ public class IoTDBEBPFProfilingDataDAO implements IEBPFProfilingDataDAO {
}
query.append(IoTDBClient.ALIGN_BY_DEVICE);
- List<? super StorageData> storageDataList = client.filterQuery(EBPFProfilingScheduleRecord.INDEX_NAME, query.toString(), storageBuilder);
+ List<? super StorageData> storageDataList = client.filterQuery(EBPFProfilingDataRecord.INDEX_NAME, query.toString(), storageBuilder);
List<EBPFProfilingDataRecord> dataList = new ArrayList<>(storageDataList.size());
storageDataList.forEach(storageData -> dataList.add((EBPFProfilingDataRecord) storageData));
return dataList;
diff --git a/oap-server/server-storage-plugin/storage-iotdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/iotdb/query/IoTDBEBPFProfilingScheduleDAO.java b/oap-server/server-storage-plugin/storage-iotdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/iotdb/query/IoTDBEBPFProfilingScheduleDAO.java
index afced8f..bdc4456 100644
--- a/oap-server/server-storage-plugin/storage-iotdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/iotdb/query/IoTDBEBPFProfilingScheduleDAO.java
+++ b/oap-server/server-storage-plugin/storage-iotdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/iotdb/query/IoTDBEBPFProfilingScheduleDAO.java
@@ -47,8 +47,8 @@ public class IoTDBEBPFProfilingScheduleDAO implements IEBPFProfilingScheduleDAO
StringBuilder where = new StringBuilder(" where ");
where.append(EBPFProfilingScheduleRecord.TASK_ID).append(" = \"").append(taskId).append("\" and ");
- where.append(IoTDBClient.TIME).append(" >= ").append(TimeBucket.getTimestamp(startTimeBucket)).append(" and ");
- where.append(IoTDBClient.TIME).append(" <= ").append(TimeBucket.getTimestamp(startTimeBucket)).append(" and ");
+ where.append(EBPFProfilingScheduleRecord.START_TIME).append(" >= ").append(TimeBucket.getTimestamp(startTimeBucket)).append(" and ");
+ where.append(EBPFProfilingScheduleRecord.START_TIME).append(" <= ").append(TimeBucket.getTimestamp(endTimeBucket)).append(" and ");
if (where.length() > 7) {
int length = where.length();
where.delete(length - 5, length);
@@ -65,6 +65,7 @@ public class IoTDBEBPFProfilingScheduleDAO implements IEBPFProfilingScheduleDAO
public EBPFProfilingSchedule parseSchedule(EBPFProfilingScheduleRecord traffic) {
final EBPFProfilingSchedule schedule = new EBPFProfilingSchedule();
schedule.setTaskId(traffic.getTaskId());
+ schedule.setScheduleId(traffic.id());
schedule.setProcessId(traffic.getProcessId());
schedule.setStartTime(traffic.getStartTime());
schedule.setEndTime(traffic.getEndTime());
diff --git a/oap-server/server-storage-plugin/storage-iotdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/iotdb/query/IoTDBEBPFProfilingTaskDAO.java b/oap-server/server-storage-plugin/storage-iotdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/iotdb/query/IoTDBEBPFProfilingTaskDAO.java
index 2e3c039..c095203 100644
--- a/oap-server/server-storage-plugin/storage-iotdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/iotdb/query/IoTDBEBPFProfilingTaskDAO.java
+++ b/oap-server/server-storage-plugin/storage-iotdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/iotdb/query/IoTDBEBPFProfilingTaskDAO.java
@@ -61,22 +61,21 @@ public class IoTDBEBPFProfilingTaskDAO implements IEBPFProfilingTaskDAO {
if (StringUtil.isNotEmpty(finder.getInstanceId())) {
indexAndValueMap.put(IoTDBIndexes.INSTANCE_ID_INX, finder.getInstanceId());
}
- query = client.addQueryIndexValue(EBPFProfilingTaskRecord.INDEX_NAME, query, indexAndValueMap);
-
- StringBuilder where = new StringBuilder(" where ");
if (CollectionUtils.isNotEmpty(finder.getProcessIdList())) {
final List<String> processIdList = finder.getProcessIdList();
- if (CollectionUtils.isNotEmpty(processIdList)) {
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < processIdList.size(); i++) {
- if (i > 0) {
- sb.append(", ");
- }
- sb.append("\"").append(processIdList.get(i)).append("\"");
+ for (int i = 0; i < processIdList.size(); i++) {
+ if (i > 0) {
+ query.append(", ");
}
- where.append(EBPFProfilingTaskRecord.PROCESS_ID).append(" in (\"").append(sb).append("\")").append(" and ");
+ final HashMap<String, String> indexWithProcessId = new HashMap<>(indexAndValueMap);
+ indexWithProcessId.put(IoTDBIndexes.PROCESS_ID_INX, processIdList.get(i));
+ query = client.addQueryIndexValue(EBPFProfilingTaskRecord.INDEX_NAME, query, indexWithProcessId);
}
+ } else {
+ query = client.addQueryIndexValue(EBPFProfilingTaskRecord.INDEX_NAME, query, indexAndValueMap);
}
+
+ StringBuilder where = new StringBuilder(" where ");
if (taskStartTime > 0) {
where.append(EBPFProfilingTaskRecord.START_TIME).append(" >= ").append(taskStartTime).append(" and ");
}
diff --git a/test/e2e-v2/cases/kafka/profile/e2e.yaml b/test/e2e-v2/cases/kafka/profile/e2e.yaml
index 8c3f7c0..019d3ec 100644
--- a/test/e2e-v2/cases/kafka/profile/e2e.yaml
+++ b/test/e2e-v2/cases/kafka/profile/e2e.yaml
@@ -34,4 +34,4 @@ verify:
interval: 3s
cases:
- includes:
- - ../../profile/profile-cases.yaml
+ - ../../profiling/trace/profiling-cases.yaml
diff --git a/test/e2e-v2/cases/profile/expected/profile-cases.yaml b/test/e2e-v2/cases/profile/expected/profile-cases.yaml
deleted file mode 100644
index 30e1958..0000000
--- a/test/e2e-v2/cases/profile/expected/profile-cases.yaml
+++ /dev/null
@@ -1,59 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# This file is used to show how to write configuration files and can be used to test.
-
- cases:
- # trace segment list
- - query: |
- curl -s -XPOST http://${provider_host}:${provider_9090}/profile/users?e2e=true -d '{"enableProfiling":"false","name":"SkyWalking"}' -H "Content-Type: application/json" > /dev/null;
- sleep 3;
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls --service-name=e2e-service-provider
- expected: expected/traces-list.yml
- # service list
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls
- expected: expected/service.yml
- # service instance list
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider
- expected: expected/service-instance.yml
- # service endpoint
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=profile --service-name=e2e-service-provider
- expected: expected/service-endpoint.yml
- # create task
- - query: |
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql \
- profile create --service-name=e2e-service-provider \
- --endpoint-name=POST:/profile/{name} \
- --start-time=-1 \
- --duration=1 \
- --dump-period=500 --max-sampling-count=5
- expected: expected/profile-create.yml
- # profile list notified: sleep to wait agent notices and query profile list
- - query: sleep 3 && swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list -service-name=e2e-service-provider --endpoint-name=POST:/profile/{name}
- expected: expected/profile-list-notified.yml
- # profile list finished:
- - query: |
- curl -s -XPOST http://${provider_host}:${provider_9090}/profile/users?e2e=true -d '{"enableProfiling":"true","name":"SkyWalking"}' -H "Content-Type: application/json" > /dev/null;
- sleep 3;
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list -service-name=e2e-service-provider --endpoint-name=POST:/profile/{name}
- expected: expected/traces-list-finished.yml
- # profiled segment list
- - query: |
- curl -X POST http://${consumer_host}:${consumer_9092}/info > /dev/null;
- sleep 5;
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile segment-list --task-id=$( \
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list --service-name=e2e-service-provider --endpoint-name=POST:/profile/{name} | yq e '.[0].id' - \
- )
- expected: expected/profile-segment-list.yml
diff --git a/test/e2e-v2/cases/profile/mysql/e2e.yaml b/test/e2e-v2/cases/profile/mysql/e2e.yaml
deleted file mode 100644
index d73067a..0000000
--- a/test/e2e-v2/cases/profile/mysql/e2e.yaml
+++ /dev/null
@@ -1,37 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# This file is used to show how to write configuration files and can be used to test.
-
-setup:
- env: compose
- file: docker-compose.yml
- timeout: 20m
- init-system-environment: ../../../script/env
- steps:
- - name: set PATH
- command: export PATH=/tmp/skywalking-infra-e2e/bin:$PATH
- - name: install yq
- command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh yq
- - name: install swctl
- command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh swctl
-
-verify:
- retry:
- count: 20
- interval: 3s
- cases:
- - includes:
- - ../profile-cases.yaml
diff --git a/test/e2e-v2/cases/profiling/ebpf/Dockerfile.sqrt b/test/e2e-v2/cases/profiling/ebpf/Dockerfile.sqrt
new file mode 100644
index 0000000..432e696
--- /dev/null
+++ b/test/e2e-v2/cases/profiling/ebpf/Dockerfile.sqrt
@@ -0,0 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+FROM golang:1.17
+
+WORKDIR /
+COPY sqrt.go /sqrt.go
+RUN go build -o sqrt sqrt.go
+
+CMD ["/sqrt"]
\ No newline at end of file
diff --git a/test/e2e-v2/cases/profile/h2/docker-compose.yml b/test/e2e-v2/cases/profiling/ebpf/docker-compose.yml
similarity index 52%
copy from test/e2e-v2/cases/profile/h2/docker-compose.yml
copy to test/e2e-v2/cases/profiling/ebpf/docker-compose.yml
index 1afd4a9..d35308a 100644
--- a/test/e2e-v2/cases/profile/h2/docker-compose.yml
+++ b/test/e2e-v2/cases/profiling/ebpf/docker-compose.yml
@@ -16,42 +16,40 @@
version: '2.1'
services:
- h2db:
+ oap:
+ extends:
+ file: ../../../script/docker-compose/base-compose.yml
+ service: oap
+
+ sqrt:
build:
context: .
- dockerfile: ../../../script/dockerfile/Dockerfile.h2
+ dockerfile: Dockerfile.sqrt
networks:
- e2e
- expose:
- - 1521
- healthcheck:
- test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/1521"]
- interval: 5s
- timeout: 60s
- retries: 120
-
- provider:
- extends:
- file: ../../../script/docker-compose/base-compose.yml
- service: provider
- depends_on:
- oap:
- condition: service_healthy
- ports:
- - 9090
- oap:
- extends:
- file: ../../../script/docker-compose/base-compose.yml
- service: oap
+ rover:
+ image: "ghcr.io/apache/skywalking-rover/skywalking-rover:${SW_ROVER_COMMIT}"
+ networks:
+ - e2e
+ privileged: true
+ pid: host
environment:
- SW_STORAGE: h2
- SW_STORAGE_H2_URL: jdbc:h2:tcp://h2db:1521/skywalking-oap-db
- depends_on:
- h2db:
- condition: service_healthy
- ports:
- - 12800
+ ROVER_HOST_MAPPING: /host
+ ROVER_BACKEND_ADDR: oap:11800
+ ROVER_PROCESS_DISCOVERY_HEARTBEAT_PERIOD: 2s
+ ROVER_PROCESS_DISCOVERY_VM_ACTIVE: "true"
+ ROVER_PROCESS_DISCOVERY_VM_FINDER_MATCH_CMD_REGEX: sqrt
+ ROVER_PROCESS_DISCOVERY_VM_FINDER_LAYER: OS_LINUX
+ ROVER_PROCESS_DISCOVERY_VM_FINDER_SERVICE_NAME: sqrt
+ ROVER_PROCESS_DISCOVERY_VM_FINDER_INSTANCE_NAME: test-instance
+ ROVER_PROCESS_DISCOVERY_VM_FINDER_PROCESS_NAME: "{{.Process.ExeName}}"
+ ROVER_PROFILING_ACTIVE: "true"
+ ROVER_PROFILING_CHECK_INTERVAL: 2s
+ ROVER_PROFILING_FLUSH_INTERVAL: 5s
+ ROVER_PROFILING_TASK_ON_CPU_DUMP_PERIOD: 9ms
+ volumes:
+ - /:/host
networks:
- e2e:
+ e2e:
\ No newline at end of file
diff --git a/test/e2e-v2/cases/profile/es/docker-compose.yml b/test/e2e-v2/cases/profiling/ebpf/es/docker-compose.yml
similarity index 78%
copy from test/e2e-v2/cases/profile/es/docker-compose.yml
copy to test/e2e-v2/cases/profiling/ebpf/es/docker-compose.yml
index 405943d..d9947ef 100644
--- a/test/e2e-v2/cases/profile/es/docker-compose.yml
+++ b/test/e2e-v2/cases/profiling/ebpf/es/docker-compose.yml
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-version: '3.8'
+version: '2.1'
services:
es:
@@ -26,32 +26,41 @@ services:
- discovery.type=single-node
- cluster.routing.allocation.disk.threshold_enabled=false
healthcheck:
- test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/9200"]
+ test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/9200" ]
interval: 5s
timeout: 60s
retries: 120
- provider:
- extends:
- file: ../../../script/docker-compose/base-compose.yml
- service: provider
- depends_on:
- oap:
- condition: service_healthy
- ports:
- - 9090
-
oap:
extends:
- file: ../../../script/docker-compose/base-compose.yml
+ file: ../docker-compose.yml
service: oap
+ networks:
+ - e2e
environment:
SW_STORAGE: elasticsearch
depends_on:
es:
condition: service_healthy
ports:
- - 12800
+ - 12800
+
+ sqrt:
+ extends:
+ file: ../docker-compose.yml
+ service: sqrt
+ networks:
+ - e2e
+
+ rover:
+ extends:
+ file: ../docker-compose.yml
+ service: rover
+ networks:
+ - e2e
+ depends_on:
+ oap:
+ condition: service_healthy
networks:
- e2e:
+ e2e:
\ No newline at end of file
diff --git a/test/e2e-v2/cases/profile/iotdb/e2e.yaml b/test/e2e-v2/cases/profiling/ebpf/es/e2e.yaml
similarity index 92%
copy from test/e2e-v2/cases/profile/iotdb/e2e.yaml
copy to test/e2e-v2/cases/profiling/ebpf/es/e2e.yaml
index d73067a..7a52a5d 100644
--- a/test/e2e-v2/cases/profile/iotdb/e2e.yaml
+++ b/test/e2e-v2/cases/profiling/ebpf/es/e2e.yaml
@@ -19,7 +19,7 @@ setup:
env: compose
file: docker-compose.yml
timeout: 20m
- init-system-environment: ../../../script/env
+ init-system-environment: ../../../../script/env
steps:
- name: set PATH
command: export PATH=/tmp/skywalking-infra-e2e/bin:$PATH
@@ -31,7 +31,7 @@ setup:
verify:
retry:
count: 20
- interval: 3s
+ interval: 10s
cases:
- includes:
- - ../profile-cases.yaml
+ - ../profiling-cases.yaml
\ No newline at end of file
diff --git a/test/e2e-v2/cases/profile/expected/service-endpoint.yml b/test/e2e-v2/cases/profiling/ebpf/expected/instance.yml
similarity index 80%
copy from test/e2e-v2/cases/profile/expected/service-endpoint.yml
copy to test/e2e-v2/cases/profiling/ebpf/expected/instance.yml
index eb6c743..b5c287a 100644
--- a/test/e2e-v2/cases/profile/expected/service-endpoint.yml
+++ b/test/e2e-v2/cases/profiling/ebpf/expected/instance.yml
@@ -14,6 +14,10 @@
# limitations under the License.
{{- contains . }}
-- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/profile/{name}" }}
- name: POST:/profile/{name}
-{{- end}}
+- id: {{ b64enc "sqrt" }}.1_{{ b64enc "test-instance" }}
+ name: test-instance
+ attributes: []
+ language: UNKNOWN
+ instanceuuid: {{ notEmpty .instanceuuid }}
+ layer: OS_LINUX
+{{- end }}
\ No newline at end of file
diff --git a/test/e2e-v2/cases/profile/expected/profile-segment-detail.yml b/test/e2e-v2/cases/profiling/ebpf/expected/process.yml
similarity index 64%
copy from test/e2e-v2/cases/profile/expected/profile-segment-detail.yml
copy to test/e2e-v2/cases/profiling/ebpf/expected/process.yml
index 7b22363..17f1911 100644
--- a/test/e2e-v2/cases/profile/expected/profile-segment-detail.yml
+++ b/test/e2e-v2/cases/profiling/ebpf/expected/process.yml
@@ -13,28 +13,23 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-spans:
-{{- contains .spans }}
-- spanid: 0
- parentspanid: -1
- servicecode: e2e-service-provider
- serviceinstancename: ""
- starttime: {{ gt .starttime 0 }}
- endtime: {{ gt .endtime 0 }}
- endpointname: POST:/profile/{name}
- type: Entry
- peer: ""
- component: SpringMVC
- iserror: false
- layer: Http
- tags:
- {{- contains .tags }}
- - key: url
+{{- contains . }}
+- id: {{ notEmpty .id }}
+ name: sqrt
+ serviceid: {{ b64enc "sqrt" }}.1
+ servicename: sqrt
+ instanceid: {{ b64enc "sqrt" }}.1_{{ b64enc "test-instance" }}
+ instancename: test-instance
+ layer: OS_LINUX
+ agentid: {{ notEmpty .agentid }}
+ detecttype: VM
+ attributes:
+ {{- contains .attributes }}
+ - name: host_ip
value: {{ notEmpty .value }}
- - key: http.method
- value: POST
- - key: http.params
- value: "e2e=[true]"
+ - name: pid
+ value: {{ notEmpty .value }}
+ - name: command_line
+ value: /sqrt
{{- end }}
- logs: []
-{{- end }}
+{{- end }}
\ No newline at end of file
diff --git a/test/e2e-v2/cases/profile/expected/service.yml b/test/e2e-v2/cases/profiling/ebpf/expected/profiling-analysis.yml
similarity index 75%
copy from test/e2e-v2/cases/profile/expected/service.yml
copy to test/e2e-v2/cases/profiling/ebpf/expected/profiling-analysis.yml
index 75d0916..fdabcce 100644
--- a/test/e2e-v2/cases/profile/expected/service.yml
+++ b/test/e2e-v2/cases/profiling/ebpf/expected/profiling-analysis.yml
@@ -13,12 +13,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-{{- contains . }}
-- id: {{ b64enc "e2e-service-provider" }}.1
- name: e2e-service-provider
- group: ""
- shortname: e2e-service-provider
- normal: true
- layers:
- - GENERAL
+tip: null
+trees:
+{{- contains .trees }}
+- elements:
+ {{- contains .elements }}
+ - id: "{{ notEmpty .id }}"
+ parentid: "{{ notEmpty .parentid }}"
+ symbol: "main.sqrtInGolang"
+ stacktype: USER_SPACE
+ dumpcount: {{ gt .dumpcount 0 }}
{{- end }}
+{{- end }}
\ No newline at end of file
diff --git a/test/e2e-v2/cases/profile/expected/profile-create.yml b/test/e2e-v2/cases/profiling/ebpf/expected/profiling-create.yml
similarity index 95%
copy from test/e2e-v2/cases/profile/expected/profile-create.yml
copy to test/e2e-v2/cases/profiling/ebpf/expected/profiling-create.yml
index c6dee76..176b195 100644
--- a/test/e2e-v2/cases/profile/expected/profile-create.yml
+++ b/test/e2e-v2/cases/profiling/ebpf/expected/profiling-create.yml
@@ -13,5 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-id: {{ notEmpty .id }}
+status: true
errorreason: null
+id: {{ notEmpty .id }}
\ No newline at end of file
diff --git a/test/e2e-v2/cases/profile/expected/profile-segment-detail.yml b/test/e2e-v2/cases/profiling/ebpf/expected/profiling-schedule-list.yml
similarity index 56%
copy from test/e2e-v2/cases/profile/expected/profile-segment-detail.yml
copy to test/e2e-v2/cases/profiling/ebpf/expected/profiling-schedule-list.yml
index 7b22363..d1f788c 100644
--- a/test/e2e-v2/cases/profile/expected/profile-segment-detail.yml
+++ b/test/e2e-v2/cases/profiling/ebpf/expected/profiling-schedule-list.yml
@@ -13,28 +13,28 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-spans:
-{{- contains .spans }}
-- spanid: 0
- parentspanid: -1
- servicecode: e2e-service-provider
- serviceinstancename: ""
+{{- contains . }}
+- scheduleid: {{ notEmpty .scheduleid }}
+ taskid: {{ notEmpty .taskid }}
+ process:
+ id: {{ notEmpty .process.id }}
+ name: sqrt
+ serviceid: {{ b64enc "sqrt" }}.1
+ servicename: sqrt
+ instanceid: {{ b64enc "sqrt" }}.1_{{ b64enc "test-instance" }}
+ instancename: test-instance
+ layer: OS_LINUX
+ agentid: {{ notEmpty .process.agentid }}
+ detecttype: VM
+ attributes:
+ {{- contains .process.attributes }}
+ - name: host_ip
+ value: {{ notEmpty .value }}
+ - name: pid
+ value: {{ notEmpty .value }}
+ - name: command_line
+ value: /sqrt
+ {{- end }}
starttime: {{ gt .starttime 0 }}
endtime: {{ gt .endtime 0 }}
- endpointname: POST:/profile/{name}
- type: Entry
- peer: ""
- component: SpringMVC
- iserror: false
- layer: Http
- tags:
- {{- contains .tags }}
- - key: url
- value: {{ notEmpty .value }}
- - key: http.method
- value: POST
- - key: http.params
- value: "e2e=[true]"
- {{- end }}
- logs: []
-{{- end }}
+{{- end }}
\ No newline at end of file
diff --git a/test/e2e-v2/cases/profile/expected/service-endpoint.yml b/test/e2e-v2/cases/profiling/ebpf/expected/profiling-task-list.yml
similarity index 64%
copy from test/e2e-v2/cases/profile/expected/service-endpoint.yml
copy to test/e2e-v2/cases/profiling/ebpf/expected/profiling-task-list.yml
index eb6c743..05abb5e 100644
--- a/test/e2e-v2/cases/profile/expected/service-endpoint.yml
+++ b/test/e2e-v2/cases/profiling/ebpf/expected/profiling-task-list.yml
@@ -14,6 +14,17 @@
# limitations under the License.
{{- contains . }}
-- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/profile/{name}" }}
- name: POST:/profile/{name}
-{{- end}}
+- taskid: {{ notEmpty .taskid }}
+ processfindertype: PROCESS_ID
+ serviceid: {{ b64enc "sqrt" }}.1
+ servicename: sqrt
+ instanceid: {{ b64enc "sqrt" }}.1_{{ b64enc "test-instance" }}
+ instancename: test-instance
+ processid: {{ notEmpty .processid }}
+ processname: sqrt
+ taskstarttime: {{ gt .taskstarttime 0 }}
+ triggertype: FIXED_TIME
+ fixedtriggerduration: 60
+ targettype: ON_CPU
+ createtime: {{ gt .createtime 0 }}
+{{- end }}
\ No newline at end of file
diff --git a/test/e2e-v2/cases/profile/expected/service-endpoint.yml b/test/e2e-v2/cases/profiling/ebpf/expected/service.yml
similarity index 86%
copy from test/e2e-v2/cases/profile/expected/service-endpoint.yml
copy to test/e2e-v2/cases/profiling/ebpf/expected/service.yml
index eb6c743..4c0ee2b 100644
--- a/test/e2e-v2/cases/profile/expected/service-endpoint.yml
+++ b/test/e2e-v2/cases/profiling/ebpf/expected/service.yml
@@ -14,6 +14,11 @@
# limitations under the License.
{{- contains . }}
-- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/profile/{name}" }}
- name: POST:/profile/{name}
-{{- end}}
+- id: {{ b64enc "sqrt" }}.1
+ name: sqrt
+ group: ""
+ shortname: sqrt
+ layers:
+ - OS_LINUX
+ normal: true
+{{- end }}
\ No newline at end of file
diff --git a/test/e2e-v2/cases/profile/h2/docker-compose.yml b/test/e2e-v2/cases/profiling/ebpf/h2/docker-compose.yml
similarity index 79%
copy from test/e2e-v2/cases/profile/h2/docker-compose.yml
copy to test/e2e-v2/cases/profiling/ebpf/h2/docker-compose.yml
index 1afd4a9..6f1aadd 100644
--- a/test/e2e-v2/cases/profile/h2/docker-compose.yml
+++ b/test/e2e-v2/cases/profiling/ebpf/h2/docker-compose.yml
@@ -18,8 +18,8 @@ version: '2.1'
services:
h2db:
build:
- context: .
- dockerfile: ../../../script/dockerfile/Dockerfile.h2
+ context: ""
+ dockerfile: ../../../../script/dockerfile/Dockerfile.h2
networks:
- e2e
expose:
@@ -30,20 +30,12 @@ services:
timeout: 60s
retries: 120
- provider:
- extends:
- file: ../../../script/docker-compose/base-compose.yml
- service: provider
- depends_on:
- oap:
- condition: service_healthy
- ports:
- - 9090
-
oap:
extends:
- file: ../../../script/docker-compose/base-compose.yml
+ file: ../docker-compose.yml
service: oap
+ networks:
+ - e2e
environment:
SW_STORAGE: h2
SW_STORAGE_H2_URL: jdbc:h2:tcp://h2db:1521/skywalking-oap-db
@@ -53,5 +45,22 @@ services:
ports:
- 12800
+ sqrt:
+ extends:
+ file: ../docker-compose.yml
+ service: sqrt
+ networks:
+ - e2e
+
+ rover:
+ extends:
+ file: ../docker-compose.yml
+ service: rover
+ networks:
+ - e2e
+ depends_on:
+ oap:
+ condition: service_healthy
+
networks:
- e2e:
+ e2e:
\ No newline at end of file
diff --git a/test/e2e-v2/cases/profile/iotdb/e2e.yaml b/test/e2e-v2/cases/profiling/ebpf/h2/e2e.yaml
similarity index 92%
copy from test/e2e-v2/cases/profile/iotdb/e2e.yaml
copy to test/e2e-v2/cases/profiling/ebpf/h2/e2e.yaml
index d73067a..7a52a5d 100644
--- a/test/e2e-v2/cases/profile/iotdb/e2e.yaml
+++ b/test/e2e-v2/cases/profiling/ebpf/h2/e2e.yaml
@@ -19,7 +19,7 @@ setup:
env: compose
file: docker-compose.yml
timeout: 20m
- init-system-environment: ../../../script/env
+ init-system-environment: ../../../../script/env
steps:
- name: set PATH
command: export PATH=/tmp/skywalking-infra-e2e/bin:$PATH
@@ -31,7 +31,7 @@ setup:
verify:
retry:
count: 20
- interval: 3s
+ interval: 10s
cases:
- includes:
- - ../profile-cases.yaml
+ - ../profiling-cases.yaml
\ No newline at end of file
diff --git a/test/e2e-v2/cases/profile/influxdb/docker-compose.yml b/test/e2e-v2/cases/profiling/ebpf/influxdb/docker-compose.yml
similarity index 77%
copy from test/e2e-v2/cases/profile/influxdb/docker-compose.yml
copy to test/e2e-v2/cases/profiling/ebpf/influxdb/docker-compose.yml
index 14ed91e..c91a029 100644
--- a/test/e2e-v2/cases/profile/influxdb/docker-compose.yml
+++ b/test/e2e-v2/cases/profiling/ebpf/influxdb/docker-compose.yml
@@ -23,32 +23,41 @@ services:
networks:
- e2e
healthcheck:
- test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/8086"]
+ test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/8086" ]
interval: 5s
timeout: 60s
retries: 120
- provider:
- extends:
- file: ../../../script/docker-compose/base-compose.yml
- service: provider
- depends_on:
- oap:
- condition: service_healthy
- ports:
- - 9090
-
oap:
extends:
- file: ../../../script/docker-compose/base-compose.yml
+ file: ../docker-compose.yml
service: oap
+ networks:
+ - e2e
environment:
SW_STORAGE: influxdb
+ ports:
+ - 12800
depends_on:
influxdb:
condition: service_healthy
- ports:
- - 12800
+
+ sqrt:
+ extends:
+ file: ../docker-compose.yml
+ service: sqrt
+ networks:
+ - e2e
+
+ rover:
+ extends:
+ file: ../docker-compose.yml
+ service: rover
+ networks:
+ - e2e
+ depends_on:
+ oap:
+ condition: service_healthy
networks:
- e2e:
+ e2e:
\ No newline at end of file
diff --git a/test/e2e-v2/cases/profile/iotdb/e2e.yaml b/test/e2e-v2/cases/profiling/ebpf/influxdb/e2e.yaml
similarity index 92%
copy from test/e2e-v2/cases/profile/iotdb/e2e.yaml
copy to test/e2e-v2/cases/profiling/ebpf/influxdb/e2e.yaml
index d73067a..7a52a5d 100644
--- a/test/e2e-v2/cases/profile/iotdb/e2e.yaml
+++ b/test/e2e-v2/cases/profiling/ebpf/influxdb/e2e.yaml
@@ -19,7 +19,7 @@ setup:
env: compose
file: docker-compose.yml
timeout: 20m
- init-system-environment: ../../../script/env
+ init-system-environment: ../../../../script/env
steps:
- name: set PATH
command: export PATH=/tmp/skywalking-infra-e2e/bin:$PATH
@@ -31,7 +31,7 @@ setup:
verify:
retry:
count: 20
- interval: 3s
+ interval: 10s
cases:
- includes:
- - ../profile-cases.yaml
+ - ../profiling-cases.yaml
\ No newline at end of file
diff --git a/test/e2e-v2/cases/profile/iotdb/docker-compose.yml b/test/e2e-v2/cases/profiling/ebpf/iotdb/docker-compose.yml
similarity index 76%
copy from test/e2e-v2/cases/profile/iotdb/docker-compose.yml
copy to test/e2e-v2/cases/profiling/ebpf/iotdb/docker-compose.yml
index b28c0e1..fb6c28c 100644
--- a/test/e2e-v2/cases/profile/iotdb/docker-compose.yml
+++ b/test/e2e-v2/cases/profiling/ebpf/iotdb/docker-compose.yml
@@ -20,35 +20,46 @@ services:
image: apache/iotdb:0.12.4-node
expose:
- 6667
+ ports:
+ - 6667:6667
networks:
- e2e
healthcheck:
- test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/6667"]
+ test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/6667" ]
interval: 5s
timeout: 60s
retries: 120
- provider:
- extends:
- file: ../../../script/docker-compose/base-compose.yml
- service: provider
- depends_on:
- oap:
- condition: service_healthy
- ports:
- - 9090
-
oap:
extends:
- file: ../../../script/docker-compose/base-compose.yml
+ file: ../docker-compose.yml
service: oap
+ networks:
+ - e2e
environment:
SW_STORAGE: iotdb
+ ports:
+ - 12800
depends_on:
iotdb:
condition: service_healthy
- ports:
- - 12800
+
+ sqrt:
+ extends:
+ file: ../docker-compose.yml
+ service: sqrt
+ networks:
+ - e2e
+
+ rover:
+ extends:
+ file: ../docker-compose.yml
+ service: rover
+ networks:
+ - e2e
+ depends_on:
+ oap:
+ condition: service_healthy
networks:
- e2e:
+ e2e:
\ No newline at end of file
diff --git a/test/e2e-v2/cases/profile/iotdb/e2e.yaml b/test/e2e-v2/cases/profiling/ebpf/iotdb/e2e.yaml
similarity index 92%
copy from test/e2e-v2/cases/profile/iotdb/e2e.yaml
copy to test/e2e-v2/cases/profiling/ebpf/iotdb/e2e.yaml
index d73067a..7a52a5d 100644
--- a/test/e2e-v2/cases/profile/iotdb/e2e.yaml
+++ b/test/e2e-v2/cases/profiling/ebpf/iotdb/e2e.yaml
@@ -19,7 +19,7 @@ setup:
env: compose
file: docker-compose.yml
timeout: 20m
- init-system-environment: ../../../script/env
+ init-system-environment: ../../../../script/env
steps:
- name: set PATH
command: export PATH=/tmp/skywalking-infra-e2e/bin:$PATH
@@ -31,7 +31,7 @@ setup:
verify:
retry:
count: 20
- interval: 3s
+ interval: 10s
cases:
- includes:
- - ../profile-cases.yaml
+ - ../profiling-cases.yaml
\ No newline at end of file
diff --git a/test/e2e-v2/cases/profile/mysql/docker-compose.yml b/test/e2e-v2/cases/profiling/ebpf/mysql/docker-compose.yml
similarity index 84%
copy from test/e2e-v2/cases/profile/mysql/docker-compose.yml
copy to test/e2e-v2/cases/profiling/ebpf/mysql/docker-compose.yml
index ac4137a..d242cc3 100644
--- a/test/e2e-v2/cases/profile/mysql/docker-compose.yml
+++ b/test/e2e-v2/cases/profiling/ebpf/mysql/docker-compose.yml
@@ -32,28 +32,37 @@ services:
timeout: 60s
retries: 120
- provider:
- extends:
- file: ../../../script/docker-compose/base-compose.yml
- service: provider
- depends_on:
- oap:
- condition: service_healthy
- ports:
- - 9090
-
oap:
extends:
- file: ../../../script/docker-compose/base-compose.yml
+ file: ../docker-compose.yml
service: oap
+ networks:
+ - e2e
environment:
SW_STORAGE: mysql
+ entrypoint: ['sh', '-c', '/download-mysql.sh && /skywalking/docker-entrypoint.sh']
+ ports:
+ - 12800
depends_on:
mysql:
condition: service_healthy
- entrypoint: ['sh', '-c', '/download-mysql.sh && /skywalking/docker-entrypoint.sh']
- ports:
- - 12800
+
+ sqrt:
+ extends:
+ file: ../docker-compose.yml
+ service: sqrt
+ networks:
+ - e2e
+
+ rover:
+ extends:
+ file: ../docker-compose.yml
+ service: rover
+ networks:
+ - e2e
+ depends_on:
+ oap:
+ condition: service_healthy
networks:
- e2e:
+ e2e:
\ No newline at end of file
diff --git a/test/e2e-v2/cases/profile/iotdb/e2e.yaml b/test/e2e-v2/cases/profiling/ebpf/mysql/e2e.yaml
similarity index 92%
copy from test/e2e-v2/cases/profile/iotdb/e2e.yaml
copy to test/e2e-v2/cases/profiling/ebpf/mysql/e2e.yaml
index d73067a..7a52a5d 100644
--- a/test/e2e-v2/cases/profile/iotdb/e2e.yaml
+++ b/test/e2e-v2/cases/profiling/ebpf/mysql/e2e.yaml
@@ -19,7 +19,7 @@ setup:
env: compose
file: docker-compose.yml
timeout: 20m
- init-system-environment: ../../../script/env
+ init-system-environment: ../../../../script/env
steps:
- name: set PATH
command: export PATH=/tmp/skywalking-infra-e2e/bin:$PATH
@@ -31,7 +31,7 @@ setup:
verify:
retry:
count: 20
- interval: 3s
+ interval: 10s
cases:
- includes:
- - ../profile-cases.yaml
+ - ../profiling-cases.yaml
\ No newline at end of file
diff --git a/test/e2e-v2/cases/profiling/ebpf/profiling-cases.yaml b/test/e2e-v2/cases/profiling/ebpf/profiling-cases.yaml
new file mode 100644
index 0000000..81cdda8
--- /dev/null
+++ b/test/e2e-v2/cases/profiling/ebpf/profiling-cases.yaml
@@ -0,0 +1,49 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file is used to show how to write configuration files and can be used to test.
+
+cases:
+ - query: swctl --base-url=http://${oap_host}:${oap_12800}/graphql --display yaml service ls
+ expected: expected/service.yml
+ - query: swctl --base-url=http://${oap_host}:${oap_12800}/graphql --display yaml instance ls --service-name sqrt
+ expected: expected/instance.yml
+ - query: swctl --base-url=http://${oap_host}:${oap_12800}/graphql --display yaml process ls --service-name sqrt
+ expected: expected/process.yml
+ - query: |
+ swctl --base-url=http://${oap_host}:${oap_12800}/graphql --display yaml profiling ebpf create fixed --process-id=$( \
+ swctl --base-url=http://${oap_host}:${oap_12800}/graphql --display yaml process ls --service-name sqrt| yq e '.[0].id' - \
+ ) --duration=1m
+ expected: expected/profiling-create.yml
+ - query: |
+ swctl --base-url=http://${oap_host}:${oap_12800}/graphql --display yaml profiling ebpf list --process-id=$( \
+ swctl --base-url=http://${oap_host}:${oap_12800}/graphql --display yaml process ls --service-name sqrt| yq e '.[0].id' - \
+ )
+ expected: expected/profiling-task-list.yml
+ - query: |
+ swctl --base-url=http://${oap_host}:${oap_12800}/graphql --display yaml profiling ebpf schedules --task-id=$( \
+ swctl --base-url=http://${oap_host}:${oap_12800}/graphql --display yaml profiling ebpf list --process-id=$( \
+ swctl --base-url=http://${oap_host}:${oap_12800}/graphql --display yaml process ls --service-name sqrt| yq e '.[0].id' - \
+ ) |yq e '.[0].taskid' - \
+ )
+ expected: expected/profiling-schedule-list.yml
+ - query: |
+ taskid=$(swctl --base-url=http://${oap_host}:${oap_12800}/graphql --display yaml profiling ebpf list --process-id=$( \
+ swctl --base-url=http://${oap_host}:${oap_12800}/graphql --display yaml process ls --service-name sqrt| yq e '.[0].id' - \
+ ) |yq e '.[0].taskid' -);
+ start=$(swctl --base-url=http://${oap_host}:${oap_12800}/graphql --display yaml profiling ebpf schedules --task-id=$taskid | yq e '.[0].starttime' -)
+ end=$(swctl --base-url=http://${oap_host}:${oap_12800}/graphql --display yaml profiling ebpf schedules --task-id=$taskid | yq e '.[0].endtime' -)
+ swctl --base-url=http://${oap_host}:${oap_12800}/graphql --display yaml profiling ebpf analysis --task-id=$taskid --time-ranges=$start-$end
+ expected: expected/profiling-analysis.yml
\ No newline at end of file
diff --git a/test/e2e-v2/cases/profiling/ebpf/sqrt.go b/test/e2e-v2/cases/profiling/ebpf/sqrt.go
new file mode 100644
index 0000000..2e307d1
--- /dev/null
+++ b/test/e2e-v2/cases/profiling/ebpf/sqrt.go
@@ -0,0 +1,32 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package main
+
+import (
+ "math"
+)
+
+//go:noinline
+func sqrtInGolang() {
+ for {
+ math.Sqrt(10000)
+ }
+}
+
+func main() {
+ sqrtInGolang()
+}
diff --git a/test/e2e-v2/cases/profile/es/docker-compose.yml b/test/e2e-v2/cases/profiling/trace/es/docker-compose.yml
similarity index 92%
rename from test/e2e-v2/cases/profile/es/docker-compose.yml
rename to test/e2e-v2/cases/profiling/trace/es/docker-compose.yml
index 405943d..6bfae23 100644
--- a/test/e2e-v2/cases/profile/es/docker-compose.yml
+++ b/test/e2e-v2/cases/profiling/trace/es/docker-compose.yml
@@ -33,7 +33,7 @@ services:
provider:
extends:
- file: ../../../script/docker-compose/base-compose.yml
+ file: ../../../../script/docker-compose/base-compose.yml
service: provider
depends_on:
oap:
@@ -43,7 +43,7 @@ services:
oap:
extends:
- file: ../../../script/docker-compose/base-compose.yml
+ file: ../../../../script/docker-compose/base-compose.yml
service: oap
environment:
SW_STORAGE: elasticsearch
diff --git a/test/e2e-v2/cases/profile/iotdb/e2e.yaml b/test/e2e-v2/cases/profiling/trace/es/e2e.yaml
similarity index 93%
copy from test/e2e-v2/cases/profile/iotdb/e2e.yaml
copy to test/e2e-v2/cases/profiling/trace/es/e2e.yaml
index d73067a..8a4fdf3 100644
--- a/test/e2e-v2/cases/profile/iotdb/e2e.yaml
+++ b/test/e2e-v2/cases/profiling/trace/es/e2e.yaml
@@ -19,7 +19,7 @@ setup:
env: compose
file: docker-compose.yml
timeout: 20m
- init-system-environment: ../../../script/env
+ init-system-environment: ../../../../script/env
steps:
- name: set PATH
command: export PATH=/tmp/skywalking-infra-e2e/bin:$PATH
@@ -34,4 +34,4 @@ verify:
interval: 3s
cases:
- includes:
- - ../profile-cases.yaml
+ - ../profiling-cases.yaml
diff --git a/test/e2e-v2/cases/profile/expected/profile-create.yml b/test/e2e-v2/cases/profiling/trace/expected/profile-create.yml
similarity index 100%
rename from test/e2e-v2/cases/profile/expected/profile-create.yml
rename to test/e2e-v2/cases/profiling/trace/expected/profile-create.yml
diff --git a/test/e2e-v2/cases/profile/expected/profile-list-finished.yml b/test/e2e-v2/cases/profiling/trace/expected/profile-list-finished.yml
similarity index 100%
rename from test/e2e-v2/cases/profile/expected/profile-list-finished.yml
rename to test/e2e-v2/cases/profiling/trace/expected/profile-list-finished.yml
diff --git a/test/e2e-v2/cases/profile/expected/profile-list-notified.yml b/test/e2e-v2/cases/profiling/trace/expected/profile-list-notified.yml
similarity index 100%
rename from test/e2e-v2/cases/profile/expected/profile-list-notified.yml
rename to test/e2e-v2/cases/profiling/trace/expected/profile-list-notified.yml
diff --git a/test/e2e-v2/cases/profile/expected/profile-segment-analyze.yml b/test/e2e-v2/cases/profiling/trace/expected/profile-segment-analyze.yml
similarity index 100%
rename from test/e2e-v2/cases/profile/expected/profile-segment-analyze.yml
rename to test/e2e-v2/cases/profiling/trace/expected/profile-segment-analyze.yml
diff --git a/test/e2e-v2/cases/profile/expected/profile-segment-detail.yml b/test/e2e-v2/cases/profiling/trace/expected/profile-segment-detail.yml
similarity index 100%
rename from test/e2e-v2/cases/profile/expected/profile-segment-detail.yml
rename to test/e2e-v2/cases/profiling/trace/expected/profile-segment-detail.yml
diff --git a/test/e2e-v2/cases/profile/expected/profile-segment-list.yml b/test/e2e-v2/cases/profiling/trace/expected/profile-segment-list.yml
similarity index 100%
rename from test/e2e-v2/cases/profile/expected/profile-segment-list.yml
rename to test/e2e-v2/cases/profiling/trace/expected/profile-segment-list.yml
diff --git a/test/e2e-v2/cases/profile/expected/service-endpoint.yml b/test/e2e-v2/cases/profiling/trace/expected/service-endpoint.yml
similarity index 100%
rename from test/e2e-v2/cases/profile/expected/service-endpoint.yml
rename to test/e2e-v2/cases/profiling/trace/expected/service-endpoint.yml
diff --git a/test/e2e-v2/cases/profile/expected/service-instance.yml b/test/e2e-v2/cases/profiling/trace/expected/service-instance.yml
similarity index 100%
rename from test/e2e-v2/cases/profile/expected/service-instance.yml
rename to test/e2e-v2/cases/profiling/trace/expected/service-instance.yml
diff --git a/test/e2e-v2/cases/profile/expected/service.yml b/test/e2e-v2/cases/profiling/trace/expected/service.yml
similarity index 100%
rename from test/e2e-v2/cases/profile/expected/service.yml
rename to test/e2e-v2/cases/profiling/trace/expected/service.yml
diff --git a/test/e2e-v2/cases/profile/expected/traces-list.yml b/test/e2e-v2/cases/profiling/trace/expected/traces-list.yml
similarity index 100%
rename from test/e2e-v2/cases/profile/expected/traces-list.yml
rename to test/e2e-v2/cases/profiling/trace/expected/traces-list.yml
diff --git a/test/e2e-v2/cases/profile/h2/docker-compose.yml b/test/e2e-v2/cases/profiling/trace/h2/docker-compose.yml
similarity index 88%
rename from test/e2e-v2/cases/profile/h2/docker-compose.yml
rename to test/e2e-v2/cases/profiling/trace/h2/docker-compose.yml
index 1afd4a9..fc2a30c 100644
--- a/test/e2e-v2/cases/profile/h2/docker-compose.yml
+++ b/test/e2e-v2/cases/profiling/trace/h2/docker-compose.yml
@@ -19,7 +19,7 @@ services:
h2db:
build:
context: .
- dockerfile: ../../../script/dockerfile/Dockerfile.h2
+ dockerfile: ../../../../script/dockerfile/Dockerfile.h2
networks:
- e2e
expose:
@@ -32,7 +32,7 @@ services:
provider:
extends:
- file: ../../../script/docker-compose/base-compose.yml
+ file: ../../../../script/docker-compose/base-compose.yml
service: provider
depends_on:
oap:
@@ -42,7 +42,7 @@ services:
oap:
extends:
- file: ../../../script/docker-compose/base-compose.yml
+ file: ../../../../script/docker-compose/base-compose.yml
service: oap
environment:
SW_STORAGE: h2
diff --git a/test/e2e-v2/cases/profile/h2/e2e.yaml b/test/e2e-v2/cases/profiling/trace/h2/e2e.yaml
similarity index 93%
rename from test/e2e-v2/cases/profile/h2/e2e.yaml
rename to test/e2e-v2/cases/profiling/trace/h2/e2e.yaml
index d73067a..8a4fdf3 100644
--- a/test/e2e-v2/cases/profile/h2/e2e.yaml
+++ b/test/e2e-v2/cases/profiling/trace/h2/e2e.yaml
@@ -19,7 +19,7 @@ setup:
env: compose
file: docker-compose.yml
timeout: 20m
- init-system-environment: ../../../script/env
+ init-system-environment: ../../../../script/env
steps:
- name: set PATH
command: export PATH=/tmp/skywalking-infra-e2e/bin:$PATH
@@ -34,4 +34,4 @@ verify:
interval: 3s
cases:
- includes:
- - ../profile-cases.yaml
+ - ../profiling-cases.yaml
diff --git a/test/e2e-v2/cases/profile/influxdb/docker-compose.yml b/test/e2e-v2/cases/profiling/trace/influxdb/docker-compose.yml
similarity index 91%
rename from test/e2e-v2/cases/profile/influxdb/docker-compose.yml
rename to test/e2e-v2/cases/profiling/trace/influxdb/docker-compose.yml
index 14ed91e..fa342fc 100644
--- a/test/e2e-v2/cases/profile/influxdb/docker-compose.yml
+++ b/test/e2e-v2/cases/profiling/trace/influxdb/docker-compose.yml
@@ -30,7 +30,7 @@ services:
provider:
extends:
- file: ../../../script/docker-compose/base-compose.yml
+ file: ../../../../script/docker-compose/base-compose.yml
service: provider
depends_on:
oap:
@@ -40,7 +40,7 @@ services:
oap:
extends:
- file: ../../../script/docker-compose/base-compose.yml
+ file: ../../../../script/docker-compose/base-compose.yml
service: oap
environment:
SW_STORAGE: influxdb
diff --git a/test/e2e-v2/cases/profile/es/e2e.yaml b/test/e2e-v2/cases/profiling/trace/influxdb/e2e.yaml
similarity index 93%
rename from test/e2e-v2/cases/profile/es/e2e.yaml
rename to test/e2e-v2/cases/profiling/trace/influxdb/e2e.yaml
index d73067a..8a4fdf3 100644
--- a/test/e2e-v2/cases/profile/es/e2e.yaml
+++ b/test/e2e-v2/cases/profiling/trace/influxdb/e2e.yaml
@@ -19,7 +19,7 @@ setup:
env: compose
file: docker-compose.yml
timeout: 20m
- init-system-environment: ../../../script/env
+ init-system-environment: ../../../../script/env
steps:
- name: set PATH
command: export PATH=/tmp/skywalking-infra-e2e/bin:$PATH
@@ -34,4 +34,4 @@ verify:
interval: 3s
cases:
- includes:
- - ../profile-cases.yaml
+ - ../profiling-cases.yaml
diff --git a/test/e2e-v2/cases/profile/iotdb/docker-compose.yml b/test/e2e-v2/cases/profiling/trace/iotdb/docker-compose.yml
similarity index 91%
rename from test/e2e-v2/cases/profile/iotdb/docker-compose.yml
rename to test/e2e-v2/cases/profiling/trace/iotdb/docker-compose.yml
index b28c0e1..437fc63 100644
--- a/test/e2e-v2/cases/profile/iotdb/docker-compose.yml
+++ b/test/e2e-v2/cases/profiling/trace/iotdb/docker-compose.yml
@@ -30,7 +30,7 @@ services:
provider:
extends:
- file: ../../../script/docker-compose/base-compose.yml
+ file: ../../../../script/docker-compose/base-compose.yml
service: provider
depends_on:
oap:
@@ -40,7 +40,7 @@ services:
oap:
extends:
- file: ../../../script/docker-compose/base-compose.yml
+ file: ../../../../script/docker-compose/base-compose.yml
service: oap
environment:
SW_STORAGE: iotdb
diff --git a/test/e2e-v2/cases/profile/influxdb/e2e.yaml b/test/e2e-v2/cases/profiling/trace/iotdb/e2e.yaml
similarity index 93%
rename from test/e2e-v2/cases/profile/influxdb/e2e.yaml
rename to test/e2e-v2/cases/profiling/trace/iotdb/e2e.yaml
index d73067a..8a4fdf3 100644
--- a/test/e2e-v2/cases/profile/influxdb/e2e.yaml
+++ b/test/e2e-v2/cases/profiling/trace/iotdb/e2e.yaml
@@ -19,7 +19,7 @@ setup:
env: compose
file: docker-compose.yml
timeout: 20m
- init-system-environment: ../../../script/env
+ init-system-environment: ../../../../script/env
steps:
- name: set PATH
command: export PATH=/tmp/skywalking-infra-e2e/bin:$PATH
@@ -34,4 +34,4 @@ verify:
interval: 3s
cases:
- includes:
- - ../profile-cases.yaml
+ - ../profiling-cases.yaml
diff --git a/test/e2e-v2/cases/profile/mysql/docker-compose.yml b/test/e2e-v2/cases/profiling/trace/mysql/docker-compose.yml
similarity index 92%
rename from test/e2e-v2/cases/profile/mysql/docker-compose.yml
rename to test/e2e-v2/cases/profiling/trace/mysql/docker-compose.yml
index ac4137a..0b37107 100644
--- a/test/e2e-v2/cases/profile/mysql/docker-compose.yml
+++ b/test/e2e-v2/cases/profiling/trace/mysql/docker-compose.yml
@@ -34,7 +34,7 @@ services:
provider:
extends:
- file: ../../../script/docker-compose/base-compose.yml
+ file: ../../../../script/docker-compose/base-compose.yml
service: provider
depends_on:
oap:
@@ -44,7 +44,7 @@ services:
oap:
extends:
- file: ../../../script/docker-compose/base-compose.yml
+ file: ../../../../script/docker-compose/base-compose.yml
service: oap
environment:
SW_STORAGE: mysql
diff --git a/test/e2e-v2/cases/profile/iotdb/e2e.yaml b/test/e2e-v2/cases/profiling/trace/mysql/e2e.yaml
similarity index 93%
rename from test/e2e-v2/cases/profile/iotdb/e2e.yaml
rename to test/e2e-v2/cases/profiling/trace/mysql/e2e.yaml
index d73067a..8a4fdf3 100644
--- a/test/e2e-v2/cases/profile/iotdb/e2e.yaml
+++ b/test/e2e-v2/cases/profiling/trace/mysql/e2e.yaml
@@ -19,7 +19,7 @@ setup:
env: compose
file: docker-compose.yml
timeout: 20m
- init-system-environment: ../../../script/env
+ init-system-environment: ../../../../script/env
steps:
- name: set PATH
command: export PATH=/tmp/skywalking-infra-e2e/bin:$PATH
@@ -34,4 +34,4 @@ verify:
interval: 3s
cases:
- includes:
- - ../profile-cases.yaml
+ - ../profiling-cases.yaml
diff --git a/test/e2e-v2/cases/profile/profile-cases.yaml b/test/e2e-v2/cases/profiling/trace/profiling-cases.yaml
similarity index 72%
rename from test/e2e-v2/cases/profile/profile-cases.yaml
rename to test/e2e-v2/cases/profiling/trace/profiling-cases.yaml
index 7c27b58..7a395c2 100644
--- a/test/e2e-v2/cases/profile/profile-cases.yaml
+++ b/test/e2e-v2/cases/profiling/trace/profiling-cases.yaml
@@ -34,43 +34,43 @@
# create task
- query: |
swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql \
- profile create --service-name=e2e-service-provider \
+ profiling trace create --service-name=e2e-service-provider \
--endpoint-name=POST:/profile/{name} \
--start-time=-1 \
--duration=1 --min-duration-threshold=1500 \
--dump-period=500 --max-sampling-count=5
expected: expected/profile-create.yml
- # profile list notified: sleep to wait agent notices and query profile list
- - query: sleep 3 && swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list -service-name=e2e-service-provider --endpoint-name=POST:/profile/{name}
+ # profiling list notified: sleep to wait agent notices and query profiling list
+ - query: sleep 3 && swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace list -service-name=e2e-service-provider --endpoint-name=POST:/profile/{name}
expected: expected/profile-list-notified.yml
- # profile list finished:
+ # profiling list finished:
- query: |
curl -s -XPOST http://${provider_host}:${provider_9090}/profile/users?e2e=true -d '{"enableProfiling":"true","name":"SkyWalking"}' -H "Content-Type: application/json" > /dev/null;
sleep 10;
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list -service-name=e2e-service-provider --endpoint-name=POST:/profile/{name}
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace list -service-name=e2e-service-provider --endpoint-name=POST:/profile/{name}
expected: expected/profile-list-finished.yml
# profiled segment list
- query: |
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile segment-list --task-id=$( \
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list --service-name=e2e-service-provider --endpoint-name=POST:/profile/{name} | yq e '.[0].id' - \
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace segment-list --task-id=$( \
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace list --service-name=e2e-service-provider --endpoint-name=POST:/profile/{name} | yq e '.[0].id' - \
)
expected: expected/profile-segment-list.yml
# profiled segment detail
- query: |
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile profiled-segment --segment-id=$( \
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile segment-list --task-id=$( \
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list --service-name=e2e-service-provider --endpoint-name=POST:/profile/{name} | yq e '.[0].id' - \
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace profiled-segment --segment-id=$( \
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace segment-list --task-id=$( \
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace list --service-name=e2e-service-provider --endpoint-name=POST:/profile/{name} | yq e '.[0].id' - \
) | yq e '.[0].segmentid' - \
)
expected: expected/profile-segment-detail.yml
# query profiled segment analyze
- query: |
segmentid=$( \
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile segment-list --task-id=$( \
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list --service-name=e2e-service-provider --endpoint-name=POST:/profile/{name} | yq e '.[0].id' - \
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace segment-list --task-id=$( \
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace list --service-name=e2e-service-provider --endpoint-name=POST:/profile/{name} | yq e '.[0].id' - \
) | yq e '.[0].segmentid' - \
);
- start=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile profiled-segment --segment-id=$segmentid | yq e '.spans[] | select(.spanid == 0).starttime' -);
- end=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile profiled-segment --segment-id=$segmentid | yq e '.spans[] | select(.spanid == 0).endtime' -);
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile profiled-analyze --segment-id=$segmentid --time-ranges=$(echo $start"-"$end)
+ start=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace profiled-segment --segment-id=$segmentid | yq e '.spans[] | select(.spanid == 0).starttime' -);
+ end=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace profiled-segment --segment-id=$segmentid | yq e '.spans[] | select(.spanid == 0).endtime' -);
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace analysis --segment-id=$segmentid --time-ranges=$(echo $start"-"$end)
expected: expected/profile-segment-analyze.yml
diff --git a/test/e2e-v2/cases/satellite/native-protocols/e2e.yaml b/test/e2e-v2/cases/satellite/native-protocols/e2e.yaml
index 699273c..f11afee 100644
--- a/test/e2e-v2/cases/satellite/native-protocols/e2e.yaml
+++ b/test/e2e-v2/cases/satellite/native-protocols/e2e.yaml
@@ -96,41 +96,41 @@ verify:
# native profile: create task
- query: |
swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql \
- profile create --service-name=e2e-service-provider \
+ profiling trace create --service-name=e2e-service-provider \
--endpoint-name=POST:/info \
--start-time=$((($(date +%s)+5)*1000)) \
--duration=1 --min-duration-threshold=0 \
--dump-period=10 --max-sampling-count=9
expected: expected/profile-create.yml
# native profile: sleep to wait agent notices and query profile list
- - query: sleep 10 && swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list -service-name=e2e-service-provider --endpoint-name=POST:/info
+ - query: sleep 10 && swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace list -service-name=e2e-service-provider --endpoint-name=POST:/info
expected: expected/profile-list.yml
# native profile: sleep to wait segment report and query profiled segment list
- query: |
curl -X POST http://${consumer_host}:${consumer_9092}/info > /dev/null;
sleep 5;
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile segment-list --task-id=$( \
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list --service-name=e2e-service-provider --endpoint-name=POST:/info | yq e '.[0].id' - \
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace segment-list --task-id=$( \
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace list --service-name=e2e-service-provider --endpoint-name=POST:/info | yq e '.[0].id' - \
)
expected: expected/profile-segment-list.yml
# native profile: query profiled segment
- query: |
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile profiled-segment --segment-id=$( \
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile segment-list --task-id=$( \
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list --service-name=e2e-service-provider --endpoint-name=POST:/info | yq e '.[0].id' - \
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace profiled-segment --segment-id=$( \
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace segment-list --task-id=$( \
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace list --service-name=e2e-service-provider --endpoint-name=POST:/info | yq e '.[0].id' - \
) | yq e '.[0].segmentid' - \
)
expected: expected/profile-segment-detail.yml
# native profile: query profiled segment
- query: |
segmentid=$( \
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile segment-list --task-id=$( \
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list --service-name=e2e-service-provider --endpoint-name=POST:/info | yq e '.[0].id' - \
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace segment-list --task-id=$( \
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace list --service-name=e2e-service-provider --endpoint-name=POST:/info | yq e '.[0].id' - \
) | yq e '.[0].segmentid' - \
);
- start=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile profiled-segment --segment-id=$segmentid|yq e '.spans.[0].starttime' -);
- end=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile profiled-segment --segment-id=$segmentid|yq e '.spans.[0].endtime' -);
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile profiled-analyze --segment-id=$segmentid --time-ranges=$(echo $start"-"$end)
+ start=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace profiled-segment --segment-id=$segmentid|yq e '.spans.[0].starttime' -);
+ end=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace profiled-segment --segment-id=$segmentid|yq e '.spans.[0].endtime' -);
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace analysis --segment-id=$segmentid --time-ranges=$(echo $start"-"$end)
expected: expected/profile-segment-analyze.yml
# native CDS: using etcdctl to update trace span limit, "/users" should have more than one span because it need DB save
diff --git a/test/e2e-v2/cases/storage/storage-cases.yaml b/test/e2e-v2/cases/storage/storage-cases.yaml
index 792ba74..f58d0d3 100644
--- a/test/e2e-v2/cases/storage/storage-cases.yaml
+++ b/test/e2e-v2/cases/storage/storage-cases.yaml
@@ -59,28 +59,28 @@ cases:
# native profile: create task
- query: |
swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql \
- profile create --service-name=e2e-service-provider \
+ profiling trace create --service-name=e2e-service-provider \
--endpoint-name=POST:/info \
--start-time=$((($(date +%s)+5)*1000)) \
--duration=1 --min-duration-threshold=0 \
--dump-period=10 --max-sampling-count=9
expected: expected/profile-create.yml
# native profile: sleep to wait agent notices and query profile list
- - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list -service-name=e2e-service-provider --endpoint-name=POST:/info
+ - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace list -service-name=e2e-service-provider --endpoint-name=POST:/info
expected: expected/profile-list.yml
# native profile: sleep to wait segment report and query profiled segment list
- query: |
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile segment-list --task-id=$( \
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list --service-name=e2e-service-provider --endpoint-name=POST:/info | yq e '.[0].id' - \
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace segment-list --task-id=$( \
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace list --service-name=e2e-service-provider --endpoint-name=POST:/info | yq e '.[0].id' - \
)
expected: expected/profile-segment-list.yml
# native profile: query profiled segment
- query: |
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile profiled-segment --segment-id=$( \
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile segment-list --task-id=$( \
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list --service-name=e2e-service-provider --endpoint-name=POST:/info | yq e '.[0].id' - \
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace profiled-segment --segment-id=$( \
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace segment-list --task-id=$( \
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace list --service-name=e2e-service-provider --endpoint-name=POST:/info | yq e '.[0].id' - \
) | yq e '.[0].segmentid' - \
)
expected: expected/profile-segment-detail.yml
@@ -88,13 +88,13 @@ cases:
# native profile: query profiled segment analyze
- query: |
segmentid=$( \
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile segment-list --task-id=$( \
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile list --service-name=e2e-service-provider --endpoint-name=POST:/info | yq e '.[0].id' - \
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace segment-list --task-id=$( \
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace list --service-name=e2e-service-provider --endpoint-name=POST:/info | yq e '.[0].id' - \
) | yq e '.[0].segmentid' - \
);
- start=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile profiled-segment --segment-id=$segmentid|yq e '.spans.[0].starttime' -);
- end=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile profiled-segment --segment-id=$segmentid|yq e '.spans.[0].endtime' -);
- swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profile profiled-analyze --segment-id=$segmentid --time-ranges=$(echo $start"-"$end)
+ start=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace profiled-segment --segment-id=$segmentid|yq e '.spans.[0].starttime' -);
+ end=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace profiled-segment --segment-id=$segmentid|yq e '.spans.[0].endtime' -);
+ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql profiling trace analysis --segment-id=$segmentid --time-ranges=$(echo $start"-"$end)
expected: expected/profile-segment-analyze.yml
- query: |
diff --git a/test/e2e-v2/script/env b/test/e2e-v2/script/env
index 294966a..a9b58a9 100644
--- a/test/e2e-v2/script/env
+++ b/test/e2e-v2/script/env
@@ -22,5 +22,6 @@ SW_AGENT_PYTHON_COMMIT=50388c55428d742d73d9733278f04173585de80d
SW_AGENT_CLIENT_JS_COMMIT=af0565a67d382b683c1dbd94c379b7080db61449
SW_AGENT_CLIENT_JS_TEST_COMMIT=4f1eb1dcdbde3ec4a38534bf01dded4ab5d2f016
SW_KUBERNETES_COMMIT_SHA=0f3ec68e5a7e1608cec8688716b848ed15e971e5
+SW_ROVER_COMMIT=6244cc59d1a813aa01116b68b1f3a7bbd0fe45ad
-SW_CTL_COMMIT=ac30896a87343e9d936b80f86bf96e3985dd7298
+SW_CTL_COMMIT=60cee4a926a867a7bd934b7f94c9a8517e141608
diff --git a/test/e2e-v2/script/prepare/setup-e2e-shell/install-swctl.sh b/test/e2e-v2/script/prepare/setup-e2e-shell/install-swctl.sh
index c58fde4..9dca2d5 100644
--- a/test/e2e-v2/script/prepare/setup-e2e-shell/install-swctl.sh
+++ b/test/e2e-v2/script/prepare/setup-e2e-shell/install-swctl.sh
@@ -26,6 +26,5 @@ if ! command -v swctl &> /dev/null; then
mkdir -p $BASE_DIR/swctl && cd $BASE_DIR/swctl
curl -kLo skywalking-cli.tar.gz https://github.com/apache/skywalking-cli/archive/${SW_CTL_COMMIT}.tar.gz
tar -zxf skywalking-cli.tar.gz --strip=1
- utype=$(uname | awk '{print tolower($0)}')
- make $utype-amd64 && mv bin/swctl-*-$utype-amd64 $BIN_DIR/swctl
+ make install DESTDIR=$BIN_DIR
fi