Skip to content

Commit 712dd97

Browse files
committed
Merge branch 'main' into 4238-express-v5
2 parents 1e3a675 + 57bb301 commit 712dd97

File tree

11 files changed

+148
-214
lines changed

11 files changed

+148
-214
lines changed

.ci/docker/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ services:
7474
retries: 30
7575

7676
elasticsearch:
77-
image: docker.elastic.co/elasticsearch/elasticsearch:8.7.1
77+
image: docker.elastic.co/elasticsearch/elasticsearch:9.0.0
7878
environment:
7979
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
8080
- "network.host=_site_"

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
6464
- name: Build and Push Docker Image
6565
id: docker-push
66-
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
66+
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6.16.0
6767
with:
6868
context: .
6969
platforms: linux/amd64,linux/arm64
@@ -97,7 +97,7 @@ jobs:
9797
9898
- name: Build and Push Docker Image (wolfi)
9999
id: docker-push-wolfi
100-
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
100+
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6.16.0
101101
with:
102102
context: .
103103
platforms: linux/amd64,linux/arm64

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
- nodemssqldata:/var/opt/mssql
105105

106106
elasticsearch:
107-
image: docker.elastic.co/elasticsearch/elasticsearch:8.7.1
107+
image: docker.elastic.co/elasticsearch/elasticsearch:9.0.0
108108
env:
109109
ES_JAVA_OPTS: '-Xms512m -Xmx512m'
110110
network.host: '_site_'

.tav.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,18 +276,32 @@ elasticsearch:
276276
# semver (and TAV) consider "-patch.N" to be a *prereleases*. This
277277
# leads to some tortured "versions:" ranges below.
278278
# - Version 8.11.0 dropped node v14 and v16 support.
279+
# - Version 9 dropped v18 support (effectively by using undici@7).
279280
'@elastic/elasticsearch':
280-
- versions: '>=7.0.0 <7.7.0 || >7.7.0 <7.12.0'
281+
- versions:
282+
mode: max-3
283+
include: '>=7.0.0 <7.7.0 || >7.7.0 <7.12.0'
281284
commands: node test/instrumentation/modules/@elastic/elasticsearch.test.js
282-
- versions: '>=7.12.0 <8.2'
285+
- versions:
286+
mode: max-3
287+
include: '>=7.12.0 <8.2'
283288
node: '>=12.0.0'
284289
commands: node test/instrumentation/modules/@elastic/elasticsearch.test.js
285-
- versions: '>=8.2.0-patch.1 <8.2.0 || >8.2.0 <8.11.0'
290+
- versions:
291+
mode: max-3
292+
include: '>8.2.0 <8.11.0'
286293
node: '>=14.0.0'
287294
commands: node test/instrumentation/modules/@elastic/elasticsearch.test.js
288-
- versions: '>=8.11.0'
295+
- versions:
296+
mode: max-5
297+
include: '>=8.11.0 <9.0.0'
289298
node: '>=18.0.0'
290299
commands: node test/instrumentation/modules/@elastic/elasticsearch.test.js
300+
- versions:
301+
mode: max-5
302+
include: '>=9.0.0 <10'
303+
node: '>=20.0.0'
304+
commands: node test/instrumentation/modules/@elastic/elasticsearch.test.js
291305

292306
handlebars:
293307
versions:

Dockerfile.wolfi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
FROM docker.elastic.co/wolfi/chainguard-base:latest@sha256:5ffa55ac0a7ec95f1232622f62d5c0953ca931ae64cfd9946629b0e408a85d0e
1+
FROM docker.elastic.co/wolfi/chainguard-base:latest@sha256:67d82bc56a9c34572abe331c14f5e4b23a284d94a5bc1ea3be64f991ced51892
22
ARG AGENT_DIR
33
COPY ${AGENT_DIR} /opt/nodejs

examples/trace-elasticsearch8.js renamed to examples/trace-elasticsearch.js

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,20 @@
66
* compliance with the BSD 2-Clause License.
77
*/
88

9-
// A small example showing Elastic APM tracing @elastic/elasticsearch version 8.
9+
// A small example showing Elastic APM tracing @elastic/elasticsearch.
1010
//
1111
// This assumes an Elasticsearch running on localhost. You can use:
1212
// npm run docker:start elasticsearch
1313
// to start an Elasticsearch docker container. Then the following to stop:
1414
// npm run docker:stop
1515

1616
const apm = require('../').start({
17-
serviceName: 'example-trace-elasticsearch8',
17+
serviceName: 'example-trace-elasticsearch',
1818
});
1919

20-
// eslint-disable-next-line no-unused-vars
21-
const { Client, HttpConnection } = require('@elastic/elasticsearch');
20+
const { Client } = require('@elastic/elasticsearch');
2221

2322
const client = new Client({
24-
// By default version 8 uses the new undici HTTP client lib. You can specify
25-
// `HttpConnection` to use the older HTTP client.
26-
// Connection: HttpConnection,
27-
2823
node: process.env.ES_URL || 'http://localhost:9200',
2924
auth: {
3025
username: process.env.ES_USERNAME || undefined,
@@ -33,7 +28,7 @@ const client = new Client({
3328
maxRetries: 1,
3429
});
3530

36-
async function run() {
31+
async function main() {
3732
// For tracing spans to be created, there must be an active transaction.
3833
// Typically, a transaction is automatically started for incoming HTTP
3934
// requests to a Node.js server. However, because this script is not running
@@ -75,25 +70,23 @@ async function run() {
7570
t2.end();
7671
});
7772

78-
// Example aborting requests using AbortController (node v15 and above).
79-
if (global.AbortController) {
80-
const t3 = apm.startTransaction('t3');
81-
const ac = new AbortController(); // eslint-disable-line no-undef
82-
setImmediate(() => {
83-
ac.abort();
84-
});
85-
try {
86-
const res = await client.search(
87-
{ query: { match_all: {} } },
88-
{ signal: ac.signal },
89-
);
90-
console.log('[example 3] search response:', res);
91-
} catch (err) {
92-
console.log('[example 3] search error:', err);
93-
} finally {
94-
t3.end();
95-
}
73+
// Example aborting requests using AbortController.
74+
const t3 = apm.startTransaction('t3');
75+
const ac = new AbortController(); // eslint-disable-line no-undef
76+
setImmediate(() => {
77+
ac.abort();
78+
});
79+
try {
80+
const res = await client.search(
81+
{ query: { match_all: {} } },
82+
{ signal: ac.signal },
83+
);
84+
console.log('[example 3] search response:', res);
85+
} catch (err) {
86+
console.log('[example 3] search error:', err);
87+
} finally {
88+
t3.end();
9689
}
9790
}
9891

99-
run();
92+
main();

examples/trace-elasticsearch7.js

Lines changed: 0 additions & 85 deletions
This file was deleted.

0 commit comments

Comments
 (0)