@@ -47,8 +47,11 @@ const { storage } = require('./storage')
4747const registry = new WeakMap ( )
4848
4949class LLMObsTagger {
50+ /** @type {import('../config/config-base') } */
51+ #config
52+
5053 constructor ( config , softFail = false ) {
51- this . _config = config
54+ this . #config = config
5255
5356 this . softFail = softFail
5457 }
@@ -72,15 +75,15 @@ class LLMObsTagger {
7275 integration,
7376 _decorator,
7477 } = { } ) {
75- if ( ! this . _config . llmobs . enabled ) return
78+ if ( ! this . #config . llmobs . enabled ) return
7679 if ( ! kind ) return // do not register it in the map if it doesn't have an llmobs span kind
7780
7881 const spanMlApp =
7982 mlApp ||
8083 registry . get ( parent ) ?. [ ML_APP ] ||
8184 span . context ( ) . _trace . tags [ PROPAGATED_ML_APP_KEY ] ||
82- this . _config . llmobs . mlApp ||
83- this . _config . service // this should always have a default
85+ this . #config . llmobs . mlApp ||
86+ this . #config . service // this should always have a default
8487
8588 if ( ! spanMlApp ) {
8689 throw new Error (
@@ -624,7 +627,7 @@ class LLMObsTagger {
624627 }
625628
626629 _register ( span ) {
627- if ( ! this . _config . llmobs . enabled ) return
630+ if ( ! this . #config . llmobs . enabled ) return
628631 if ( registry . has ( span ) ) {
629632 this . #handleFailure( `LLMObs Span "${ span . _name } " already registered.` )
630633 return
@@ -634,7 +637,7 @@ class LLMObsTagger {
634637 }
635638
636639 _setTag ( span , key , value ) {
637- if ( ! this . _config . llmobs . enabled ) return
640+ if ( ! this . #config . llmobs . enabled ) return
638641 if ( ! registry . has ( span ) ) {
639642 this . #handleFailure( `Span "${ span . _name } " must be an LLMObs generated span.` )
640643 return
0 commit comments