docs: add AG2, AgentGateway, and Genkit integration pages (community PRs, review fixes applied)#3244
docs: add AG2, AgentGateway, and Genkit integration pages (community PRs, review fixes applied)#3244jannikmaierhoefer wants to merge 3 commits into
Conversation
Adds the Genkit (Go) OpenTelemetry integration page by @dmeremyanin with review fixes: register the page in the frameworks sidebar meta.json, render the logomark with currentColor so it is visible in dark mode, remove an unused import from the Go example, and use sentence case for headings. Co-authored-by: DM <deemox@gmail.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AucK6Q8Hf4u4ffEo5KRj9m
Adds the AG2 native OpenTelemetry integration page by @VasiliyRad with review fixes: move the page from the removed pages/ tree to content/integrations/frameworks/, register it in the sidebar meta.json, add the official AG2 logo as an icon, fix the OpenTelemetry docs link, use a bash fence for pip install, cross-link the AutoGen page, make the A2A example self-contained, and use sentence case for headings. Co-authored-by: Vasiliy Radostev <vasiliy@live.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AucK6Q8Hf4u4ffEo5KRj9m
Adds the AgentGateway (Kubernetes gateway) integration page by @sebbycorp with review fixes: move the page from the removed pages/ tree to content/integrations/gateways/, register it in the sidebar meta.json, add the official AgentGateway icon, fix stale Langfuse doc links, use current GenAI semconv token attribute names, and correct the user/session metadata guidance to map headers to langfuse.user.id and langfuse.session.id. Co-authored-by: Sebastian Maniak <sebastian@maniak.io> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AucK6Q8Hf4u4ffEo5KRj9m
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@claude review |
| ## Step 1: Install the Genkit OpenTelemetry plugin | ||
|
|
||
| ```bash | ||
| go get github.com/xavidop/genkit-opentelemetry-go | ||
| ``` | ||
|
|
||
| The package is documented in the [`genkit-ai/opentelemetry-go-plugin` repository](https://github.com/genkit-ai/opentelemetry-go-plugin). |
There was a problem hiding this comment.
🔴 The Callout (line 18) and prose (line 28) both link to github.com/genkit-ai/opentelemetry-go-plugin as the documented plugin, but the go get command (line 25) and Go import (line 54) use github.com/xavidop/genkit-opentelemetry-go — a different owner and repository name. A reader clicking the linked repo will land on a package whose install/API instructions don't match the code snippets. Please reconcile by either updating the code to use the linked module, or updating both prose links to point at github.com/xavidop/genkit-opentelemetry-go.
Extended reasoning...
The bug. content/integrations/frameworks/genkit.mdx contains an internal inconsistency between the documentation prose and the code snippets. Two prose references point readers at one Go module while the code snippets install and import a completely different Go module:
- Line 18 (Callout): Genkit OpenTelemetry plugin
- Line 25 (
bash):go get github.com/xavidop/genkit-opentelemetry-go - Line 28 (prose): "The package is documented in the
genkit-ai/opentelemetry-go-pluginrepository." - Line 54 (Go import):
opentelemetry "github.com/xavidop/genkit-opentelemetry-go"
Why this is a real problem. In Go, the module path IS the package identity — github.com/genkit-ai/opentelemetry-go-plugin and github.com/xavidop/genkit-opentelemetry-go are two distinct packages with different owners and different repository names (not just an org rename — the repo name itself changes from opentelemetry-go-plugin to genkit-opentelemetry-go). They cannot both refer to the same package.
Impact on the reader. This is the very first step of the integration (Step 1: Install the Genkit OpenTelemetry plugin). A reader who follows the prose link lands on genkit-ai/opentelemetry-go-plugin's README and gets install/config instructions that reference a different import path than the code snippets in this same guide. A reader who follows the code snippet installs xavidop/genkit-opentelemetry-go, then clicks the doc link and finds themselves reading docs for a package they never installed. Either path is broken.
Step-by-step proof.
- Reader opens the Genkit integration page.
- Reader reads the Callout on line 18 and clicks "Genkit OpenTelemetry plugin" → lands on
https://github.com/genkit-ai/opentelemetry-go-plugin. - Reader returns to the guide and runs
go get github.com/xavidop/genkit-opentelemetry-gofrom line 25 — this pulls a different module (different owner, different repo). - Reader clicks the prose link on line 28 ("documented in the
genkit-ai/opentelemetry-go-pluginrepository") → lands again ongenkit-ai/opentelemetry-go-plugin, whose README describes a different import path and possibly a different API surface than thexavidop/...module the reader just installed. - Reader copies the Go code from Step 3 (line 54:
opentelemetry "github.com/xavidop/genkit-opentelemetry-go") — the import matches what was installed, but the reader has no docs for it because both prose links point elsewhere.
Why this wasn't caught. The PR description itself flags Genkit content as "as written by the original authors — worth a quick spot-check," indicating the maintainer already suspected this area needed verification.
Fix. Pick one authoritative source and align both sides. If xavidop/genkit-opentelemetry-go is the correct package (matching what the code imports), update the Callout on line 18 and the prose on line 28 to link there instead. If genkit-ai/opentelemetry-go-plugin is the correct package (matching the prose links), update the go get on line 25 and the import alias on line 54 to that module path.
| ```bash | ||
| export OTEL_EXPORTER_OTLP_ENDPOINT="https://cloud.langfuse.com/api/public/otel" | ||
| export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic $(echo -n 'pk-lf-...:sk-lf-...' | base64)" | ||
| export OTEL_SERVICE_NAME="ag2-app" | ||
| ``` |
There was a problem hiding this comment.
🟡 Two new bash snippets pipe the pk:sk pair through base64 without -w0: ag2.mdx:264 (OTEL_EXPORTER_OTLP_HEADERS) and agentgateway.mdx:63 (LANGFUSE_AUTH). GNU coreutils base64 wraps at 76 chars, and real Langfuse keys (pk-lf-<UUID>:sk-lf-<UUID>, ~85 chars → ~116 chars encoded) cross that threshold — the embedded newline survives $(...) (which only strips trailing newlines) and corrupts the Authorization header, causing silent 401s on Linux. Suggest adopting the pattern already documented in content/integrations/frameworks/spring-ai.mdx:213-214 (base64 -w0 on Linux with a macOS-BSD fallback comment).
Extended reasoning...
What is wrong
This PR adds two new bash snippets that base64-encode a Langfuse public_key:secret_key pair without disabling GNU base64's default line-wrapping:
content/integrations/frameworks/ag2.mdx:264— setsOTEL_EXPORTER_OTLP_HEADERSinlinecontent/integrations/gateways/agentgateway.mdx:63— setsLANGFUSE_AUTHfor later use in a YAML manifest
Both use the form $(echo -n "…" | base64) with no -w0.
Step-by-step proof (Linux, real Langfuse cloud keys)
- Cloud keys are UUID-suffixed:
pk-lf-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX(42 chars) andsk-lf-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX(42 chars). - Joined with
:→ 85 characters of input. - Base64 of 85 bytes →
ceil(85/3)*4= 116 characters of output. - GNU coreutils
base64defaults to--wrap=76, so it inserts a literal LF after column 76. - Bash
$(...)command substitution strips only trailing newlines from the captured stdout — an LF at position 77 stays inside the string. - For
agentgateway.mdx:LANGFUSE_AUTHnow contains<76 chars>\n<40 chars>, which is pasted into the Collector YAML asAuthorization: "Basic <broken>"→ OTLP server sees a malformed credential → 401. - For
ag2.mdx:OTEL_EXPORTER_OTLP_HEADERSgets an embedded LF. HTTP header values cannot contain raw LF; the OTLP HTTP client either rejects the header or transmits a truncated one → 401. - The placeholder
pk-lf-...:sk-lf-...shown in the docs is only 19 chars (28 encoded), so testing with the literal placeholder does NOT trigger the wrap — the bug is invisible until a reader plugs in real keys.
Why existing code does not prevent it
There is no runtime guard — the docs are copy-pasted verbatim by readers. The failure mode is silent (auth error, no hint that the credential is malformed) and specific to Linux (BSD base64 on macOS does not wrap), which is the majority CI/dev environment.
The repo already documents the fix
content/integrations/frameworks/spring-ai.mdx:213-214 spells out the correct cross-platform pattern:
export AUTH_STRING=$(echo -n "pk-lf-...:sk-lf-..." | base64 -w0) # Linux
# macOS (BSD base64 has no -w0): export AUTH_STRING=$(echo -n "pk-lf-...:sk-lf-..." | base64)The explicit # Linux / # macOS (BSD base64 has no -w0) comments are a direct acknowledgment that the maintainers have already been bitten by this. github-copilot.mdx and other/openclaw.mdx use the same pattern.
Suggested fix
Adopt the spring-ai pattern in both new files: append -w0 to the base64 call and add a one-line macOS fallback comment. This is a one-character diff per file.
Severity note
Marking as nit because several pre-existing docs (amazon-agentcore.mdx, pipecat.mdx, vscode.mdx, existing-otel-setup.mdx, and agentgateway.mdx's own troubleshooting row at line 425) use the same non-wrapping-safe pattern, so this PR extends a pre-existing inconsistency rather than introducing a new one. It is still worth fixing on the way in — the correct pattern is one directory over in spring-ai.mdx, and following the wrong pattern here causes a real silent-auth failure for readers who paste the snippet with real UUID keys.
Adopts three community integration-page PRs that could not be updated in place (fork branches, two of them targeting the removed
pages/tree), with review fixes applied. Original authors are credited viaCo-authored-byon each commit — one commit per integration.Included integrations
Genkit (supersedes #2701 by @dmeremyanin)
genkitincontent/integrations/frameworks/meta.json(the PR's meta.json hunk conflicted withmain)currentColorso it is visible in dark modefmtimport from the Go example (compile error)AG2 (supersedes #2632 by @VasiliyRad)
pages/tree tocontent/integrations/frameworks/ag2.mdx(it would never have rendered)ag2in the frameworks sidebarmeta.jsonag2_icon.svg, from the ag2ai/ag2 repo,currentColor)/docs/integrations/native/opentelemetry→/integrations/native/opentelemetry%pipmagic →pip installin a bash fenceimport osadded to the exporter snippetAgentGateway (supersedes #2550 by @sebbycorp)
pages/tree tocontent/integrations/gateways/agentgateway.mdxagentgatewayin the gateways sidebarmeta.jsonsolo_icon.png)/docs/integrations/otel→/integrations/native/opentelemetry, self-hosting link)gen_ai.usage.input_tokens/output_tokens)langfuse.user.id/langfuse.session.idto drive user/session tracking (plainx-*attributes do not)Checks
node scripts/check-h1-headings.jspassesprettier --checkpasses on all changed files/integrations/native/opentelemetry,/integrations/frameworks/autogen,/self-hosting,/docs/observability/features/users,/docs/observability/features/sessions)Notes for maintainers
autogen.opentelemetry,instrument_agent,instrument_pattern,instrument_a2a_server) and the Genkit "up to 10 minutes without the ingestion-version header" claim are as written by the original authors — worth a quick spot-check.🤖 Generated with Claude Code
https://claude.ai/code/session_01AucK6Q8Hf4u4ffEo5KRj9m
Generated by Claude Code
Greptile Summary
This PR adopts three community integration pages — AG2, AgentGateway, and Genkit — that were either targeting the removed
pages/tree or could not be updated in place, with review fixes applied by the maintainer.content/integrations/frameworks/ag2.mdx): New page for AG2 v0.11+ native OpenTelemetry tracing. Covers basic setup, tool-use, group-chat, distributed A2A tracing, and an env-var alternative. Code examples are self-contained and the AutoGen cross-link callout is accurate.content/integrations/gateways/agentgateway.mdx): New page for routing LLM traffic through AgentGateway with Langfuse observability via an OTEL Collector. Kubernetes manifests, GenAI semconv field mappings, and user/session metadata sections all look correct.content/integrations/frameworks/genkit.mdx): New page for sending Go Genkit OTLP traces to Langfuse. The Go module path (github.com/xavidop/genkit-opentelemetry-go) and the GitHub docs link (genkit-ai/opentelemetry-go-plugin) refer to the same project (different repo alias — verified). Themeta.jsonsidebar registrations and SVG icon files are also included.Confidence Score: 4/5
Safe to merge; the one finding is a cosmetic SVG color that doesn't affect functionality.
Three well-written documentation pages with accurate code examples, corrected links, and working sidebar registrations. The only gap is that the AgentGateway icon retains hardcoded brand colors instead of
currentColor, so it won't participate in theme switching the way the AG2 and Genkit icons do — a cosmetic inconsistency introduced in this same PR.public/images/integrations/agentgateway_icon.svg — hardcoded
fill="#7734be"on all path elements should befill="currentColor"to match the other icons.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD subgraph AG2 A1[AG2 Agents] -->|instrument_agent / instrument_pattern| A2[OTel TracerProvider] A2 -->|BatchSpanProcessor| A3[OTLPSpanExporter HTTP] A3 --> LF[Langfuse /api/public/otel/v1/traces] end subgraph Genkit_Go G1[Genkit Flows] -->|genkit-opentelemetry-go plugin| G2[OTLPSpanExporter HTTP] G2 --> LF end subgraph AgentGateway C1[AI Agent] -->|HTTP| GW[AgentGateway] GW -->|OTel spans| OC[OTEL Collector] OC -->|otlphttp export| LF GW -->|proxied request| LLM[LLM Provider] end LF[Langfuse Traces UI]%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD subgraph AG2 A1[AG2 Agents] -->|instrument_agent / instrument_pattern| A2[OTel TracerProvider] A2 -->|BatchSpanProcessor| A3[OTLPSpanExporter HTTP] A3 --> LF[Langfuse /api/public/otel/v1/traces] end subgraph Genkit_Go G1[Genkit Flows] -->|genkit-opentelemetry-go plugin| G2[OTLPSpanExporter HTTP] G2 --> LF end subgraph AgentGateway C1[AI Agent] -->|HTTP| GW[AgentGateway] GW -->|OTel spans| OC[OTEL Collector] OC -->|otlphttp export| LF GW -->|proxied request| LLM[LLM Provider] end LF[Langfuse Traces UI]Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "docs: add AgentGateway integration page ..." | Re-trigger Greptile