Skip to content

Commit

Permalink
Merge pull request #333 from near/main
Browse files Browse the repository at this point in the history
Prod Release 26/10/23
  • Loading branch information
morgsmccauley authored Oct 26, 2023
2 parents 0a97885 + 0c9fa36 commit 5b97cd3
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
labels: 'bug'
assignees: ''

---
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/close-completed-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Issue States'

on:
project_card:
types: [created, edited, moved]

permissions:
repository-projects: read
issues: write
pull-requests: write

jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/issue-states@v3
with:
github-token: ${{ github.token }}
open-issue-columns: ''
closed-issue-columns: 'Closed, Done'
log-output: false
2 changes: 1 addition & 1 deletion runner/src/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const UNPROCESSED_STREAM_MESSAGES = new promClient.Gauge({
labelNames: ['indexer', 'type'],
});

const EXECUTION_DURATION = new promClient.Gauge({
const EXECUTION_DURATION = new promClient.Histogram({
name: 'queryapi_runner_execution_duration_milliseconds',
help: 'Time taken to execute an indexer function',
labelNames: ['indexer', 'type'],
Expand Down
6 changes: 5 additions & 1 deletion runner/src/stream-handler/stream-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Worker, isMainThread } from 'worker_threads';

import { type Message } from './types';
import { METRICS } from '../metrics';
import { Gauge } from 'prom-client';
import { Gauge, Histogram } from 'prom-client';

export default class StreamHandler {
private readonly worker?: Worker;
Expand Down Expand Up @@ -36,5 +36,9 @@ export default class StreamHandler {
if (METRICS[message.type] instanceof Gauge) {
(METRICS[message.type] as Gauge).labels(message.labels).set(message.value);
}

if (METRICS[message.type] instanceof Histogram) {
(METRICS[message.type] as Histogram).labels(message.labels).observe(message.value);
}
}
}

0 comments on commit 5b97cd3

Please sign in to comment.