> ## Documentation Index
> Fetch the complete documentation index at: https://puzzlet-9ba7bb98.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenLLMetry

> Trace LLM apps instrumented with OpenLLMetry (Traceloop) or OpenLIT in AgentMark, across providers, frameworks, and agent libraries.

[OpenLLMetry](https://github.com/traceloop/openllmetry) is a set of OpenTelemetry instrumentors maintained by Traceloop. [OpenLIT](https://github.com/openlit/openlit) is a compatible instrumentation library that follows the same conventions. Both emit OTLP spans for model calls, workflows, and agent steps, and AgentMark reads their attribute conventions directly. Point the exporter at AgentMark and traces arrive with no per-framework setup on the AgentMark side.

## Supported frameworks

OpenLLMetry and OpenLIT instrument providers, frameworks, and agent libraries, including:

| Category      | Instrumented                                                       |
| ------------- | ------------------------------------------------------------------ |
| Providers     | OpenAI, Anthropic, Cohere, Amazon Bedrock, Google, Mistral, Ollama |
| Orchestration | LangChain, LlamaIndex, Haystack                                    |
| Agents        | CrewAI, AutoGen, Semantic Kernel, Agno                             |
| Vector stores | Chroma, Pinecone, Qdrant, Weaviate, Milvus, Marqo, LanceDB         |

See the [OpenLLMetry](https://github.com/traceloop/openllmetry) and [OpenLIT](https://github.com/openlit/openlit) repositories for the complete, current list.

## Setup

The Traceloop SDK bundles the OpenLLMetry instrumentors for both Node.js and Python.

<Steps>
  <Step title="Install the SDK">
    <CodeGroup>
      ```bash TypeScript theme={null}
      npm install @traceloop/node-server-sdk
      ```

      ```bash Python theme={null}
      pip install traceloop-sdk
      ```
    </CodeGroup>
  </Step>

  <Step title="Point it at AgentMark">
    Initialize the SDK with AgentMark's endpoint and your authentication headers (API key and app id, from project settings). Call this once, before your app makes model calls.

    <CodeGroup>
      ```typescript TypeScript theme={null}
      import * as traceloop from "@traceloop/node-server-sdk";

      traceloop.initialize({
        appName: "my-app",
        apiEndpoint: "https://api.agentmark.co",
        headers: {
          Authorization: process.env.AGENTMARK_API_KEY!, // raw key, no "Bearer" prefix
          "X-Agentmark-App-Id": process.env.AGENTMARK_APP_ID!,
        },
      });
      ```

      ```python Python theme={null}
      from traceloop.sdk import Traceloop

      Traceloop.init(
          api_endpoint="https://api.agentmark.co",
          headers={
              "Authorization": "<YOUR_API_KEY>",  # raw key, no "Bearer" prefix
              "X-Agentmark-App-Id": "<YOUR_APP_ID>",
          },
      )
      ```
    </CodeGroup>

    Pass only the base URL as the endpoint (`apiEndpoint` / `api_endpoint`); Traceloop appends the `/v1/traces` path itself. OpenLLMetry exports OTLP, so you can also configure the endpoint and headers with the standard `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` and `OTEL_EXPORTER_OTLP_TRACES_HEADERS` environment variables. See [OpenTelemetry](/integrations/tracing/opentelemetry).
  </Step>

  <Step title="Run your app">
    Run your application. Model calls, workflows, and agent steps arrive in AgentMark as spans grouped into a trace. See [Traces and logs](/observe/traces-and-logs).
  </Step>
</Steps>

## What AgentMark captures

AgentMark maps OpenLLMetry and OpenLIT attributes onto its normalized trace fields:

| OpenLLMetry attribute                                 | AgentMark field                                                                      |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------ |
| `gen_ai.request.model` / `gen_ai.response.model`      | Model                                                                                |
| `gen_ai.usage.prompt_tokens` / `.completion_tokens`   | Input / output tokens                                                                |
| `gen_ai.prompt.*` / `gen_ai.completion.*`             | Input / output messages                                                              |
| `gen_ai.completion.*.tool_calls.*`                    | Tool calls                                                                           |
| `traceloop.entity.input` / `.output`                  | Input / output on workflow and task spans                                            |
| `gen_ai.request.temperature` / `max_tokens` / `top_p` | Settings                                                                             |
| `gen_ai.response.finish_reason`                       | Finish reason                                                                        |
| `db.query.result` / `db.search.result` events         | Retrieved documents (id, score or distance, content, metadata) on vector-store spans |
| `traceloop.span.kind` / `db.system`                   | Span kind (`llm`, `tool`, `agent`, `retrieval`, …)                                   |
| `traceloop.association.properties.*`                  | Session, user, and custom metadata                                                   |

Token counts and the model feed AgentMark's [cost tracking](/observe/cost-and-token-tracking) automatically.

<Note>
  AgentMark captures retrieved documents from the per-result span events the vector-store instrumentor emits. Some instrumentors record only the query parameters and no per-result events. Those spans still appear as `retrieval`, but without a document list.
</Note>

## Next steps

<CardGroup cols={2}>
  <Card title="OpenTelemetry endpoint" icon="plug" href="/integrations/tracing/opentelemetry">
    The endpoint, authentication, and environment-variable configuration
  </Card>

  <Card title="Traces and logs" icon="list-tree" href="/observe/traces-and-logs">
    Explore traces once they arrive
  </Card>
</CardGroup>

<div className="mt-8 rounded-lg bg-blue-50 p-6 dark:bg-blue-900/30">
  <h3 className="font-semibold mb-3">Have questions?</h3>
  <p className="mb-4">Reach out any time:</p>

  <ul>
    <li>
      Email the team at <a href="mailto:hello@agentmark.co" className="text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-200">[hello@agentmark.co](mailto:hello@agentmark.co)</a> for support
    </li>

    <li>
      Schedule an <a href="https://cal.com/ryan-randall/enterprise" className="text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-200">Enterprise Demo</a> to learn about AgentMark's business solutions
    </li>
  </ul>
</div>
