Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

feat(api): add environment property to traces, scores, obs (#5724)

Hassieb Pakzad4bbba9d983db
diff --git a/fern/apis/server/definition/commons.yml b/fern/apis/server/definition/commons.yml
index 42e48ccaec..d87ed8796a 100644
--- a/fern/apis/server/definition/commons.yml
+++ b/fern/apis/server/definition/commons.yml
@@ -38,6 +38,9 @@ types:
public:
type: optional<boolean>
docs: Public traces are accessible via url without login
+ environment:
+ type: optional<string>
+ docs: The environment from which this trace originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'.
TraceWithDetails: # GET /traces
extends: Trace
properties:
@@ -145,6 +148,9 @@ types:
costDetails:
type: optional<map<string, double>>
docs: The cost details of the observation. Key is the name of the cost metric, value is the cost in USD. The total key is the sum of all (non-total) cost metrics or the total value ingested.
+ environment:
+ type: optional<string>
+ docs: The environment from which this observation originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'.
ObservationsView:
extends: Observation
@@ -249,6 +255,9 @@ types:
queueId:
type: optional<string>
docs: Reference an annotation queue on a score. Populated if the score was initially created in an annotation queue.
+ environment:
+ type: optional<string>
+ docs: The environment from which this score originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'.
NumericScore:
extends: BaseScore
properties:
diff --git a/web/public/generated/api/openapi.yml b/web/public/generated/api/openapi.yml
index 05529852dd..4557b75c4b 100644
--- a/web/public/generated/api/openapi.yml
+++ b/web/public/generated/api/openapi.yml
@@ -2628,6 +2628,13 @@ components:
type: boolean
nullable: true
description: Public traces are accessible via url without login
+ environment:
+ type: string
+ nullable: true
+ description: >-
+ The environment from which this trace originated. Can be any
+ lowercase alphanumeric string with hyphens and underscores that does
+ not start with 'langfuse'.
required:
- id
- timestamp
@@ -2819,6 +2826,13 @@ components:
The cost details of the observation. Key is the name of the cost
metric, value is the cost in USD. The total key is the sum of all
(non-total) cost metrics or the total value ingested.
+ environment:
+ type: string
+ nullable: true
+ description: >-
+ The environment from which this observation originated. Can be any
+ lowercase alphanumeric string with hyphens and underscores that does
+ not start with 'langfuse'.
required:
- id
- type
@@ -3033,6 +3047,13 @@ components:
description: >-
Reference an annotation queue on a score. Populated if the score was
initially created in an annotation queue.
+ environment:
+ type: string
+ nullable: true
+ description: >-
+ The environment from which this score originated. Can be any
+ lowercase alphanumeric string with hyphens and underscores that does
+ not start with 'langfuse'.
required:
- id
- traceId