Skip to content

Commit

Permalink
fix: included telemetry service back into backend and connector
Browse files Browse the repository at this point in the history
  • Loading branch information
JoblersTune committed Jul 15, 2024
1 parent 2b4e753 commit 854de12
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
9 changes: 7 additions & 2 deletions packages/backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import { createIlpPaymentService } from './payment-method/ilp/service'
import { createSPSPRoutes } from './payment-method/ilp/spsp/routes'
import { createStreamCredentialsService } from './payment-method/ilp/stream-credentials/service'
import { createRatesService } from './rates/service'
import { createTelemetryService } from './telemetry/service'
import { TelemetryService, createTelemetryService } from './telemetry/service'
import { createWebhookService } from './webhook/service'

BigInt.prototype.toJSON = function () {
Expand Down Expand Up @@ -358,6 +358,10 @@ export function initIocContainer(

container.singleton('connectorApp', async (deps) => {
const config = await deps.use('config')
let telemetry: TelemetryService | undefined
if (config.enableTelemetry) {
telemetry = await deps.use('telemetry')
}
return await createConnectorService({
logger: await deps.use('logger'),
redis: await deps.use('redis'),
Expand All @@ -367,7 +371,8 @@ export function initIocContainer(
peerService: await deps.use('peerService'),
ratesService: await deps.use('ratesService'),
streamServer: await deps.use('streamServer'),
ilpAddress: config.ilpAddress
ilpAddress: config.ilpAddress,
telemetry
})
})

Expand Down
8 changes: 6 additions & 2 deletions packages/backend/src/payment-method/ilp/connector/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
createStreamAddressMiddleware,
createStreamController
} from './core'
import { TelemetryService } from '../../../telemetry/service'

interface ServiceDependencies extends BaseService {
redis: Redis
Expand All @@ -37,6 +38,7 @@ interface ServiceDependencies extends BaseService {
peerService: PeerService
streamServer: StreamServer
ilpAddress: string
telemetry?: TelemetryService
}

export async function createConnectorService({
Expand All @@ -48,7 +50,8 @@ export async function createConnectorService({
incomingPaymentService,
peerService,
streamServer,
ilpAddress
ilpAddress,
telemetry,
}: ServiceDependencies): Promise<Rafiki> {
return createApp(
{
Expand All @@ -62,7 +65,8 @@ export async function createConnectorService({
peers: peerService,
redis,
rates: ratesService,
streamServer
streamServer,
telemetry
},
compose([
// Incoming Rules
Expand Down

0 comments on commit 854de12

Please sign in to comment.