Title: Custom instrumentation - Docs by LangChain
Open Graph Title: Custom instrumentation - Docs by LangChain
X Title: Custom instrumentation - Docs by LangChain
Description: Instrument your code directly to control which functions are traced and how they appear in LangSmith.
Open Graph Description: Instrument your code directly to control which functions are traced and how they appear in LangSmith.
X Description: Instrument your code directly to control which functions are traced and how they appear in LangSmith.
Opengraph URL: https://docs.langchain.com/langsmith/annotate-code
Generator: Mintlify
Domain: docs.langchain.com
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://docs.langchain.com/#organization","name":"Docs by LangChain","url":"https://docs.langchain.com","logo":{"@type":"ImageObject","url":"https://mintcdn.com/langchain-5e9cc07a/nQm-sjd_MByLhgeW/images/brand/langchain-docs-dark-blue.png?fit=max&auto=format&n=nQm-sjd_MByLhgeW&q=85&s=5babf1a1962208fd7eed942fa2432ecb"}},{"@type":"WebSite","@id":"https://docs.langchain.com#website","name":"Docs by LangChain","url":"https://docs.langchain.com","publisher":{"@id":"https://docs.langchain.com/#organization"}},{"@type":"WebPage","@id":"https://docs.langchain.com/langsmith/annotate-code#webpage","url":"https://docs.langchain.com/langsmith/annotate-code","name":"Custom instrumentation","description":"Instrument your code directly to control which functions are traced and how they appear in LangSmith.","dateModified":"2026-10-30T19:33:26.446Z","isPartOf":{"@id":"https://docs.langchain.com#website"},"breadcrumb":{"@id":"https://docs.langchain.com/langsmith/annotate-code#breadcrumb"}},{"@type":"BreadcrumbList","@id":"https://docs.langchain.com/langsmith/annotate-code#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Tracing setup","item":"https://docs.langchain.com/langsmith/integrations"},{"@type":"ListItem","position":2,"name":"Custom instrumentation","item":"https://docs.langchain.com/langsmith/annotate-code"}]},{"@type":["Article","TechArticle"],"@id":"https://docs.langchain.com/langsmith/annotate-code#article","headline":"Custom instrumentation","name":"Custom instrumentation","description":"Instrument your code directly to control which functions are traced and how they appear in LangSmith.","url":"https://docs.langchain.com/langsmith/annotate-code","mainEntityOfPage":{"@id":"https://docs.langchain.com/langsmith/annotate-code#webpage"},"dateModified":"2026-10-30T19:33:26.446Z","publisher":{"@id":"https://docs.langchain.com/#organization"},"isPartOf":{"@id":"https://docs.langchain.com#website"}}]}
| application-name | Docs by LangChain |
| og:site_name | Docs by LangChain |
| og:type | website |
| og:image | https://langchain-5e9cc07a.mintlify.app/_mintlify/api/og/v2?division=Manual+instrumentation&title=Custom+instrumentation&description=Instrument+your+code+directly+to+control+which+functions+are+traced+and+how+they+appear+in+LangSmith.&theme=5f787871cd9e0fc0371614e6&signature=d214098a793eff0bcd8fac5ea4fd9ea4cc2ed143fb1f2e9f1cc898c0d5396073 |
| og:image:width | 1200 |
| og:image:height | 630 |
| twitter:card | summary_large_image |
| twitter:image | https://langchain-5e9cc07a.mintlify.app/_mintlify/api/og/v2?division=Manual+instrumentation&title=Custom+instrumentation&description=Instrument+your+code+directly+to+control+which+functions+are+traced+and+how+they+appear+in+LangSmith.&theme=5f787871cd9e0fc0371614e6&signature=d214098a793eff0bcd8fac5ea4fd9ea4cc2ed143fb1f2e9f1cc898c0d5396073 |
| twitter:image:width | 1200 |
| twitter:image:height | 630 |
| msapplication-config | /mintlify-assets/_mintlify/favicons/langchain-5e9cc07a/YSQua9Gt91yRswvJ/_generated/favicon/browserconfig.xml |
| apple-mobile-web-app-title | Docs by LangChain |
| msapplication-TileColor | #161F34 |
| google-site-verification | 9_2KHeJwmEdwgncBRk1MsKxriZz7Sc21EJdbfCxkTEo |
Links:
Viewport: width=device-width, initial-scale=1, viewport-fit=cover