> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sazabi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Vector

> Configure Vector's OpenTelemetry sink to forward logs and traces from your infrastructure to Sazabi using Vector's high-throughput observability pipeline.

[All Vector integration capabilities](https://docs.sazabi.com/catalogs/integrations/vector)

## About

Forward logs and traces from any Vector source into Sazabi using Vector's `opentelemetry` sink. Vector's `otlp` encoding codec wraps your events in a valid OTLP envelope before delivery, making Sazabi's OTLP/HTTP intake a natural destination alongside any existing sinks.

> [!WARNING]
>
> Vector 0.51.0 or later is required for the `otlp` encoding codec. Metrics sent through this source are accepted at intake but silently dropped.

## Prerequisites

* Vector 0.51.0 or later. Check with `vector --version`.
* Your Sazabi intake URL, shown above — open the log source and copy the **Intake URL** from its setup screen (the public key is embedded in the URL).

## Set up in the dashboard

**Step 1**

### Add the Sazabi sink to your Vector config

Add a `remap` transform to build the OTLP `resourceLogs` envelope, then an `opentelemetry` sink pointed at Sazabi:

```yaml title="vector.yaml" theme={"system"}
transforms:
  sazabi_logs_otlp:
    type: remap
    inputs: ["*"] # replace with explicit source/transform IDs
    source: |
      # The opentelemetry sink's `otlp` codec does not auto-wrap events.
      # This transform builds the OTLP resourceLogs envelope Sazabi expects.
      timestamp_nanos = to_unix_timestamp!(now(), unit: "nanoseconds")
      severity_text = upcase(string!(.level ?? .severity ?? ""))

      .resourceLogs = [{
        "resource": {
          "attributes": [
            { "key": "host.name",    "value": { "stringValue": .host ?? "" } }
          ]
        },
        "scopeLogs": [{
          "scope": { "name": "vector" },
          "logRecords": [{
            "timeUnixNano":  timestamp_nanos,
            "body":          { "stringValue": .message ?? encode_json(.) },
            "severityText":  severity_text
          }]
        }]
      }]

sinks:
  sazabi_logs:
    type: opentelemetry
    inputs: ["sazabi_logs_otlp"]
    protocol:
      type: http
      uri: "https://<your intake host>/v1/logs"
      method: post
      encoding:
        codec: otlp
```

Replace `<your intake host>` with the hostname from your intake URL shown above.

> [!WARNING]
>
> The `otlp` codec does not build the OTLP envelope on its own — the `remap`
> transform above is required to wrap events in the `resourceLogs` structure
> before the sink serializes them.

**Step 2**

### Wire your actual sources

Replace `inputs: ["*"]` on the `sazabi_logs_otlp` transform with your specific source or transform IDs in production. `["*"]` also matches `internal_metrics` and other unrelated components.

**Step 3**

### (Optional) Forward traces

To forward traces as well as logs, add a second `opentelemetry` sink whose `uri` ends in `/v1/traces`, with explicit `inputs` referencing an already-OTLP-shaped source — typically an `opentelemetry` Vector source with `use_otlp_decoding.traces: true`. No remap is needed for traces, and do not wire `["*"]` into a traces sink:

```yaml title="vector.yaml" theme={"system"}
sinks:
  sazabi_traces:
    type: opentelemetry
    inputs: ["otlp_in.traces"]
    protocol:
      type: http
      uri: "https://<your intake host>/v1/traces"
      method: post
      encoding:
        codec: otlp
```

**Step 4**

### Hand off the change

If this configuration is version-controlled, commit it on a new branch, push it, and open a pull request. Otherwise apply it directly to your Vector deployment. Keep the intake URL and any keys in environment variables or a secret store, and commit only configuration that references them.

## Set up with the CLI

You can also register the Vector log source with the [Sazabi CLI](https://docs.sazabi.com/reference/cli.md) (installed and authenticated — see [CLI reference](https://docs.sazabi.com/reference/cli/log-sources.md)).

Registering the source mints the same intake URL the dashboard shows above (the public key is embedded in its hostname):

```bash theme={"system"}
sazabi log-sources create vector --mode manual
```

The command prints the intake URL for the new source — copy the whole URL and point your sender at it using the configuration shown above. Run `sazabi log-sources get <log-source-id>` at any time to reprint the endpoint, or `sazabi log-sources list` to see every log source in the project.

## Verify

Restart or redeploy Vector after updating the configuration. Open the [Intake page](https://docs.sazabi.com/guides/instrument/intake.md) in the Sazabi dashboard and confirm records from the **Vector** source appear within a minute or two.

## Troubleshooting

**No records after redeploying** — Check Vector logs for errors on the `sazabi_logs` sink. Confirm the `protocol.uri` field includes the full `https://` URL and `/v1/logs` path suffix.

**Records arrive malformed** — Confirm the `sazabi_logs_otlp` remap transform is listed in the sink's `inputs`, not the raw source. Without the transform, the sink receives events that are not wrapped in a `resourceLogs` envelope.

**Metrics are silently dropped** — Metrics sent to Sazabi's OTLP intake through this source are accepted but not stored. Use [OpenTelemetry Metrics](https://docs.sazabi.com/catalogs/log-sources/send-to-an-endpoint/opentelemetry-metrics.md) with an OTel Collector for metric data.

**Version error** — The `otlp` encoding codec requires Vector 0.51.0 or later. Upgrade Vector if you see an unknown codec error.

## Further reading

> [card] [Intake](https://docs.sazabi.com/guides/instrument/intake.md)
>
> See per-source ingestion volume and health.

> [card] [Log sources](https://docs.sazabi.com/catalogs/log-sources.md)
>
> Browse the full log source catalog.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.