Skip to content

Commit 5b107c4

Browse files
authored
Updated tag key from 'http.status' to 'http.status_code' (#107)
1 parent d15c0ce commit 5b107c4

File tree

6 files changed

+34
-18
lines changed

6 files changed

+34
-18
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ on:
2626

2727
jobs:
2828
CI:
29-
runs-on: ubuntu-18.04
29+
runs-on: ubuntu-latest
3030
timeout-minutes: 180
3131
strategy:
3232
fail-fast: true

.github/workflows/e2e.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,7 @@ jobs:
3535
- uses: actions/setup-java@v1
3636
with:
3737
java-version: 8
38-
- run: |
39-
docker-compose --env-file ./test/e2e/.env -f ./test/e2e/docker-compose.yml run -d user
40-
docker wait $(docker ps -qa --filter Name=e2e_user)
41-
status="$?"
42-
docker-compose -f ./test/e2e/docker-compose.yml logs
43-
if [ $status -eq 0 ]; then
44-
docker cp "$(docker ps -qa --filter Name=e2e_user):/response" ./response
45-
cat ./response
46-
fi
47-
docker-compose -f ./test/e2e/docker-compose.yml kill
38+
- name: Run E2E Tests
39+
uses: apache/skywalking-infra-e2e@cf589b4a0b9f8e6f436f78e9cfd94a1ee5494180
40+
with:
41+
e2e-file: test/e2e/e2e.yaml

lib/skywalking/tracer.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function Tracer:finish()
103103
if ngx.ctx.exitSpan ~= nil and not ngx.ctx.is_finished then
104104
local upstream_status = tonumber(ngx.var.upstream_status)
105105
if upstream_status then
106-
Span.tag(ngx.ctx.exitSpan, 'http.status', upstream_status)
106+
Span.tag(ngx.ctx.exitSpan, 'http.status_code', upstream_status)
107107
end
108108
Span.finish(ngx.ctx.exitSpan, ngx.now() * 1000)
109109
ngx.ctx.exitSpan = nil
@@ -121,7 +121,7 @@ function Tracer:prepareForReport()
121121
end
122122

123123
local ngxstatus = ngx.var.status
124-
Span.tag(entrySpan, 'http.status', ngxstatus)
124+
Span.tag(entrySpan, 'http.status_code', ngxstatus)
125125
if tonumber(ngxstatus) >= 500 then
126126
Span.errorOccurred(entrySpan)
127127
end

test/e2e/e2e.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# This file is used to show how to write configuration files and can be used to test.
17+
18+
setup:
19+
env: compose
20+
file: docker-compose.yml
21+
timeout: 20m
22+
init-system-environment: .env

test/e2e/user/expected/basic.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ segmentItems:
6868
peer: 'e2e-test-with-mock-collector:upstream_ip:port'
6969
skipAnalysis: false
7070
tags:
71-
- key: http.status
71+
- key: http.status_code
7272
value: '200'
7373
- operationName: /info
7474
parentSpanId: -1
@@ -86,7 +86,7 @@ segmentItems:
8686
value: POST
8787
- key: http.params
8888
value: 'http://nginx/info'
89-
- key: http.status
89+
- key: http.status_code
9090
value: '200'
9191
refs:
9292
- parentEndpoint: 'POST:/info'
@@ -126,7 +126,7 @@ segmentItems:
126126
value: GET
127127
- key: http.params
128128
value: 'http://nginx/suffix'
129-
- key: http.status
129+
- key: http.status_code
130130
value: '200'
131131
- serviceName: e2e-service-provider
132132
segmentSize: ge 1

test/e2e/user/expected/requestId.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ segmentItems:
3131
peer: 'e2e-test-with-mock-collector:upstream_ip:port'
3232
skipAnalysis: false
3333
tags:
34-
- key: http.status
34+
- key: http.status_code
3535
value: '200'
3636
- operationName: /info
3737
parentSpanId: -1
@@ -49,7 +49,7 @@ segmentItems:
4949
value: POST
5050
- key: http.params
5151
value: 'http://nginx/info'
52-
- key: http.status
52+
- key: http.status_code
5353
value: '200'
5454
- serviceName: e2e-service-provider
5555
segmentSize: ge 1

0 commit comments

Comments
 (0)