@platformatic/telemetry 2.30.1-alpha.0 → 2.30.1-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -284,8 +284,12 @@ function setupTelemetry (opts, logger) {
284
284
  })
285
285
 
286
286
  const httpCacheId = response.headers?.['x-plt-http-cache-id']
287
+ const isCacheHit = response.headers?.age !== undefined
287
288
  if (httpCacheId) {
288
- span.setAttributes({ 'http.cache.id': httpCacheId })
289
+ span.setAttributes({
290
+ 'http.cache.id': httpCacheId,
291
+ 'http.cache.hit': isCacheHit.toString()
292
+ })
289
293
  }
290
294
 
291
295
  span.setStatus(spanStatus)
@@ -95,8 +95,12 @@ const createTelemetryThreadInterceptorHooks = () => {
95
95
  })
96
96
 
97
97
  const httpCacheId = res.headers?.['x-plt-http-cache-id']
98
+ const isCacheHit = res.headers?.age !== undefined
98
99
  if (httpCacheId) {
99
- span.setAttributes({ 'http.cache.id': httpCacheId })
100
+ span.setAttributes({
101
+ 'http.cache.id': httpCacheId,
102
+ 'http.cache.hit': isCacheHit.toString()
103
+ })
100
104
  }
101
105
 
102
106
  span.setStatus(spanStatus)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/telemetry",
3
- "version": "2.30.1-alpha.0",
3
+ "version": "2.30.1-alpha.1",
4
4
  "description": "OpenTelemetry integration for Platformatic",
5
5
  "main": "index.js",
6
6
  "author": "Platformatic Inc. <oss@platformatic.dev> (https://platformatic.dev)",