Skip to content

Commit ebad0df

Browse files
authored
chore: deflate APM data when sent over plain http(s) (#6575)
1 parent 8c36022 commit ebad0df

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/cubejs-server-core/src/core/agentCollect.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,11 @@ class HttpTransport implements AgentTransport {
124124
const result = await fetch(this.endpointUrl, {
125125
agent: this.agent,
126126
method: 'post',
127-
body: JSON.stringify(data),
128-
headers: { 'Content-Type': 'application/json' },
127+
body: await deflate(JSON.stringify(data)),
128+
headers: {
129+
'Content-Type': 'application/json',
130+
'Content-Encoding': 'deflate'
131+
},
129132
});
130133
return result.status === 200;
131134
}

0 commit comments

Comments
 (0)