Repository navigation
flags@4.6.0
Minor Changes
-
#625
26a0150Thanks @wbinnssmith! - AddsetLoggerProviderto emit OpenTelemetryfeature_flag.evaluationlog records for direct and bulk flag evaluations. Install@opentelemetry/api-logs, now an optional peer dependency, and pass aLoggerProvidertosetLoggerProviderfromflags.Each record includes
feature_flag.key, andfeature_flag.result.variantwhen the value matches exactly one labeled option. Failed evaluations includeerror.type: general. Flag values and evaluation context are not logged.
Patch Changes
-
#638
446a639Thanks @AndyBitz! - In Next.js, a flag which falls back to itsdefaultValuenow says so on its span. Theflagspan recordsmethod: fallbackinstead ofdecided. When the fallback follows an error thrown bydecide, the span also recordserror.type: generaland the status Error with the message of the error, while the flag still resolves to itsdefaultValue. WhenbulkDecidethrows, thebatchspan records the error the same way. Thefeature_flag.evaluationlog record of such a flag includeserror.type: generalandfeature_flag.result.reason: error.Before, these spans had the status Ok and looked like successful decisions, so a failing provider was only visible in the logs.
-
#624
c1dae52Thanks @wbinnssmith! -flagspans include the OpenTelemetry semantic convention attributefeature_flag.keynext tokey. When the evaluated value matches exactly one option that has a label, the span also includes that label asfeature_flag.result.variant. Flag values are not added to spans.batchspans of bulk evaluations keep their aggregate attributes only.