Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix observe actor events telemetry name #89

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions backend/bin/deal-observer-backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const pgPool = await createPgPool()
const { recordTelemetry } = createInflux(INFLUXDB_TOKEN)

const observeActorEventsLoop = async (makeRpcRequest, pgPool) => {
const LOOP_NAME = 'Observe actor events'
while (true) {
const start = Date.now()
try {
Expand All @@ -57,10 +56,10 @@ const observeActorEventsLoop = async (makeRpcRequest, pgPool) => {
Sentry.captureException(e)
}
const dt = Date.now() - start
console.log(`Loop "${LOOP_NAME}" took ${dt}ms`)
console.log(`Loop "Observe actor events" took ${dt}ms`)

if (INFLUXDB_TOKEN) {
recordTelemetry(`loop_${slug(LOOP_NAME, '_')}`, point => {
recordTelemetry('loop_builtin_actor_events', point => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing this to "loop_observe_actor_events" was unintentional, @NikolasHaimerl and me agreed that the LOOP_NAME is risky

point.intField('interval_ms', LOOP_INTERVAL)
point.intField('duration_ms', dt)
})
Expand All @@ -81,7 +80,6 @@ const observeActorEventsLoop = async (makeRpcRequest, pgPool) => {
* @param {number} args.sparkApiSubmitDealsBatchSize
*/
const sparkApiSubmitDealsLoop = async (pgPool, { sparkApiBaseUrl, sparkApiToken, sparkApiSubmitDealsBatchSize }) => {
const LOOP_NAME = 'Submit deals to spark-api'
while (true) {
const start = Date.now()
try {
Expand All @@ -103,10 +101,10 @@ const sparkApiSubmitDealsLoop = async (pgPool, { sparkApiBaseUrl, sparkApiToken,
Sentry.captureException(e)
}
const dt = Date.now() - start
console.log(`Loop "${LOOP_NAME}" took ${dt}ms`)
console.log(`Loop "Submit deals to spark-api" took ${dt}ms`)

if (INFLUXDB_TOKEN) {
recordTelemetry(`loop_${slug(LOOP_NAME, '_')}`, point => {
recordTelemetry('loop_submit_deals_to_sparkapi', point => {
point.intField('interval_ms', LOOP_INTERVAL)
point.intField('duration_ms', dt)
})
Expand All @@ -118,7 +116,6 @@ const sparkApiSubmitDealsLoop = async (pgPool, { sparkApiBaseUrl, sparkApiToken,
}

export const lookUpPayloadCidsLoop = async (makeRpcRequest, getDealPayloadCid, pgPool) => {
const LOOP_NAME = 'Look up payload CIDs'
while (true) {
const start = Date.now()
// Maximum number of deals to look up payload CIDs for in one loop iteration
Expand All @@ -130,11 +127,11 @@ export const lookUpPayloadCidsLoop = async (makeRpcRequest, getDealPayloadCid, p
Sentry.captureException(e)
}
const dt = Date.now() - start
console.log(`Loop "${LOOP_NAME}" took ${dt}ms`)
console.log(`Loop "Look up payload CIDs" took ${dt}ms`)

// For local monitoring and debugging, we can omit sending data to InfluxDB
if (INFLUXDB_TOKEN) {
recordTelemetry(`loop_${slug(LOOP_NAME, '_')}`, point => {
recordTelemetry('loop_look_up_payload_cids', point => {
point.intField('interval_ms', LOOP_INTERVAL)
point.intField('duration_ms', dt)
})
Expand Down
3 changes: 1 addition & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"multiformats": "^13.3.1",
"p-retry": "^6.2.1",
"pg": "^8.13.1",
"pg-cursor": "^2.12.1",
"slug": "^10.0.0"
"pg-cursor": "^2.12.1"
}
}
12 changes: 1 addition & 11 deletions package-lock.json

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

Loading