Skip to content

Commit

Permalink
Updated tag key from 'http.status' to 'http.status_code' (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
wuwen5 authored Aug 14, 2024
1 parent d15c0ce commit 5b107c4
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ on:

jobs:
CI:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
timeout-minutes: 180
strategy:
fail-fast: true
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions lib/skywalking/tracer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
22 changes: 22 additions & 0 deletions test/e2e/e2e.yaml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions test/e2e/user/expected/basic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/user/expected/requestId.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 5b107c4

Please sign in to comment.