mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-22 08:40:03 +01:00
25cb653c1b
* team-manager: expire negative lookups after 5 minutes, improve docs * populateTeamDataStep: don't drop token, keep team_id from capture if present, report results * ingestEvent: run all analytic events through runLightweightCaptureEndpointEventPipeline * continue accepting events with no token but a team_id
16 lines
421 B
TypeScript
16 lines
421 B
TypeScript
import { register } from 'prom-client'
|
|
|
|
export function resetMetrics() {
|
|
register.resetMetrics()
|
|
}
|
|
|
|
export async function getMetricValues(metricName: string): Promise<any> {
|
|
const metrics = await register.getMetricsAsJSON()
|
|
for (const metric of metrics) {
|
|
if (metric.name === metricName) {
|
|
return (metric as any).values
|
|
}
|
|
}
|
|
throw Error(`Metric not found: ${metricName}`)
|
|
}
|