@langfuse/tracing 4.0.0-beta.8 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -648,7 +648,8 @@ function updateActiveTrace(attributes) {
648
648
  }
649
649
  span.setAttributes(createTraceAttributes(attributes));
650
650
  }
651
- function updateActiveObservation(currentType, attributes) {
651
+ function updateActiveObservation(attributes, options) {
652
+ var _a;
652
653
  const span = import_api2.trace.getActiveSpan();
653
654
  if (!span) {
654
655
  (0, import_core3.getGlobalLogger)().warn(
@@ -656,7 +657,14 @@ function updateActiveObservation(currentType, attributes) {
656
657
  );
657
658
  return;
658
659
  }
659
- span.setAttributes(createObservationAttributes(currentType, attributes));
660
+ const otelAttributes = createObservationAttributes(
661
+ (_a = options == null ? void 0 : options.asType) != null ? _a : "span",
662
+ attributes
663
+ );
664
+ if (!(options == null ? void 0 : options.asType)) {
665
+ otelAttributes[import_core3.LangfuseOtelSpanAttributes.OBSERVATION_TYPE] = void 0;
666
+ }
667
+ span.setAttributes(otelAttributes);
660
668
  }
661
669
  function observe(fn, options = {}) {
662
670
  const {