From ab04e7a80b3aa7d669786d469ba256d009a195e6 Mon Sep 17 00:00:00 2001 From: James Sumners Date: Wed, 31 Jan 2024 14:21:10 -0500 Subject: [PATCH] feat: Add feature flag for LangChain instrumentation (#1990) --- documentation/feature-flags.md | 6 ++++++ lib/feature_flags.js | 3 ++- test/unit/feature_flag.test.js | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/documentation/feature-flags.md b/documentation/feature-flags.md index 099b36bcd..c5b6f99f7 100644 --- a/documentation/feature-flags.md +++ b/documentation/feature-flags.md @@ -44,3 +44,9 @@ Any prerelease flags can be enabled or disabled in your agent config by adding a * Configuration: `{ feature_flag: { aws_bedrock_instrumentation: true|false }}` * Environment Variable: `NEW_RELIC_FEATURE_FLAG_AWS_BEDROCK_INSTRUMENTATION` * Description: Enables instrumentation of AWS Bedrock in `aws-sdk@3`. + +#### langchain_instrumentation +* Enabled by default: `false` +* Configuration: `{ feature_flag: { langchain_instrumentation: true|false }}` +* Environment Variable: `NEW_RELIC_FEATURE_FLAG_LANGCHAIN_INSTRUMENTATION` +* Description: Enables instrumentation of the LangChain LLM library. diff --git a/lib/feature_flags.js b/lib/feature_flags.js index 72446a233..ff72d7348 100644 --- a/lib/feature_flags.js +++ b/lib/feature_flags.js @@ -12,7 +12,8 @@ exports.prerelease = { reverse_naming_rules: false, undici_async_tracking: true, unresolved_promise_cleanup: true, - legacy_context_manager: false + legacy_context_manager: false, + langchain_instrumentation: false } // flags that are no longer used for released features diff --git a/test/unit/feature_flag.test.js b/test/unit/feature_flag.test.js index a73b9a674..890f1f076 100644 --- a/test/unit/feature_flag.test.js +++ b/test/unit/feature_flag.test.js @@ -35,7 +35,8 @@ const used = [ 'unresolved_promise_cleanup', 'undici_instrumentation', 'undici_async_tracking', - 'aws_bedrock_instrumentation' + 'aws_bedrock_instrumentation', + 'langchain_instrumentation' ] tap.test('feature flags', (t) => {