Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Commit

Permalink
Rollback tracing headers (#187)
Browse files Browse the repository at this point in the history
* update version to 1.3.8

* 将tracing标记由x-b4改为x-b3

---------

Co-authored-by: wanpf <[email protected]>
  • Loading branch information
2 people authored and reaver-flomesh committed Sep 7, 2023
1 parent 969c055 commit ea39441
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions charts/osm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 1.3.7
version: 1.3.8

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: v1.3.7
appVersion: v1.3.8

# This specifies the minimum Kubernetes version OSM is compatible with.
kubeVersion: ">= 1.19.0-0"
Expand Down
4 changes: 2 additions & 2 deletions charts/osm/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Open Service Mesh Edge Helm Chart

![Version: 1.3.7](https://img.shields.io/badge/Version-1.3.7-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.3.7](https://img.shields.io/badge/AppVersion-v1.3.7-informational?style=flat-square)
![Version: 1.3.8](https://img.shields.io/badge/Version-1.3.8-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.3.8](https://img.shields.io/badge/AppVersion-v1.3.8-informational?style=flat-square)

A Helm chart to install the [osm-edge](https://github.com/flomesh-io/osm-edge) control plane on Kubernetes.

Expand Down Expand Up @@ -150,7 +150,7 @@ The following table lists the configurable parameters of the osm chart and their
| osm.image.name.osmSidecarInit | string | `"osm-edge-sidecar-init"` | Sidecar init container's image name |
| osm.image.pullPolicy | string | `"IfNotPresent"` | Container image pull policy for control plane containers |
| osm.image.registry | string | `"flomesh"` | Container image registry for control plane images |
| osm.image.tag | string | `"1.3.7"` | Container image tag for control plane images |
| osm.image.tag | string | `"1.3.8"` | Container image tag for control plane images |
| osm.imagePullSecrets | list | `[]` | `osm-controller` image pull secret |
| osm.inboundPortExclusionList | list | `[]` | Specifies a global list of ports to exclude from inbound traffic interception by the sidecar proxy. If specified, must be a list of positive integers. |
| osm.injector.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].key | string | `"kubernetes.io/os"` | |
Expand Down
2 changes: 1 addition & 1 deletion charts/osm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ osm:
# -- Container image pull policy for control plane containers
pullPolicy: IfNotPresent
# -- Container image tag for control plane images
tag: "1.3.7"
tag: "1.3.8"
# -- Image name defaults
name:
# -- osm-controller's image name
Expand Down
18 changes: 9 additions & 9 deletions pkg/sidecar/providers/pipy/repo/codebase/logging.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
id = uuid.substring(0, 18).replaceAll('-', ''),
) => (
headers['x-forwarded-proto'] = 'http',
headers['x-b4-spanid'] && (
(headers['x-b4-parentspanid'] = headers['x-b4-spanid']) && (headers['x-b4-spanid'] = id)
headers['x-b3-spanid'] && (
(headers['x-b3-parentspanid'] = headers['x-b3-spanid']) && (headers['x-b3-spanid'] = id)
),
!headers['x-b4-traceid'] && (
(headers['x-b4-traceid'] = id) && (headers['x-b4-spanid'] = id)
!headers['x-b3-traceid'] && (
(headers['x-b3-traceid'] = id) && (headers['x-b3-spanid'] = id)
),
!headers['x-request-id'] && (
headers['x-request-id'] = uuid
Expand All @@ -57,10 +57,10 @@
) => (
msg?.head?.headers && (
(config?.Spec?.RemoteLoggingLevel > 0) ? (
((config.Spec.RemoteLoggingLevel === 2 && isOutbound) || !msg.head.headers['x-b4-traceid']) && (
((config.Spec.RemoteLoggingLevel === 2 && isOutbound) || !msg.head.headers['x-b3-traceid']) && (
initTracingHeaders(msg.head.headers)
),
sampled = (!tracingLimitedID || toInt63(msg.head.headers['x-b4-traceid']) < tracingLimitedID)
sampled = (!tracingLimitedID || toInt63(msg.head.headers['x-b3-traceid']) < tracingLimitedID)
) : (
sampled = true
)
Expand All @@ -83,9 +83,9 @@
name: os.env.POD_NAME || os.env.HOSTNAME || 'localhost',
},
trace: {
id: msg.head?.headers?.['x-b4-traceid'] || '',
span: msg.head?.headers?.['x-b4-spanid'] || '',
parent: msg.head?.headers?.['x-b4-parentspanid'] || '',
id: msg.head?.headers?.['x-b3-traceid'] || '',
span: msg.head?.headers?.['x-b3-spanid'] || '',
parent: msg.head?.headers?.['x-b3-parentspanid'] || '',
sampled: '1',
},
req: Object.assign({ reqSize: msg.body?.size, body: msg.body?.toString?.('base64') }, msg.head)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pipy({
.handleMessage(
(msg) => (
tracingEnabled && (
(_sampled = (msg?.head?.headers?.['x-b4-sampled'] === '1')) && (
(_sampled = (msg?.head?.headers?.['x-b3-sampled'] === '1')) && (
_httpBytesStruct = {},
_httpBytesStruct.requestSize = msg?.body?.size,
_zipkinData = makeZipKinData(msg, msg.head.headers, __cluster?.name, 'SERVER', true)
Expand Down
20 changes: 10 additions & 10 deletions pkg/sidecar/providers/pipy/repo/codebase/tracing.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@
id = uuid.substring(0, 18).replaceAll('-', ''),
) => (
proto && (headers['x-forwarded-proto'] = proto),
headers['x-b4-spanid'] && (
(headers['x-b4-parentspanid'] = headers['x-b4-spanid']) && (headers['x-b4-spanid'] = id)
headers['x-b3-spanid'] && (
(headers['x-b3-parentspanid'] = headers['x-b3-spanid']) && (headers['x-b3-spanid'] = id)
),
!headers['x-b4-traceid'] && (
(headers['x-b4-traceid'] = id) && (headers['x-b4-spanid'] = id)
!headers['x-b3-traceid'] && (
(headers['x-b3-traceid'] = id) && (headers['x-b3-spanid'] = id)
),
headers['x-b4-sampled'] && (
sampled = (headers['x-b4-sampled'] === '1'), true
headers['x-b3-sampled'] && (
sampled = (headers['x-b3-sampled'] === '1'), true
) || (
(sampled = (!tracingLimitedID || toInt63(headers['x-b4-traceid']) < tracingLimitedID)) ? (headers['x-b4-sampled'] = '1') : (headers['x-b4-sampled'] = '0')
(sampled = (!tracingLimitedID || toInt63(headers['x-b3-traceid']) < tracingLimitedID)) ? (headers['x-b3-sampled'] = '1') : (headers['x-b3-sampled'] = '0')
),
!headers['x-request-id'] && (
headers['x-request-id'] = uuid
Expand All @@ -61,8 +61,8 @@
makeZipKinData: (msg, headers, clusterName, kind, shared) => (
(data) => (
data = {
'traceId': headers?.['x-b4-traceid'] && headers['x-b4-traceid'].toString(),
'id': headers?.['x-b4-spanid'] && headers['x-b4-spanid'].toString(),
'traceId': headers?.['x-b3-traceid'] && headers['x-b3-traceid'].toString(),
'id': headers?.['x-b3-spanid'] && headers['x-b3-spanid'].toString(),
'name': headers?.host,
'timestamp': Date.now() * 1000,
'localEndpoint': {
Expand All @@ -82,7 +82,7 @@
},
'annotations': []
},
headers['x-b4-parentspanid'] && (data['parentId'] = headers['x-b4-parentspanid']),
headers['x-b3-parentspanid'] && (data['parentId'] = headers['x-b3-parentspanid']),
data['kind'] = kind,
shared && (data['shared'] = shared),
data.tags['request_size'] = '0',
Expand Down

0 comments on commit ea39441

Please sign in to comment.