Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 31 additions & 31 deletions src/cloudflare/internal/test/d1/d1-api-instrumentation-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,6 @@ export const test = {
};

const expectedSpans = [
{
name: 'fetch',
'network.protocol.name': 'http',
'network.protocol.version': 'HTTP/1.1',
'http.request.method': 'POST',
'url.full': 'http://d1/execute?resultsFormat=NONE',
'http.request.header.content-type': 'application/json',
'http.request.body.size': 231n,
'http.response.status_code': 200n,
'http.response.body.size': 0n,
closed: true,
},
{
name: 'd1_run',
'db.system.name': 'cloudflare-d1',
Expand Down Expand Up @@ -70,9 +58,9 @@ const expectedSpans = [
'network.protocol.name': 'http',
'network.protocol.version': 'HTTP/1.1',
'http.request.method': 'POST',
'url.full': 'http://d1/query?resultsFormat=ROWS_AND_COLUMNS',
'url.full': 'http://d1/execute?resultsFormat=NONE',
'http.request.header.content-type': 'application/json',
'http.request.body.size': 42n,
'http.request.body.size': 231n,
'http.response.status_code': 200n,
'http.response.body.size': 0n,
closed: true,
Expand All @@ -96,7 +84,7 @@ const expectedSpans = [
'network.protocol.name': 'http',
'network.protocol.version': 'HTTP/1.1',
'http.request.method': 'POST',
'url.full': 'http://d1/execute?resultsFormat=NONE',
'url.full': 'http://d1/query?resultsFormat=ROWS_AND_COLUMNS',
'http.request.header.content-type': 'application/json',
'http.request.body.size': 42n,
'http.response.status_code': 200n,
Expand Down Expand Up @@ -124,7 +112,7 @@ const expectedSpans = [
'http.request.method': 'POST',
'url.full': 'http://d1/execute?resultsFormat=NONE',
'http.request.header.content-type': 'application/json',
'http.request.body.size': 40n,
'http.request.body.size': 42n,
'http.response.status_code': 200n,
'http.response.body.size': 0n,
closed: true,
Expand All @@ -148,9 +136,9 @@ const expectedSpans = [
'network.protocol.name': 'http',
'network.protocol.version': 'HTTP/1.1',
'http.request.method': 'POST',
'url.full': 'http://d1/query?resultsFormat=ROWS_AND_COLUMNS',
'url.full': 'http://d1/execute?resultsFormat=NONE',
'http.request.header.content-type': 'application/json',
'http.request.body.size': 223n,
'http.request.body.size': 40n,
'http.response.status_code': 200n,
'http.response.body.size': 0n,
closed: true,
Expand Down Expand Up @@ -180,9 +168,9 @@ const expectedSpans = [
'network.protocol.name': 'http',
'network.protocol.version': 'HTTP/1.1',
'http.request.method': 'POST',
'url.full': 'http://d1/execute?resultsFormat=NONE',
'url.full': 'http://d1/query?resultsFormat=ROWS_AND_COLUMNS',
'http.request.header.content-type': 'application/json',
'http.request.body.size': 40n,
'http.request.body.size': 223n,
'http.response.status_code': 200n,
'http.response.body.size': 0n,
closed: true,
Expand All @@ -208,7 +196,7 @@ const expectedSpans = [
'http.request.method': 'POST',
'url.full': 'http://d1/execute?resultsFormat=NONE',
'http.request.header.content-type': 'application/json',
'http.request.body.size': 223n,
'http.request.body.size': 40n,
'http.response.status_code': 200n,
'http.response.body.size': 0n,
closed: true,
Expand Down Expand Up @@ -238,9 +226,9 @@ const expectedSpans = [
'network.protocol.name': 'http',
'network.protocol.version': 'HTTP/1.1',
'http.request.method': 'POST',
'url.full': 'http://d1/query?resultsFormat=ROWS_AND_COLUMNS',
'url.full': 'http://d1/execute?resultsFormat=NONE',
'http.request.header.content-type': 'application/json',
'http.request.body.size': 31n,
'http.request.body.size': 223n,
'http.response.status_code': 200n,
'http.response.body.size': 0n,
closed: true,
Expand Down Expand Up @@ -344,7 +332,7 @@ const expectedSpans = [
'http.request.method': 'POST',
'url.full': 'http://d1/query?resultsFormat=ROWS_AND_COLUMNS',
'http.request.header.content-type': 'application/json',
'http.request.body.size': 42n,
'http.request.body.size': 31n,
'http.response.status_code': 200n,
'http.response.body.size': 0n,
closed: true,
Expand Down Expand Up @@ -448,7 +436,7 @@ const expectedSpans = [
'http.request.method': 'POST',
'url.full': 'http://d1/query?resultsFormat=ROWS_AND_COLUMNS',
'http.request.header.content-type': 'application/json',
'http.request.body.size': 61n,
'http.request.body.size': 42n,
'http.response.status_code': 200n,
'http.response.body.size': 0n,
closed: true,
Expand Down Expand Up @@ -656,7 +644,7 @@ const expectedSpans = [
'http.request.method': 'POST',
'url.full': 'http://d1/query?resultsFormat=ROWS_AND_COLUMNS',
'http.request.header.content-type': 'application/json',
'http.request.body.size': 125n,
'http.request.body.size': 61n,
'http.response.status_code': 200n,
'http.response.body.size': 0n,
closed: true,
Expand Down Expand Up @@ -685,7 +673,7 @@ const expectedSpans = [
'http.request.method': 'POST',
'url.full': 'http://d1/query?resultsFormat=ROWS_AND_COLUMNS',
'http.request.header.content-type': 'application/json',
'http.request.body.size': 79n,
'http.request.body.size': 125n,
'http.response.status_code': 200n,
'http.response.body.size': 0n,
closed: true,
Expand Down Expand Up @@ -815,7 +803,7 @@ const expectedSpans = [
'http.request.method': 'POST',
'url.full': 'http://d1/query?resultsFormat=ROWS_AND_COLUMNS',
'http.request.header.content-type': 'application/json',
'http.request.body.size': 298n,
'http.request.body.size': 79n,
'http.response.status_code': 200n,
'http.response.body.size': 0n,
closed: true,
Expand Down Expand Up @@ -846,7 +834,7 @@ const expectedSpans = [
'http.request.method': 'POST',
'url.full': 'http://d1/query?resultsFormat=ROWS_AND_COLUMNS',
'http.request.header.content-type': 'application/json',
'http.request.body.size': 45n,
'http.request.body.size': 298n,
'http.response.status_code': 200n,
'http.response.body.size': 0n,
closed: true,
Expand Down Expand Up @@ -950,7 +938,7 @@ const expectedSpans = [
'http.request.method': 'POST',
'url.full': 'http://d1/query?resultsFormat=ROWS_AND_COLUMNS',
'http.request.header.content-type': 'application/json',
'http.request.body.size': 76n,
'http.request.body.size': 45n,
'http.response.status_code': 200n,
'http.response.body.size': 0n,
closed: true,
Expand All @@ -976,7 +964,7 @@ const expectedSpans = [
'http.request.method': 'POST',
'url.full': 'http://d1/query?resultsFormat=ROWS_AND_COLUMNS',
'http.request.header.content-type': 'application/json',
'http.request.body.size': 117n,
'http.request.body.size': 76n,
'http.response.status_code': 200n,
'http.response.body.size': 0n,
closed: true,
Expand All @@ -996,4 +984,16 @@ const expectedSpans = [
'cloudflare.d1.response.changes': 0,
closed: true,
},
{
name: 'fetch',
'network.protocol.name': 'http',
'network.protocol.version': 'HTTP/1.1',
'http.request.method': 'POST',
'url.full': 'http://d1/query?resultsFormat=ROWS_AND_COLUMNS',
'http.request.header.content-type': 'application/json',
'http.request.body.size': 117n,
'http.response.status_code': 200n,
'http.response.body.size': 0n,
closed: true,
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ const expectedSpans = [
'network.protocol.version': 'HTTP/1.1',
'http.request.method': 'POST',
'url.full': 'https://js.images.cloudflare.com/transform',
'cloudflare.binding.type': 'Images',
'cloudflare.images.options.format': 'image/avif',
'http.request.header.content-type':
'multipart/form-data; boundary=<dynamic>',
'http.response.status_code': 200n,
Expand All @@ -96,6 +98,8 @@ const expectedSpans = [
'network.protocol.version': 'HTTP/1.1',
'http.request.method': 'POST',
'url.full': 'https://js.images.cloudflare.com/transform',
'cloudflare.binding.type': 'Images',
'cloudflare.images.options.format': 'image/avif',
'http.request.header.content-type':
'multipart/form-data; boundary=<dynamic>',
'http.response.status_code': 200n,
Expand All @@ -108,6 +112,9 @@ const expectedSpans = [
'network.protocol.version': 'HTTP/1.1',
'http.request.method': 'POST',
'url.full': 'https://js.images.cloudflare.com/transform',
'cloudflare.binding.type': 'Images',
'cloudflare.images.options.format': 'image/avif',
'cloudflare.images.options.transforms': '[{"imageIndex":0,"rotate":90}]',
'http.request.header.content-type':
'multipart/form-data; boundary=<dynamic>',
'http.response.status_code': 200n,
Expand All @@ -120,6 +127,9 @@ const expectedSpans = [
'network.protocol.version': 'HTTP/1.1',
'http.request.method': 'POST',
'url.full': 'https://js.images.cloudflare.com/transform',
'cloudflare.binding.type': 'Images',
'cloudflare.images.options.format': 'image/avif',
'cloudflare.images.options.transforms': '[{"imageIndex":0,"rotate":90}]',
'http.request.header.content-type':
'multipart/form-data; boundary=<dynamic>',
'http.response.status_code': 200n,
Expand All @@ -132,6 +142,8 @@ const expectedSpans = [
'network.protocol.version': 'HTTP/1.1',
'http.request.method': 'POST',
'url.full': 'https://js.images.cloudflare.com/transform',
'cloudflare.binding.type': 'Images',
'cloudflare.images.options.format': 'image/avif',
'http.request.header.content-type':
'multipart/form-data; boundary=<dynamic>',
'http.response.status_code': 200n,
Expand All @@ -144,49 +156,87 @@ const expectedSpans = [
'network.protocol.version': 'HTTP/1.1',
'http.request.method': 'POST',
'url.full': 'https://js.images.cloudflare.com/transform',
'cloudflare.binding.type': 'Images',
'cloudflare.images.options.format': 'image/avif',
'http.request.header.content-type':
'multipart/form-data; boundary=<dynamic>',
'http.response.status_code': 200n,
'http.response.body.size': 63n,
closed: true,
},
{
name: 'images_info',
name: 'fetch',
'network.protocol.name': 'http',
'network.protocol.version': 'HTTP/1.1',
'http.request.method': 'POST',
'url.full': 'https://js.images.cloudflare.com/info',
'cloudflare.binding.type': 'Images',
'cloudflare.images.options.encoding': 'base64',
'cloudflare.images.result.format': 'image/png',
'cloudflare.images.result.file_size': 123,
'cloudflare.images.result.width': 123,
'cloudflare.images.result.format': 'image/png',
'cloudflare.images.result.height': 123,
'cloudflare.images.result.width': 123,
'http.request.header.content-type':
'multipart/form-data; boundary=<dynamic>',
'http.response.status_code': 200n,
'http.response.body.size': 63n,
closed: true,
},
{
name: 'images_info',
name: 'fetch',
'network.protocol.name': 'http',
'network.protocol.version': 'HTTP/1.1',
'http.request.method': 'POST',
'url.full': 'https://js.images.cloudflare.com/info',
'cloudflare.binding.type': 'Images',
'cloudflare.images.options.encoding': 'base64',
'cloudflare.images.result.format': 'image/png',
'cloudflare.images.result.file_size': 123,
'cloudflare.images.result.width': 123,
'cloudflare.images.result.format': 'image/png',
'cloudflare.images.result.height': 123,
'cloudflare.images.result.width': 123,
'http.request.header.content-type':
'multipart/form-data; boundary=<dynamic>',
'http.response.status_code': 200n,
'http.response.body.size': 63n,
closed: true,
},
{
name: 'images_info',
name: 'fetch',
'network.protocol.name': 'http',
'network.protocol.version': 'HTTP/1.1',
'http.request.method': 'POST',
'url.full': 'https://js.images.cloudflare.com/info',
'cloudflare.binding.type': 'Images',
'cloudflare.images.options.encoding': 'base64',
'cloudflare.images.error.code': '123',
'cloudflare.images.options.encoding': 'base64',
'error.type': 'ERROR 123: Bad request',
'http.request.header.content-type':
'multipart/form-data; boundary=<dynamic>',
'http.response.status_code': 409n,
'http.response.body.size': 22n,
closed: true,
},
{
name: 'images_info',
name: 'fetch',
'cloudflare.binding.type': 'Images',
'cloudflare.images.options.encoding': 'base64',
'cloudflare.images.result.format': 'image/svg+xml',
'http.request.header.content-type':
'multipart/form-data; boundary=<dynamic>',
'http.request.method': 'POST',
'http.response.body.size': 26n,
'http.response.status_code': 200n,
'network.protocol.name': 'http',
'network.protocol.version': 'HTTP/1.1',
'url.full': 'https://js.images.cloudflare.com/info',
closed: true,
},
{
name: 'fetch',
'cloudflare.binding.type': 'Images',
'cloudflare.images.options.format': 'image/avif',
'cloudflare.images.options.transforms':
'[{"imageIndex":0,"rotate":90},{"imageIndex":1,"rotate":180},{"drawImageIndex":1,"targetImageIndex":0},{"drawImageIndex":3,"targetImageIndex":2},{"imageIndex":2,"rotate":270},{"drawImageIndex":2,"targetImageIndex":0},{"drawImageIndex":4,"targetImageIndex":0}]',
'network.protocol.name': 'http',
'network.protocol.version': 'HTTP/1.1',
'http.request.method': 'POST',
Expand All @@ -199,6 +249,10 @@ const expectedSpans = [
},
{
name: 'fetch',
'cloudflare.binding.type': 'Images',
'cloudflare.images.options.anim': true,
'cloudflare.images.options.format': 'image/avif',
'cloudflare.images.options.transforms': '[{"imageIndex":0,"rotate":90}]',
'network.protocol.name': 'http',
'network.protocol.version': 'HTTP/1.1',
'http.request.method': 'POST',
Expand All @@ -210,16 +264,25 @@ const expectedSpans = [
closed: true,
},
{
name: 'images_output',
name: 'fetch',
'network.protocol.name': 'http',
'network.protocol.version': 'HTTP/1.1',
'http.request.method': 'POST',
'url.full': 'https://js.images.cloudflare.com/transform',
'cloudflare.binding.type': 'Images',
'cloudflare.images.options.transforms': '[{"imageIndex":0,"rotate":90}]',
'cloudflare.images.options.format': 'image/avif',
'cloudflare.images.error.code': '123',
'cloudflare.images.options.format': 'image/avif',
'cloudflare.images.options.transforms': '[{"imageIndex":0,"rotate":90}]',
'error.type': 'ERROR 123: Bad request',
'http.request.header.content-type':
'multipart/form-data; boundary=<dynamic>',
'http.response.status_code': 409n,
'http.response.body.size': 22n,
closed: true,
},
{
name: 'fetch',
name: 'images_output',
'cloudflare.binding.type': 'Images',
'network.protocol.name': 'http',
'network.protocol.version': 'HTTP/1.1',
'http.request.method': 'POST',
Expand All @@ -232,6 +295,7 @@ const expectedSpans = [
},
{
name: 'fetch',
'cloudflare.binding.type': 'Images',
'network.protocol.name': 'http',
'network.protocol.version': 'HTTP/1.1',
'http.request.method': 'POST',
Expand Down
Loading
Loading