Skip to content

Commit 34bb299

Browse files
committed
ci(deps): upgrade x package (#1051)
Because - the `x` package has a major update to catch up - the latest instrument logic in the `x/client` and `x/server` package can be easily adopted. In this commit, we instrument the Temporal worker respectively. This commit - upgrade `x` package - fix a minor CI step error.
1 parent 70edddd commit 34bb299

File tree

5 files changed

+51
-14
lines changed

5 files changed

+51
-14
lines changed

.github/workflows/images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
paths-ignore:
99
- "README.md"
1010
tags:
11-
- "*-rc"
11+
- "*-rc*"
1212
release:
1313
types: [published]
1414

.github/workflows/integration-test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,15 @@ jobs:
7272
uses: docker/setup-buildx-action@v3
7373

7474
- name: Set short commit SHA
75+
if: github.ref == 'refs/heads/main'
7576
run: |
7677
echo "COMMIT_SHORT_SHA=${GITHUB_SHA:0:7}" >> $GITHUB_ENV
7778
79+
- name: Set PR head commit SHA
80+
if: github.event_name == 'pull_request'
81+
run: |
82+
echo "COMMIT_SHORT_SHA=$(echo ${{ github.event.pull_request.head.sha }} | cut -c1-7)" >> $GITHUB_ENV
83+
7884
- name: Build image
7985
uses: docker/build-push-action@v6
8086
with:

cmd/worker/main.go

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ const gracefulShutdownTimeout = 60 * time.Minute
4949

5050
var (
5151
// These variables might be overridden at buildtime.
52-
serviceVersion = "dev"
5352
serviceName = "pipeline-backend-worker"
53+
serviceVersion = "dev"
5454
)
5555

5656
func main() {
@@ -130,6 +130,19 @@ func main() {
130130
WorkflowPanicPolicy: worker.BlockWorkflow,
131131
WorkerStopTimeout: gracefulShutdownTimeout,
132132
MaxConcurrentWorkflowTaskExecutionSize: 100,
133+
Interceptors: func() []interceptor.WorkerInterceptor {
134+
if !config.Config.OTELCollector.Enable {
135+
return nil
136+
}
137+
workerInterceptor, err := opentelemetry.NewTracingInterceptor(opentelemetry.TracerOptions{
138+
Tracer: otel.Tracer(serviceName),
139+
TextMapPropagator: otel.GetTextMapPropagator(),
140+
})
141+
if err != nil {
142+
logger.Fatal("Unable to create worker tracing interceptor", zap.Error(err))
143+
}
144+
return []interceptor.WorkerInterceptor{workerInterceptor}
145+
}(),
133146
})
134147

135148
w.RegisterWorkflow(cw.TriggerPipelineWorkflow)
@@ -253,20 +266,23 @@ func newClients(ctx context.Context, logger *zap.Logger) (
253266
}
254267

255268
// Initialize Temporal client
256-
temporalTracingInterceptor, err := opentelemetry.NewTracingInterceptor(opentelemetry.TracerOptions{
257-
Tracer: otel.Tracer(serviceName + "-temporal"),
258-
TextMapPropagator: otel.GetTextMapPropagator(),
259-
})
260-
if err != nil {
261-
logger.Fatal("Unable to create temporal tracing interceptor", zap.Error(err))
262-
}
263-
264269
temporalClientOptions, err := temporal.ClientOptions(config.Config.Temporal, logger)
265270
if err != nil {
266271
logger.Fatal("Unable to build Temporal client options", zap.Error(err))
267272
}
268273

269-
temporalClientOptions.Interceptors = []interceptor.ClientInterceptor{temporalTracingInterceptor}
274+
// Only add interceptor if tracing is enabled
275+
if config.Config.OTELCollector.Enable {
276+
temporalTracingInterceptor, err := opentelemetry.NewTracingInterceptor(opentelemetry.TracerOptions{
277+
Tracer: otel.Tracer(serviceName),
278+
TextMapPropagator: otel.GetTextMapPropagator(),
279+
})
280+
if err != nil {
281+
logger.Fatal("Unable to create temporal tracing interceptor", zap.Error(err))
282+
}
283+
temporalClientOptions.Interceptors = []interceptor.ClientInterceptor{temporalTracingInterceptor}
284+
}
285+
270286
temporalClient, err := temporalclient.Dial(temporalClientOptions)
271287
if err != nil {
272288
logger.Fatal("Unable to create Temporal client", zap.Error(err))

go.mod

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ require (
4747
github.com/influxdata/influxdb-client-go/v2 v2.14.0
4848
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20250707160902-77023eb2f033
4949
github.com/instill-ai/usage-client v0.4.0
50-
github.com/instill-ai/x v0.8.0-alpha.0.20250714023551-3829fd844cd5
50+
github.com/instill-ai/x v0.9.0-alpha
5151
github.com/itchyny/gojq v0.12.17
5252
github.com/jackc/pgx/v5 v5.7.5
5353
github.com/jmoiron/sqlx v1.4.0
@@ -121,6 +121,10 @@ require (
121121
github.com/hhrutter/lzw v1.0.0 // indirect
122122
github.com/hhrutter/pkcs7 v0.2.0 // indirect
123123
github.com/hhrutter/tiff v1.0.2 // indirect
124+
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
125+
github.com/jackc/pgconn v1.14.3 // indirect
126+
github.com/jackc/pgio v1.0.0 // indirect
127+
github.com/jackc/pgproto3/v2 v2.3.3 // indirect
124128
github.com/minio/crc64nvme v1.0.2 // indirect
125129
github.com/minio/minio-go/v7 v7.0.92 // indirect
126130
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect

go.sum

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,14 +464,25 @@ github.com/instill-ai/protogen-go v0.3.3-alpha.0.20250707160902-77023eb2f033 h1:
464464
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20250707160902-77023eb2f033/go.mod h1:bCnBosofpaUxKBuTTJM3/I3thAK37kvfBnKByjnLsl4=
465465
github.com/instill-ai/usage-client v0.4.0 h1:xf1hAlO4a8lZwZzz9bprZOJqU3ghIcIsavUUB7UURyg=
466466
github.com/instill-ai/usage-client v0.4.0/go.mod h1:zZ9LRoXps2u63ARYPAbR2YvqTib3dWJLObZn+9YqhF0=
467-
github.com/instill-ai/x v0.8.0-alpha.0.20250714023551-3829fd844cd5 h1:2iy0ssXScON7XgFLLR4NUSjYszpXfPbMUlmPNPXppzY=
468-
github.com/instill-ai/x v0.8.0-alpha.0.20250714023551-3829fd844cd5/go.mod h1:RXY1NPBMxe3K7bBecPALw+Af2dT+gJSb89BOlLIPfx4=
467+
github.com/instill-ai/x v0.9.0-alpha h1:J11sJNMe39GAQ69tPy7OWV/hBD39oyF+4wHB1fKiwvw=
468+
github.com/instill-ai/x v0.9.0-alpha/go.mod h1:vAzbuQ7HAWdQkkpDq9mvWjSXQEJZSgJhguN6NhpLTUk=
469469
github.com/itchyny/gojq v0.12.17 h1:8av8eGduDb5+rvEdaOO+zQUjA04MS0m3Ps8HiD+fceg=
470470
github.com/itchyny/gojq v0.12.17/go.mod h1:WBrEMkgAfAGO1LUcGOckBl5O726KPp+OlkKug0I/FEY=
471471
github.com/itchyny/timefmt-go v0.1.6 h1:ia3s54iciXDdzWzwaVKXZPbiXzxxnv1SPGFfM/myJ5Q=
472472
github.com/itchyny/timefmt-go v0.1.6/go.mod h1:RRDZYC5s9ErkjQvTvvU7keJjxUYzIISJGxm9/mAERQg=
473+
github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk=
474+
github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8=
475+
github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk=
476+
github.com/jackc/pgconn v1.14.3 h1:bVoTr12EGANZz66nZPkMInAV/KHD2TxH9npjXXgiB3w=
477+
github.com/jackc/pgconn v1.14.3/go.mod h1:RZbme4uasqzybK2RK5c65VsHxoyaml09lx3tXOcO/VM=
478+
github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE=
479+
github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8=
480+
github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc=
481+
github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak=
473482
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
474483
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
484+
github.com/jackc/pgproto3/v2 v2.3.3 h1:1HLSx5H+tXR9pW3in3zaztoEwQYRC9SQaYUHjTSUOag=
485+
github.com/jackc/pgproto3/v2 v2.3.3/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
475486
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
476487
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
477488
github.com/jackc/pgx/v5 v5.7.5 h1:JHGfMnQY+IEtGM63d+NGMjoRpysB2JBwDr5fsngwmJs=

0 commit comments

Comments
 (0)