Skip to content

Add LLM agent detection and markdown redirect for RUM pages#34620

Open
allspain wants to merge 1 commit intomasterfrom
richard.klein/llm-agent-markdown-redirect
Open

Add LLM agent detection and markdown redirect for RUM pages#34620
allspain wants to merge 1 commit intomasterfrom
richard.klein/llm-agent-markdown-redirect

Conversation

@allspain
Copy link

What does this PR do? What is the motivation?

Adds LLM agent detection to RUM documentation pages that redirects crawlers to the existing .md version of each page, providing cleaner markdown content for AI consumption.

Two complementary mechanisms:

  • <link rel="alternate" type="text/markdown"> tag in <head> for agents that parse HTML but don't execute JS
  • Inline JavaScript redirect that detects known LLM crawler user-agents and redirects to the .md URL

Scoped to /real_user_monitoring/ pages only for initial rollout.

Files changed

  • layouts/partials/llm-agent-redirect.html — New partial with link tag + JS redirect
  • layouts/_default/baseof.html — Conditional include for RUM pages
  • docs/plans/2026-02-16-llm-agent-markdown-redirect-design.md — Design doc

Merge instructions

Merge readiness:

  • Ready for merge

Additional notes

  • The .md endpoint already works in production (e.g., docs.datadoghq.com/real_user_monitoring/application_monitoring/browser.md)
  • JS redirect only catches agents that execute JavaScript; the <link> tag covers agents that parse HTML
  • Future work: expand beyond RUM pages, move detection server-side (CloudFront Function)

🤖 Generated with Claude Code

@allspain allspain requested review from a team as code owners February 16, 2026 13:55
@github-actions github-actions bot added the Architecture Everything related to the Doc backend label Feb 16, 2026
Adds a <link rel="alternate" type="text/markdown"> tag and inline JS
that detects known LLM crawler user-agents and redirects them to the
existing .md version of the page. Scoped to /real_user_monitoring/ pages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@allspain allspain force-pushed the richard.klein/llm-agent-markdown-redirect branch from 191d7ec to 33b1554 Compare February 16, 2026 14:37
@jhgilbert
Copy link
Contributor

I've recommended that Rick create a Jira card for this, since we would want to do this for all products if it's worth doing. My team would need to understand more about the problem being solved in order to make a decision. Thanks!

@domalessi domalessi added the WORK IN PROGRESS No review needed, it's a wip ;) label Feb 17, 2026
@domalessi
Copy link
Contributor

Thanks for the note, @jhgilbert !

I've added the WORK IN PROGRESS label to get this out of our queue, but @allspain you can remove that when it's ready for a gut check from Docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Architecture Everything related to the Doc backend WORK IN PROGRESS No review needed, it's a wip ;)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments