OpenTelemetry SDK
    Preparing search index...

    Type Alias DeclarativeConfigReader<ConfigType>

    DeclarativeConfigReader: (
        own: ConfigPropertiesReader,
        general: ConfigPropertiesReader,
    ) => Partial<ConfigType>

    Maps declarative config onto an instrumentation's config fields. Called with two typed readers:

    • own: this instrumentation's own node, instrumentation/development.js.<name>.
    • general: the shared instrumentation/development.general node.

    Build the return value from the reader getters. Annotating the return type as Partial<MyConfig> is what type-checks the mapping: a getter whose type does not match the target field, or a field name that does not exist, fails to compile. A getter yields undefined for a missing, null or wrong-typed property, and those are pruned before merging, so an unset property keeps the instrumentation's current value.

    (own, general): Partial<MyConfig> => ({
    someField: own.getString('some_field'),
    captured: { headers: general.getStringArray('http.client.request_captured_headers') },
    })

    Type Parameters

    • ConfigType

    Type Declaration