Skip to content

Commit

Permalink
#fix: vector healthcheck fix (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
akvlad committed Nov 8, 2023
1 parent f860c0b commit 96e64c8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 32 deletions.
30 changes: 14 additions & 16 deletions qryn_bun.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -240,22 +240,20 @@ export default async() => {
fastify.get('/prometheus/api/v1/rules', handlerPromGetRules)

/* PROMETHEUS REMOTE WRITE Handlers */

fastify.post('/api/v1/prom/remote/write', promWriteHandler, {
'application/x-protobuf': prometheusPushProtoParser,
'application/json': jsonParser,
'*': combinedParser(prometheusPushProtoParser, jsonParser)
})
fastify.post('/api/prom/remote/write', promWriteHandler, {
'application/x-protobuf': prometheusPushProtoParser,
'application/json': jsonParser,
'*': combinedParser(prometheusPushProtoParser, jsonParser)
})
fastify.post('/prom/remote/write', promWriteHandler, {
'application/x-protobuf': prometheusPushProtoParser,
'application/json': jsonParser,
'*': combinedParser(prometheusPushProtoParser, jsonParser)
})
const remoteWritePaths = [
'/api/v1/prom/remote/write',
'/api/prom/remote/write',
'/prom/remote/write',
'/api/v1/write'
]
for (const path of remoteWritePaths) {
fastify.post(path, promWriteHandler, {
'application/x-protobuf': prometheusPushProtoParser,
'application/json': jsonParser,
'*': combinedParser(prometheusPushProtoParser, jsonParser)
})
fastify.get(path, handlerTempoEcho)
}

/* PROMQETHEUS API EMULATION */

Expand Down
32 changes: 16 additions & 16 deletions qryn_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ let fastify = require('fastify')({
'/api/v1/prom/remote/write',
'/api/prom/remote/write',
'/prom/remote/write',
'/loki/api/v1/push'
'/loki/api/v1/push',
'/api/v1/write'
]
fastify.addHook('preParsing', (request, reply, payload, done) => {
if (snappyPaths.indexOf(request.routerPath) !== -1) {
Expand Down Expand Up @@ -355,21 +356,20 @@ let fastify = require('fastify')({

/* PROMETHEUS REMOTE WRITE Handlers */
const promWriteHandler = require('./lib/handlers/prom_push.js').bind(this)
fastify.post('/api/v1/prom/remote/write', promWriteHandler, {
'application/x-protobuf': prometheusPushProtoParser,
'application/json': jsonParser,
'*': combinedParser(prometheusPushProtoParser, jsonParser)
})
fastify.post('/api/prom/remote/write', promWriteHandler, {
'application/x-protobuf': prometheusPushProtoParser,
'application/json': jsonParser,
'*': combinedParser(prometheusPushProtoParser, jsonParser)
})
fastify.post('/prom/remote/write', promWriteHandler, {
'application/x-protobuf': prometheusPushProtoParser,
'application/json': jsonParser,
'*': combinedParser(prometheusPushProtoParser, jsonParser)
})
const remoteWritePaths = [
'/api/v1/prom/remote/write',
'/api/prom/remote/write',
'/prom/remote/write',
'/api/v1/write'
]
for (const path of remoteWritePaths) {
fastify.post(path, promWriteHandler, {
'application/x-protobuf': prometheusPushProtoParser,
'application/json': jsonParser,
'*': combinedParser(prometheusPushProtoParser, jsonParser)
})
fastify.get(path, handlerTempoEcho)
}

/* PROMQETHEUS API EMULATION */
const handlerPromQueryRange = require('./lib/handlers/prom_query_range.js').bind(this)
Expand Down

0 comments on commit 96e64c8

Please sign in to comment.