
Product
Introducing Socket Scanning for OpenVSX Extensions
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.
@voiceflow/metrics
Advanced tools
Helpers for exposing server-side metrics
ClientClient.Metricsimport { Counter } from '@opentelemetry/api-metrics';
import * as VFMetrics from '@voiceflow/metrics';
import log from '@/logger';
import { Config } from '@/types';
export class Metrics extends VFMetrics.Client.Metrics {
protected counters: {
foo: {
bar: Counter;
};
};
constructor(config: Config) {
super({ ...config, SERVICE_NAME: 'example-service' });
super.once('ready', ({ port, path }: VFMetrics.Client.Events['ready']) => {
log.info(`[metrics] exporter ready ${log.vars({ port, path })}`);
});
this.counters = {
foo: {
bar: this.meter.createCounter('foo_bar', { description: 'Example description' }),
},
};
}
fooBar(): void {
this.counters.foo.bar.add(1);
}
}
const MetricsClient = (config: Config) => new Metrics(config);
export type MetricsType = Metrics;
export default MetricsClient;
TestingTesting.createBaseConfigimport * as VFMetrics from '@voiceflow/metrics';
const baseConfig = await VFMetrics.Testing.createBaseConfig();
Testing.MetricsAsserterimport * as VFMetrics from '@voiceflow/metrics';
import MetricsClient from '@/lib/clients/metrics';
const metricsAsserter = new VFMetrics.Testing.MetricsAsserter(MetricsClient);
describe('metrics client unit tests', () => {
it('fooBar', async () => {
const fixture = await metricsAsserter.assertMetric({ expected: /^foo_bar_total 1 \d+$/m });
fixture.metrics.fooBar();
await fixture.assert();
});
});
FAQs
Helpers for exposing server-side metrics
We found that @voiceflow/metrics demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 26 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.

Product
Bringing supply chain security to the next generation of JavaScript package managers

Product
A safer, faster way to eliminate vulnerabilities without updating dependencies