quoting-service 17.7.1 → 17.7.2-trace.0

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.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "quoting-service",
3
3
  "description": "Quoting Service hosted by a scheme",
4
4
  "license": "Apache-2.0",
5
- "version": "17.7.1",
5
+ "version": "17.7.2-trace.0",
6
6
  "author": "ModusBox",
7
7
  "contributors": [
8
8
  "Georgi Georgiev <georgi.georgiev@modusbox.com>",
@@ -112,15 +112,15 @@
112
112
  "@hapi/vision": "7.0.3",
113
113
  "@mojaloop/central-services-error-handling": "13.0.7",
114
114
  "@mojaloop/central-services-health": "15.0.4",
115
- "@mojaloop/central-services-logger": "11.8.0",
115
+ "@mojaloop/central-services-logger": "11.8.1",
116
116
  "@mojaloop/central-services-metrics": "12.5.0",
117
- "@mojaloop/central-services-shared": "18.23.1",
117
+ "@mojaloop/central-services-shared": "18.23.2",
118
118
  "@mojaloop/central-services-stream": "11.5.2",
119
119
  "@mojaloop/event-sdk": "14.4.0",
120
- "@mojaloop/inter-scheme-proxy-cache-lib": "2.4.0",
120
+ "@mojaloop/inter-scheme-proxy-cache-lib": "2.5.0",
121
121
  "@mojaloop/ml-number": "11.2.7",
122
- "@mojaloop/ml-schema-transformer-lib": "2.7.0",
123
- "@mojaloop/sdk-standard-components": "19.11.2",
122
+ "@mojaloop/ml-schema-transformer-lib": "2.7.1",
123
+ "@mojaloop/sdk-standard-components": "19.11.3",
124
124
  "ajv": "8.17.1",
125
125
  "ajv-keywords": "5.1.0",
126
126
  "axios": "1.8.4",
@@ -31,6 +31,7 @@ const { reformatFSPIOPError } = require('@mojaloop/central-services-error-handli
31
31
  const { ErrorMessages } = require('../lib/enum')
32
32
  const { getSpanTags } = require('../lib/util')
33
33
  const dto = require('../lib/dto')
34
+ const { otel } = require('@mojaloop/central-services-stream/src/kafka')
34
35
 
35
36
  const { FSPIOP } = Enum.Http.Headers
36
37
 
@@ -45,6 +46,12 @@ class QuotingHandler {
45
46
  this.payloadCache = deps.payloadCache
46
47
  this.tracer = deps.tracer
47
48
  this.handleMessages = this.handleMessages.bind(this)
49
+ this.configByTopic = Object.values(this.config.kafkaConfig.CONSUMER).reduce((acc, value) =>
50
+ Object.values(value).reduce((acc, { topic, config }) => {
51
+ acc[topic] = config
52
+ return acc
53
+ }, acc),
54
+ {})
48
55
  }
49
56
 
50
57
  async handleMessages(error, messages) {
@@ -54,7 +61,12 @@ class QuotingHandler {
54
61
  }
55
62
 
56
63
  await Promise.allSettled(
57
- messages.map(msg => this.defineHandlerByTopic(msg))
64
+ messages.map(msg => messages.length > 1
65
+ ? otel
66
+ .startConsumerTracingSpan(msg, this.configByTopic[msg.topic])
67
+ .executeInsideSpanContext(() => this.defineHandlerByTopic(msg))
68
+ : this.defineHandlerByTopic(msg)
69
+ )
58
70
  )
59
71
  this.logger.info('handleMessages is done')
60
72