You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2020/03/23 15:16:43 UTC

[skywalking] branch master updated: Add PHP module support to e2e test (#4547)

This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 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 954eede  Add PHP module support to e2e test (#4547)
954eede is described below

commit 954eede0ec727222d14cdb41ab584e6354776c49
Author: 何延龙 <ya...@gmail.com>
AuthorDate: Mon Mar 23 23:16:28 2020 +0800

    Add PHP module support to e2e test (#4547)
---
 .github/workflows/e2e.php.yaml                     |  52 ++++
 test/e2e/e2e-test/docker/php/docker-compose.yml    |  82 ++++++
 test/e2e/e2e-test/docker/php/index.php             |  25 ++
 test/e2e/e2e-test/docker/php/php-shadow.ini        |  21 ++
 test/e2e/e2e-test/docker/php/php.ini               |  21 ++
 .../java/org/apache/skywalking/e2e/PHPE2E.java     | 293 +++++++++++++++++++++
 .../src/test/resources/expected/php/endpoints.yml  |  23 ++
 .../src/test/resources/expected/php/instances.yml  |  27 ++
 .../resources/expected/php/serviceInstanceTopo.yml |  34 +++
 .../src/test/resources/expected/php/services.yml   |  20 ++
 .../resources/expected/php/shadowEndpoints.yml     |  21 ++
 .../resources/expected/php/shadowInstances.yml     |  27 ++
 .../src/test/resources/expected/php/topo.yml       |  40 +++
 .../src/test/resources/expected/php/traces.yml     |  32 +++
 14 files changed, 718 insertions(+)

diff --git a/.github/workflows/e2e.php.yaml b/.github/workflows/e2e.php.yaml
new file mode 100644
index 0000000..383cad8
--- /dev/null
+++ b/.github/workflows/e2e.php.yaml
@@ -0,0 +1,52 @@
+# 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.
+
+name: E2E
+
+on:
+  pull_request:
+  push:
+    branches:
+      - master
+    tags:
+      - 'v*'
+
+env:
+  SKIP_TEST: true
+  SW_AGENT_JDK_VERSION: 8
+
+jobs:
+  PHPAgent:
+    name: PHP
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - name: checkout submodules
+        shell: bash
+        run: |
+          git submodule sync --recursive
+          git -c protocol.version=2 submodule update --init --force --recursive --depth=1
+      - name: Compile and Build
+        run: make docker
+      - name: Copy dist package
+        run: cp -R dist test/e2e/
+      - name: PHP
+        run: ./mvnw --batch-mode -f test/e2e/pom.xml -am -DfailIfNoTests=false verify -Dit.test=org.apache.skywalking.e2e.PHPE2E
+      - uses: actions/upload-artifact@v1
+        if: failure()
+        with:
+          name: logs
+          path: logs
diff --git a/test/e2e/e2e-test/docker/php/docker-compose.yml b/test/e2e/e2e-test/docker/php/docker-compose.yml
new file mode 100644
index 0000000..8b8bd38
--- /dev/null
+++ b/test/e2e/e2e-test/docker/php/docker-compose.yml
@@ -0,0 +1,82 @@
+# 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.
+
+version: '2.1'
+
+services:
+  oap:
+    image: skywalking/oap:latest
+    expose:
+      - 11800
+      - 12800
+    networks:
+      - e2e
+    restart: on-failure
+    healthcheck:
+      test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/11800"]
+      interval: 5s
+      timeout: 60s
+      retries: 120
+
+  php-shadow:
+    image: skyapm/skywalking-php:v3.2.8
+    networks:
+      - e2e
+    expose:
+      - 8080
+    environment:
+      - SW_AGENT_COLLECTOR_BACKEND_SERVICES=oap:11800
+    depends_on:
+      oap:
+        condition: service_healthy
+    volumes:
+      - ./index.php:/var/www/html/index.php
+      - ./php-shadow.ini:/usr/local/etc/php/conf.d/ext-skywalking.ini
+
+  php:
+    image: skyapm/skywalking-php:v3.2.8
+    networks:
+      - e2e
+    expose:
+      - 8080
+    environment:
+      - SW_AGENT_COLLECTOR_BACKEND_SERVICES=oap:11800
+    depends_on:
+      php-shadow:
+        condition: service_started
+      oap:
+        condition: service_healthy
+    volumes:
+      - ./index.php:/var/www/html/index.php
+      - ./php.ini:/usr/local/etc/php/conf.d/ext-skywalking.ini
+
+  ui:
+    image: skywalking/ui:latest
+    expose:
+      - 8080
+    networks:
+      - e2e
+    environment:
+      - SW_OAP_ADDRESS=oap:12800
+    depends_on:
+      php:
+        condition: service_started
+      php-shadow:
+        condition: service_started
+      oap:
+        condition: service_healthy
+
+networks:
+  e2e:
\ No newline at end of file
diff --git a/test/e2e/e2e-test/docker/php/index.php b/test/e2e/e2e-test/docker/php/index.php
new file mode 100644
index 0000000..330e60f
--- /dev/null
+++ b/test/e2e/e2e-test/docker/php/index.php
@@ -0,0 +1,25 @@
+<?php
+# 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.
+
+$uri = $_SERVER['REQUEST_URI'];
+
+if($uri == '/php/info') {
+    $ch = curl_init();
+    curl_setopt($ch, CURLOPT_URL, "http://php-shadow:8080/php/call");
+    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+    $output = curl_exec($ch);
+    curl_close($ch);
+}
diff --git a/test/e2e/e2e-test/docker/php/php-shadow.ini b/test/e2e/e2e-test/docker/php/php-shadow.ini
new file mode 100644
index 0000000..dbffe5e
--- /dev/null
+++ b/test/e2e/e2e-test/docker/php/php-shadow.ini
@@ -0,0 +1,21 @@
+; 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.
+
+[skywalking]
+extension=skywalking.so
+skywalking.app_code = php-shadow
+skywalking.enable = 1
+skywalking.version = 6
+skywalking.sock_path = /tmp/sky-agent.sock
\ No newline at end of file
diff --git a/test/e2e/e2e-test/docker/php/php.ini b/test/e2e/e2e-test/docker/php/php.ini
new file mode 100644
index 0000000..52434c8
--- /dev/null
+++ b/test/e2e/e2e-test/docker/php/php.ini
@@ -0,0 +1,21 @@
+; 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.
+
+[skywalking]
+extension=skywalking.so
+skywalking.app_code = php
+skywalking.enable = 1
+skywalking.version = 6
+skywalking.sock_path = /tmp/sky-agent.sock
\ No newline at end of file
diff --git a/test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/PHPE2E.java b/test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/PHPE2E.java
new file mode 100644
index 0000000..928504a
--- /dev/null
+++ b/test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/PHPE2E.java
@@ -0,0 +1,293 @@
+/*
+ * 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 org.apache.skywalking.e2e;
+
+import java.util.List;
+import java.net.URL;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.e2e.annotation.ContainerHostAndPort;
+import org.apache.skywalking.e2e.annotation.DockerCompose;
+import org.apache.skywalking.e2e.base.SkyWalkingE2E;
+import org.apache.skywalking.e2e.base.SkyWalkingTestAdapter;
+import org.apache.skywalking.e2e.common.HostAndPort;
+import org.apache.skywalking.e2e.metrics.AtLeastOneOfMetricsMatcher;
+import org.apache.skywalking.e2e.metrics.Metrics;
+import org.apache.skywalking.e2e.metrics.MetricsQuery;
+import org.apache.skywalking.e2e.metrics.MetricsValueMatcher;
+import org.apache.skywalking.e2e.retryable.RetryableTest;
+import org.apache.skywalking.e2e.service.Service;
+import org.apache.skywalking.e2e.service.ServicesMatcher;
+import org.apache.skywalking.e2e.service.ServicesQuery;
+import org.apache.skywalking.e2e.service.endpoint.Endpoint;
+import org.apache.skywalking.e2e.service.endpoint.EndpointQuery;
+import org.apache.skywalking.e2e.service.endpoint.Endpoints;
+import org.apache.skywalking.e2e.service.endpoint.EndpointsMatcher;
+import org.apache.skywalking.e2e.service.instance.Instance;
+import org.apache.skywalking.e2e.service.instance.Instances;
+import org.apache.skywalking.e2e.service.instance.InstancesMatcher;
+import org.apache.skywalking.e2e.service.instance.InstancesQuery;
+import org.apache.skywalking.e2e.topo.Call;
+import org.apache.skywalking.e2e.topo.ServiceInstanceTopology;
+import org.apache.skywalking.e2e.topo.ServiceInstanceTopologyMatcher;
+import org.apache.skywalking.e2e.topo.ServiceInstanceTopologyQuery;
+import org.apache.skywalking.e2e.topo.Topology;
+import org.apache.skywalking.e2e.topo.TopoMatcher;
+import org.apache.skywalking.e2e.topo.TopoQuery;
+import org.apache.skywalking.e2e.trace.Trace;
+import org.apache.skywalking.e2e.trace.TracesMatcher;
+import org.apache.skywalking.e2e.trace.TracesQuery;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.testcontainers.containers.DockerComposeContainer;
+
+import static org.apache.skywalking.e2e.metrics.MetricsMatcher.verifyMetrics;
+import static org.apache.skywalking.e2e.metrics.MetricsQuery.ALL_ENDPOINT_METRICS;
+import static org.apache.skywalking.e2e.metrics.MetricsQuery.ALL_INSTANCE_METRICS;
+import static org.apache.skywalking.e2e.metrics.MetricsQuery.ALL_SERVICE_INSTANCE_RELATION_CLIENT_METRICS;
+import static org.apache.skywalking.e2e.metrics.MetricsQuery.ALL_SERVICE_INSTANCE_RELATION_SERVER_METRICS;
+import static org.apache.skywalking.e2e.metrics.MetricsQuery.ALL_SERVICE_METRICS;
+import static org.apache.skywalking.e2e.metrics.MetricsQuery.ALL_SERVICE_RELATION_CLIENT_METRICS;
+import static org.apache.skywalking.e2e.metrics.MetricsQuery.ALL_SERVICE_RELATION_SERVER_METRICS;
+import static org.apache.skywalking.e2e.utils.Yamls.load;
+import static org.apache.skywalking.e2e.utils.Times.now;
+
+@Slf4j
+@SkyWalkingE2E
+public class PHPE2E extends SkyWalkingTestAdapter {
+    @SuppressWarnings("unused")
+    @DockerCompose("docker/php/docker-compose.yml")
+    private DockerComposeContainer<?> justForSideEffects;
+
+    @SuppressWarnings("unused")
+    @ContainerHostAndPort(name = "ui", port = 8080)
+    private HostAndPort swWebappHostPort;
+
+    @SuppressWarnings("unused")
+    @ContainerHostAndPort(name = "php", port = 8080)
+    private HostAndPort phpHostPort;
+
+    @SuppressWarnings("unused")
+    @ContainerHostAndPort(name = "php-shadow", port = 8080)
+    private HostAndPort phpShadowHostPort;
+
+    private final String shadowServiceName = "php-shadow";
+
+    @BeforeAll
+    public void setUp() throws Exception {
+        URL url = new URL("http", phpHostPort.host(), phpHostPort.port(), "/init");
+        restTemplate.getForObject(url.toURI(), String.class);
+        Thread.sleep(1000);
+        url = new URL("http", phpShadowHostPort.host(), phpShadowHostPort.port(), "/init-shadow");
+        restTemplate.getForObject(url.toURI(), String.class);
+        Thread.sleep(1000);
+        queryClient(swWebappHostPort);
+
+        trafficController(phpHostPort, "/php/info");
+    }
+
+    @AfterAll
+    public void tearDown() {
+        trafficController.stop();
+    }
+
+    @RetryableTest
+    void services() throws Exception {
+        final List<Service> services = graphql.services(new ServicesQuery().start(startTime).end(now()));
+
+        LOGGER.info("services: {}", services);
+
+        load("expected/php/services.yml").as(ServicesMatcher.class).verify(services);
+
+        for (Service service : services) {
+            LOGGER.info("verifying service instances: {}", service);
+
+            verifyServiceMetrics(service);
+
+            final Instances instances = verifyServiceInstances(service);
+
+            verifyInstancesMetrics(instances);
+
+            final Endpoints endpoints = verifyServiceEndpoints(service);
+
+            verifyEndpointsMetrics(endpoints);
+        }
+    }
+
+    @RetryableTest
+    void traces() throws Exception {
+        final List<Trace> traces = graphql.traces(new TracesQuery().start(startTime).end(now()).orderByStartTime());
+
+        LOGGER.info("traces: {}", traces);
+
+        load("expected/php/traces.yml").as(TracesMatcher.class).verifyLoosely(traces);
+    }
+
+    @RetryableTest
+    void topology() throws Exception {
+        final Topology topology = graphql.topo(new TopoQuery().stepByMinute().start(startTime.minusDays(1)).end(now()));
+
+        LOGGER.info("topology: {}", topology);
+
+        load("expected/php/topo.yml").as(TopoMatcher.class).verify(topology);
+
+        verifyServiceRelationMetrics(topology.getCalls());
+    }
+
+    @RetryableTest
+    void serviceInstances() throws Exception {
+
+        final ServiceInstanceTopology topology = graphql.serviceInstanceTopo(
+            new ServiceInstanceTopologyQuery().stepByMinute()
+                                              .start(startTime.minusDays(1))
+                                              .end(now())
+                                              .clientServiceId("1")
+                                              .serverServiceId("2"));
+
+        LOGGER.info("topology: {}", topology);
+
+        load("expected/php/serviceInstanceTopo.yml").as(ServiceInstanceTopologyMatcher.class).verify(topology);
+
+        verifyServiceInstanceRelationMetrics(topology.getCalls());
+    }
+
+    private Instances verifyServiceInstances(final Service service) throws Exception {
+        final Instances instances = graphql.instances(
+                new InstancesQuery().serviceId(service.getKey()).start(startTime).end(now())
+        );
+
+        LOGGER.info("instances: {} {}", service.getLabel(), instances);
+
+        if (shadowServiceName.equals(service.getLabel())) {
+            load("expected/php/shadowInstances.yml").as(InstancesMatcher.class).verify(instances);
+        } else {
+            load("expected/php/instances.yml").as(InstancesMatcher.class).verify(instances);
+        }
+
+        return instances;
+    }
+
+    private Endpoints verifyServiceEndpoints(final Service service) throws Exception {
+        final Endpoints endpoints = graphql.endpoints(new EndpointQuery().serviceId(service.getKey()));
+
+        LOGGER.info("endpoints: {} {}", service.getLabel(), endpoints);
+
+        if (shadowServiceName.equals(service.getLabel())) {
+            load("expected/php/shadowEndpoints.yml").as(EndpointsMatcher.class).verify(endpoints);
+        } else {
+            load("expected/php/endpoints.yml").as(EndpointsMatcher.class).verify(endpoints);
+        }
+
+        return endpoints;
+    }
+
+    private void verifyInstancesMetrics(Instances instances) throws Exception {
+        for (Instance instance : instances.getInstances()) {
+            for (String metricsName : ALL_INSTANCE_METRICS) {
+                LOGGER.info("verifying service instance response time: {}", instance);
+                final Metrics instanceMetrics = graphql.metrics(
+                    new MetricsQuery().stepByMinute().metricsName(metricsName).id(instance.getKey())
+                );
+
+                LOGGER.info("instance metrics: {}", instanceMetrics);
+
+                final AtLeastOneOfMetricsMatcher instanceRespTimeMatcher = new AtLeastOneOfMetricsMatcher();
+                final MetricsValueMatcher greaterThanZero = new MetricsValueMatcher();
+                greaterThanZero.setValue("gt 0");
+                instanceRespTimeMatcher.setValue(greaterThanZero);
+                instanceRespTimeMatcher.verify(instanceMetrics);
+                LOGGER.info("{}: {}", metricsName, instanceMetrics);
+            }
+        }
+    }
+
+    private void verifyEndpointsMetrics(Endpoints endpoints) throws Exception {
+        for (Endpoint endpoint : endpoints.getEndpoints()) {
+            if (!endpoint.getLabel().equals("/php/call") || !endpoint.getLabel().equals("/php/info")) {
+                continue;
+            }
+            for (final String metricName : ALL_ENDPOINT_METRICS) {
+                LOGGER.info("verifying endpoint {}: {}", endpoint, metricName);
+
+                final Metrics metrics = graphql.metrics(
+                    new MetricsQuery().stepByMinute().metricsName(metricName).id(endpoint.getKey())
+                );
+
+                LOGGER.info("metrics: {}", metrics);
+
+                final AtLeastOneOfMetricsMatcher instanceRespTimeMatcher = new AtLeastOneOfMetricsMatcher();
+                final MetricsValueMatcher greaterThanZero = new MetricsValueMatcher();
+                greaterThanZero.setValue("gt 0");
+                instanceRespTimeMatcher.setValue(greaterThanZero);
+                instanceRespTimeMatcher.verify(metrics);
+
+                LOGGER.info("{}: {}", metricName, metrics);
+            }
+        }
+    }
+
+    private void verifyServiceMetrics(final Service service) throws Exception {
+        for (String metricName : ALL_SERVICE_METRICS) {
+            LOGGER.info("verifying service {}, metrics: {}", service, metricName);
+            final Metrics serviceMetrics = graphql.metrics(
+                new MetricsQuery().stepByMinute().metricsName(metricName).id(service.getKey())
+            );
+            LOGGER.info("serviceMetrics: {}", serviceMetrics);
+            final AtLeastOneOfMetricsMatcher instanceRespTimeMatcher = new AtLeastOneOfMetricsMatcher();
+            final MetricsValueMatcher greaterThanZero = new MetricsValueMatcher();
+            greaterThanZero.setValue("gt 0");
+            instanceRespTimeMatcher.setValue(greaterThanZero);
+            instanceRespTimeMatcher.verify(serviceMetrics);
+            LOGGER.info("{}: {}", metricName, serviceMetrics);
+        }
+    }
+
+    private void verifyServiceInstanceRelationMetrics(final List<Call> calls) throws Exception {
+        verifyRelationMetrics(
+            calls, ALL_SERVICE_INSTANCE_RELATION_CLIENT_METRICS,
+            ALL_SERVICE_INSTANCE_RELATION_SERVER_METRICS
+        );
+    }
+
+    private void verifyServiceRelationMetrics(final List<Call> calls) throws Exception {
+        verifyRelationMetrics(calls, ALL_SERVICE_RELATION_CLIENT_METRICS, ALL_SERVICE_RELATION_SERVER_METRICS);
+    }
+
+    private void verifyRelationMetrics(final List<Call> calls,
+                                       final String[] relationClientMetrics,
+                                       final String[] relationServerMetrics) throws Exception {
+        for (Call call : calls) {
+            for (String detectPoint : call.getDetectPoints()) {
+                switch (detectPoint) {
+                    case "CLIENT": {
+                        for (String metricName : relationClientMetrics) {
+                            verifyMetrics(graphql, metricName, call.getId(), startTime);
+                        }
+                        break;
+                    }
+                    case "SERVER": {
+                        for (String metricName : relationServerMetrics) {
+                            verifyMetrics(graphql, metricName, call.getId(), startTime);
+                        }
+                        break;
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/test/e2e/e2e-test/src/test/resources/expected/php/endpoints.yml b/test/e2e/e2e-test/src/test/resources/expected/php/endpoints.yml
new file mode 100644
index 0000000..73249ee
--- /dev/null
+++ b/test/e2e/e2e-test/src/test/resources/expected/php/endpoints.yml
@@ -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.
+
+endpoints:
+  - key: not null
+    label: /php/info
+  - key: not null
+    label: /php/call
+
+
+
diff --git a/test/e2e/e2e-test/src/test/resources/expected/php/instances.yml b/test/e2e/e2e-test/src/test/resources/expected/php/instances.yml
new file mode 100644
index 0000000..83dbcee
--- /dev/null
+++ b/test/e2e/e2e-test/src/test/resources/expected/php/instances.yml
@@ -0,0 +1,27 @@
+# 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.
+
+instances:
+  - key: 2
+    label: not null
+    attributes:
+      - name: os_name
+        value: not null
+      - name: host_name
+        value: not null
+      - name: process_no
+        value: gt 0
+      - name: ipv4s
+        value: not null
diff --git a/test/e2e/e2e-test/src/test/resources/expected/php/serviceInstanceTopo.yml b/test/e2e/e2e-test/src/test/resources/expected/php/serviceInstanceTopo.yml
new file mode 100644
index 0000000..238e70a
--- /dev/null
+++ b/test/e2e/e2e-test/src/test/resources/expected/php/serviceInstanceTopo.yml
@@ -0,0 +1,34 @@
+# 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.
+
+nodes:
+  - id: 1
+    name: User
+    type: USER
+    serviceId: 1
+    serviceName: User
+    isReal: false
+  - id: 2
+    name: not null
+    serviceId: 2
+    serviceName: php
+    type: not null
+    isReal: true
+calls:
+  - id: 1_2
+    source: 1
+    detectPoints:
+      - SERVER
+    target: 2
diff --git a/test/e2e/e2e-test/src/test/resources/expected/php/services.yml b/test/e2e/e2e-test/src/test/resources/expected/php/services.yml
new file mode 100644
index 0000000..d57c2a5
--- /dev/null
+++ b/test/e2e/e2e-test/src/test/resources/expected/php/services.yml
@@ -0,0 +1,20 @@
+# 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.
+
+services:
+  - key: gt 0
+    label: "php"
+  - key: gt 0
+    label: "php-shadow"
\ No newline at end of file
diff --git a/test/e2e/e2e-test/src/test/resources/expected/php/shadowEndpoints.yml b/test/e2e/e2e-test/src/test/resources/expected/php/shadowEndpoints.yml
new file mode 100644
index 0000000..969d1c2
--- /dev/null
+++ b/test/e2e/e2e-test/src/test/resources/expected/php/shadowEndpoints.yml
@@ -0,0 +1,21 @@
+# 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.
+
+endpoints:
+  - key: not null
+    label: /php/call
+
+
+
diff --git a/test/e2e/e2e-test/src/test/resources/expected/php/shadowInstances.yml b/test/e2e/e2e-test/src/test/resources/expected/php/shadowInstances.yml
new file mode 100644
index 0000000..d9af02b
--- /dev/null
+++ b/test/e2e/e2e-test/src/test/resources/expected/php/shadowInstances.yml
@@ -0,0 +1,27 @@
+# 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.
+
+instances:
+  - key: 3
+    label: not null
+    attributes:
+      - name: os_name
+        value: not null
+      - name: host_name
+        value: not null
+      - name: process_no
+        value: gt 0
+      - name: ipv4s
+        value: not null
diff --git a/test/e2e/e2e-test/src/test/resources/expected/php/topo.yml b/test/e2e/e2e-test/src/test/resources/expected/php/topo.yml
new file mode 100644
index 0000000..09462de
--- /dev/null
+++ b/test/e2e/e2e-test/src/test/resources/expected/php/topo.yml
@@ -0,0 +1,40 @@
+# 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.
+
+nodes:
+  - id: 1
+    name: User
+    type: USER
+    isReal: false
+  - id: 2
+    name: php
+    type: HttpClient
+    isReal: true
+  - id: 3
+    name: php-shadow
+    type: HttpClient
+    isReal: true
+calls:
+  - id: 1_2
+    source: 1
+    detectPoints:
+      - SERVER
+    target: 2
+  - id: 2_3
+    source: 2
+    detectPoints:
+      - CLIENT
+      - SERVER
+    target: 3
\ No newline at end of file
diff --git a/test/e2e/e2e-test/src/test/resources/expected/php/traces.yml b/test/e2e/e2e-test/src/test/resources/expected/php/traces.yml
new file mode 100644
index 0000000..f558c2e
--- /dev/null
+++ b/test/e2e/e2e-test/src/test/resources/expected/php/traces.yml
@@ -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.
+
+traces:
+  - key: not null
+    endpointNames:
+      - /php/info
+    duration: ge 0
+    start: gt 0
+    isError: false
+    traceIds:
+      - not null
+  - key: not null
+    endpointNames:
+      - /php/call
+    duration: ge 0
+    start: gt 0
+    isError: false
+    traceIds:
+      - not null
\ No newline at end of file