Skip to content

Commit

Permalink
Remove prom-client, prometheus metric collection and exporer's /metri…
Browse files Browse the repository at this point in the history
…cs endpoint
  • Loading branch information
AleksTeresh committed Nov 6, 2024
1 parent 555f7a6 commit 00b5144
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 55 deletions.
26 changes: 0 additions & 26 deletions importer-api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion importer-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"node-cron": "^3.0.1",
"node-nats-streaming": "^0.3.0",
"pg": "^8.12.0",
"prom-client": "^14.0.0",
"redis": "^3.1.1",
"winston": "^3.2.1",
"winston-gelf-transporter": "^1.0.2"
Expand Down
9 changes: 1 addition & 8 deletions importer-api/src/explorer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ const { IS_DEV } = require('../config')
const { logger } = require('../utils/logger')
const { del: redisDel } = require('../utils/redis')

const { prom } = require('../prom')

const { DB_USERNAME, DB_PASSWORD, DB_PORT, DB_HOST, DB_DATABASE } = process.env

const knex = require('knex')({
Expand All @@ -20,19 +18,14 @@ const knex = require('knex')({
password: DB_PASSWORD,
database: DB_DATABASE,
port: DB_PORT,
ssl: !IS_DEV ? { rejectUnauthorized: false } : false,
ssl: !IS_DEV ? { rejectUnauthorized: false } : false
},
pool: {
min: 0,
max: 5
}
})

app.get('/metrics', async (req, res) => {
res.setHeader('content-type', 'text/plain')
res.send(await prom.register.metrics())
})

app.use((req, res, next) => {
const { EXPLORER_TOKEN } = process.env

Expand Down
2 changes: 0 additions & 2 deletions importer-api/src/importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const { SONIC, IS_DEV, CURRENT_EXECUTION_HASH, UPDATE_RETRY_LIMIT } = require('.
const { sleep } = require('./utils')
const postUpdate = require('./utils/postUpdate')
const { logger } = require('./utils/logger')
const { errorCounter } = require('./prom')

const forbiddenServiceIds = []
let isImporting = false
Expand Down Expand Up @@ -58,7 +57,6 @@ const serviceUpdateFun = serviceId => {
} catch (err) {
logger.error({ message: err.message, meta: err.stack })
logger.error({ message: 'Importing failed', meta: err.stack })
errorCounter.inc({ service: serviceId })

if (resourceWasForbidden(serviceId, err)) return
if (attempt > UPDATE_RETRY_LIMIT) return
Expand Down
15 changes: 0 additions & 15 deletions importer-api/src/prom.js

This file was deleted.

3 changes: 0 additions & 3 deletions importer-api/src/scheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ const { FETCH_AMOUNT, MAX_CHUNK_SIZE, APIS, PANIC_TIMEOUT } = require('./config'
const { logger } = require('./utils/logger')
const chunkify = require('./utils/chunkify')

const { successCounter } = require('./prom')

const API_MAPPING = {
[APIS.ori]: oriRequest,
[APIS.kori]: koriRequest,
Expand Down Expand Up @@ -91,7 +89,6 @@ const initializeStatusChannel = (channel, ordinalKey, executionHash, handleFinis
total: amountScheduled,
serviceId
})
successCounter.inc({ service: serviceId }, amount)
}
if (result === Number(amountScheduled)) {
handleFinish()
Expand Down

0 comments on commit 00b5144

Please sign in to comment.