Skip to content

InstrumentationConfig type

Home > @rimitive/core > InstrumentationConfig

Configuration for creating an instrumentation context.

Signature:

export type InstrumentationConfig = {
providers: InstrumentationProvider[];
enabled?: boolean | (() => boolean);
};

References: InstrumentationProvider

import { createInstrumentation, devtoolsProvider } from '@rimitive/core';
const instrumentation = createInstrumentation({
enabled: import.meta.env.DEV, // Only in development
providers: [devtoolsProvider({ debug: true })],
});

Dynamic enabled check

const instrumentation = createInstrumentation({
enabled: () => localStorage.getItem('debug') === 'true',
providers: [devtoolsProvider()],
});