https://www.boundaryml.com logo
🟑 Joining Officer Hours in 30 Minutes
# questions
z
Great, I'll be in the officer hours. Just give me about 30m to finish what I'm doing and set it up.
a
Sweet, give me 30ish mins as well
Sorry, another 15ish min, heading to our office
available now
z
Cool, same!
in the office room
btw, do you know any alternatives to "live share"? It would make collab easier.
Copy code
FROM golang:1.24 AS build

WORKDIR /app

# Install build dependencies (Ubuntu uses apt-get, not apk)
RUN apt-get update && apt-get install -y \
    gcc \
    git \
    make \
    && rm -rf /var/lib/apt/lists/*


# Copy go mod and sum files
COPY go.mod go.sum ./
RUN go mod download

# Install Orchestrion for APM auto-instrumentation
# This enables zero-code-change Datadog APM integration
RUN go install github.com/DataDog/orchestrion@v1.4.0

# Copy the source code
COPY . .

# Pin Orchestrion dependencies and build the application
# Using the unified build target that automatically handles Datadog integration
RUN orchestrion pin && make clean && make enable_datadog=true build-unified

# Start a new stage from Ubuntu
FROM ubuntu:22.04 AS run


# Install CA certificates for HTTPS requests (needed for BAML library download)
RUN apt-get update && apt-get install -y \
    ca-certificates \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Copy the binary from build stage
COPY --from=build /app/api-service ./api-service

# Make sure the binary is executable
RUN chmod +x ./api-service

# Expose a commonly used port (documented); actual port must be set via env
EXPOSE 8899

# Command to run the executable
CMD ["/app/api-service"]
generator lang_go { output_type go version "0.211.2" client_package_name "github.com/ClareAI/Astra-API-Service" on_generate "gofmt -w . && /Users/zack/go/bin/goimports -w . && go mod tidy" }
packages: github.com/DataDog/dd-trace-go/v2 v2.3.0 github.com/boundaryml/baml v0.211.2
a
ok i think the issue is that the checksum file is missing, so if i can patch that we may have a way to make it work. I'll try adding the checksum file in
z
Got it! Once patch comes in I can update the package and rerun it.
I suppose you will need to upgrade the version as well to include the patch.
a
im going to retroactively upload the checksum file
and see if that works, it should take like 10min i think
can you try now?
baml version 0.211.2
z
looking into it now.
nope
but does look a bit healthier
a
can you paste the exception again?
maybe with
Copy code
codeblock
a
ok looking into reproing now
i repro'd it
now i can try to fix
the reason is that datadog's tracer isnt ready by the time baml tries to initialize, so we ignore orchestrion in those downloader functions (and use our own unorchestrated http client) https://cdn.discordapp.com/attachments/1430580729934254271/1430649945433833643/image.png?ex=68fa8c17&is=68f93a97&hm=e30b5b3402e71b5be07c8bd3d956db397bbc5380a6d0b6afb6a9df704aa758fd&
btw, i dont think you'll get any datadog tracing for each baml call -- you'll need to instrument that yourself. Later we can add an integration from our Studio -> datadog in some way
i can release this by end of day
z
That's awesome, thanks for investigating this! Hm, that's fair I suppose we could add manual tracing spans for each baml call.
a
Hey so sorry but we need some additional time to test, so the release is gonna be tomorrow
z
What's the progress right now?
Was just going to test from my end.
v
we're running a few more tests before we release!
but fyi since its go, technically you can get it from a specific commit
instead
and just use the package at the latest canary
z
I see so something like this, go get github.com/user/repo@commit-hash?
v
yea, but let me check. I'm not very good at go πŸ₯²
oh yep, you can do:
Copy code
go get github.com/boundaryml/baml@canary
z
cool, thank you! So will the improvement be in the next release/version or will it be retroactively added to the current version?
v
oh it will be on the next release!
we generally don't apply anything retroactively
z
Got it, when is the next release planned?
v
tonight! @aaronv (BAML) is actively doing this atm! Testing is just taking a bit since there were quite a few merges
(not related to this test)
z
Awesome! I'll wait for the release then.
released by chance?
a
Hey sorry but we found more issues. Can you try using the commit from canary?
this is released in 0.212.0
z
Saw the comment, thanks Aaron!
i
@Zack Hi, did you manage to enable traces to BAML calls?
z
@idanrokach yes, you can do this two different ways. If you're using their observability platform "Boundary Studio", you can auto-instrument your calls if you provide the boundary studio environment variable and api token. If an external platform, then you'll deal with the BAML object called NewCollector which contains the information from the calls. You can export that data to the target platform. I'd recommend using an OTEL-based platform for greater flexibility.
i
@Zack thanks! I do use their Studio for now but we are still missing information in DataDog traces. (We do not see the call in the traces at all) I tried to wrap the BAML call with custom span, but failed
z
@User That makes sense. Boundary Studio and Datadog are two different destinations. You'll need to extract the BAML call data from the LLM Call via the baml client "NewCollector" object(" That's the name in go, could be different with other langs") and then create a span for the extracted info to be exported. Here's a diagram you can use,
Copy code
BAML OBSERVABILITY FLOW
═══════════════════════

        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚  Your Code  β”‚
        β”‚ (BAML Call) β”‚
        β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
               β”‚
               β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚ BAML Client β”‚
        β”‚ ─────────── β”‚
        β”‚ NewCollectorβ”‚
        β”‚ β€’ Model     β”‚
        β”‚ β€’ I/O       β”‚
        β”‚ β€’ Tokens    β”‚
        β”‚ β€’ Latency   β”‚
        β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
               β”‚
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”
       β”‚               β”‚
       β–Ό               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  OPTION 1   β”‚ β”‚  OPTION 2   β”‚
β”‚    Auto     β”‚ β”‚   Manual    β”‚
β”‚  (Boundary) β”‚ β”‚  (Export)   β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β”‚               β”‚
       β–Ό               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Boundary   β”‚ β”‚ OTEL Span   β”‚
β”‚   Studio    β”‚ β”‚ ─────────── β”‚
β”‚ ─────────── β”‚ β”‚ SetModel()  β”‚
β”‚ βœ“ Auto      β”‚ β”‚ SetTokens() β”‚
β”‚ βœ“ No code   β”‚ β”‚ SetInput()  β”‚
β”‚             β”‚ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
β”‚ :warning: Separate  β”‚        β”‚
β”‚ from Datadogβ”‚        β–Ό
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚   Export    β”‚
                β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
                       β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β–Ό            β–Ό            β–Ό
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚Datadog β”‚  β”‚Langfuse β”‚  β”‚ Other   β”‚
     β”‚βœ“Unifiedβ”‚  β”‚βœ“LLM-    β”‚  β”‚ OTEL    β”‚
     β”‚ traces β”‚  β”‚ focused β”‚  β”‚platformsβ”‚
     β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

═══════════════════════════════════════

WHY STUDIO β‰  DATADOG:

Studio:  BAML ──► Boundary API
Datadog: App ──► OTEL Agent ──► DD

To see BAML in Datadog, extract
from NewCollector + create span.
i
Thank you very much really helpful!