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-nginx-lua.git
The following commit(s) were added to refs/heads/master by this push:
new 5b107c4 Updated tag key from 'http.status' to 'http.status_code'
(#107)
5b107c4 is described below
commit 5b107c4f6ad8fee3092689f35c525725f9ab4698
Author: wuwen <[email protected]>
AuthorDate: Wed Aug 14 20:13:10 2024 +0800
Updated tag key from 'http.status' to 'http.status_code' (#107)
---
.github/workflows/ci.yaml | 2 +-
.github/workflows/e2e.yaml | 14 ++++----------
lib/skywalking/tracer.lua | 4 ++--
test/e2e/e2e.yaml | 22 ++++++++++++++++++++++
test/e2e/user/expected/basic.yaml | 6 +++---
test/e2e/user/expected/requestId.yaml | 4 ++--
6 files changed, 34 insertions(+), 18 deletions(-)
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index c33c63c..bb4daa5 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -26,7 +26,7 @@ on:
jobs:
CI:
- runs-on: ubuntu-18.04
+ runs-on: ubuntu-latest
timeout-minutes: 180
strategy:
fail-fast: true
diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml
index 10de749..72e7771 100644
--- a/.github/workflows/e2e.yaml
+++ b/.github/workflows/e2e.yaml
@@ -35,13 +35,7 @@ jobs:
- uses: actions/setup-java@v1
with:
java-version: 8
- - run: |
- docker-compose --env-file ./test/e2e/.env -f
./test/e2e/docker-compose.yml run -d user
- docker wait $(docker ps -qa --filter Name=e2e_user)
- status="$?"
- docker-compose -f ./test/e2e/docker-compose.yml logs
- if [ $status -eq 0 ]; then
- docker cp "$(docker ps -qa --filter Name=e2e_user):/response"
./response
- cat ./response
- fi
- docker-compose -f ./test/e2e/docker-compose.yml kill
+ - name: Run E2E Tests
+ uses:
apache/skywalking-infra-e2e@cf589b4a0b9f8e6f436f78e9cfd94a1ee5494180
+ with:
+ e2e-file: test/e2e/e2e.yaml
diff --git a/lib/skywalking/tracer.lua b/lib/skywalking/tracer.lua
index 4becc49..5f0c417 100644
--- a/lib/skywalking/tracer.lua
+++ b/lib/skywalking/tracer.lua
@@ -103,7 +103,7 @@ function Tracer:finish()
if ngx.ctx.exitSpan ~= nil and not ngx.ctx.is_finished then
local upstream_status = tonumber(ngx.var.upstream_status)
if upstream_status then
- Span.tag(ngx.ctx.exitSpan, 'http.status', upstream_status)
+ Span.tag(ngx.ctx.exitSpan, 'http.status_code', upstream_status)
end
Span.finish(ngx.ctx.exitSpan, ngx.now() * 1000)
ngx.ctx.exitSpan = nil
@@ -121,7 +121,7 @@ function Tracer:prepareForReport()
end
local ngxstatus = ngx.var.status
- Span.tag(entrySpan, 'http.status', ngxstatus)
+ Span.tag(entrySpan, 'http.status_code', ngxstatus)
if tonumber(ngxstatus) >= 500 then
Span.errorOccurred(entrySpan)
end
diff --git a/test/e2e/e2e.yaml b/test/e2e/e2e.yaml
new file mode 100644
index 0000000..5f048a3
--- /dev/null
+++ b/test/e2e/e2e.yaml
@@ -0,0 +1,22 @@
+# 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: .env
\ No newline at end of file
diff --git a/test/e2e/user/expected/basic.yaml
b/test/e2e/user/expected/basic.yaml
index cc0c75a..8d4eae4 100644
--- a/test/e2e/user/expected/basic.yaml
+++ b/test/e2e/user/expected/basic.yaml
@@ -68,7 +68,7 @@ segmentItems:
peer: 'e2e-test-with-mock-collector:upstream_ip:port'
skipAnalysis: false
tags:
- - key: http.status
+ - key: http.status_code
value: '200'
- operationName: /info
parentSpanId: -1
@@ -86,7 +86,7 @@ segmentItems:
value: POST
- key: http.params
value: 'http://nginx/info'
- - key: http.status
+ - key: http.status_code
value: '200'
refs:
- parentEndpoint: 'POST:/info'
@@ -126,7 +126,7 @@ segmentItems:
value: GET
- key: http.params
value: 'http://nginx/suffix'
- - key: http.status
+ - key: http.status_code
value: '200'
- serviceName: e2e-service-provider
segmentSize: ge 1
diff --git a/test/e2e/user/expected/requestId.yaml
b/test/e2e/user/expected/requestId.yaml
index ee80852..de10741 100644
--- a/test/e2e/user/expected/requestId.yaml
+++ b/test/e2e/user/expected/requestId.yaml
@@ -31,7 +31,7 @@ segmentItems:
peer: 'e2e-test-with-mock-collector:upstream_ip:port'
skipAnalysis: false
tags:
- - key: http.status
+ - key: http.status_code
value: '200'
- operationName: /info
parentSpanId: -1
@@ -49,7 +49,7 @@ segmentItems:
value: POST
- key: http.params
value: 'http://nginx/info'
- - key: http.status
+ - key: http.status_code
value: '200'
- serviceName: e2e-service-provider
segmentSize: ge 1