---
title: GreptimeDB Logs
slug: telemetry-pipeline/greptimedb-logs
docTags: 
createdAt: 2025-04-21T01:00:02.687Z
---

# GreptimeDB Logs Sink

## Overview

The **GreptimeDB Logs sink** writes **log and metric events** to **GreptimeDB** using its HTTP ingestion interface.
&#x20;It is designed for **time-series–oriented observability workloads**, combining structured logs and metrics within a single analytical database.

This sink is commonly used when GreptimeDB serves as:

- a unified backend for logs and metrics,&#x20;
- a high-performance time-series analytics engine,&#x20;
- or a long-term observability storage platform.&#x20;

## Supported Input Types

- Logs&#x20;
- Metrics&#x20;

## Connection Configuration

### Endpoint (required)

Specifies the **HTTP endpoint** of the GreptimeDB server.

The endpoint must:

- include the protocol (HTTP or HTTPS),&#x20;
- point to a GreptimeDB ingestion-compatible service,&#x20;
- be reachable from the worker runtime environment.&#x20;

### Database Name

Defines the **GreptimeDB database** used for ingestion.

Key characteristics:

- Defaults to the public database if not specified.&#x20;
- Databases must already exist in GreptimeDB.&#x20;
- In managed GreptimeDB (GreptimeCloud), the database name must match the instance configuration.&#x20;

Dynamic database selection is supported using per-event values when required.

### Table (required)

Specifies the **target table** into which data is written.

Important considerations:

- The table must exist before ingestion.&#x20;
- Schema design directly impacts query performance and storage efficiency.&#x20;
- Dynamic table selection can be used for multi-tenant or multi-workload scenarios.&#x20;

## Authentication

### Username and Password

Authentication credentials are required **only if authentication is enabled** on the GreptimeDB instance.

When configured:

- credentials are sent with each ingestion request,&#x20;
- access control is enforced by GreptimeDB,&#x20;
- credentials should be scoped to ingestion-only permissions where possible.&#x20;

## Delivery Shaping

### Batch Behavior

Controls how events are grouped before being sent to GreptimeDB.

Batching parameters influence:

- write amplification,&#x20;
- ingestion throughput,&#x20;
- delivery latency.&#x20;

Default behavior favors **small batches** to balance ingestion latency and request overhead.

### Buffering Behavior

Defines how events are temporarily stored when ingestion throughput is constrained.

Supported buffer types:

- **Memory buffering** for high throughput with lower durability.&#x20;
- **Disk buffering** for increased durability across restarts or failures.&#x20;

When buffers are full:

- blocking behavior applies backpressure upstream,&#x20;
- or newest events can be dropped if continuity is prioritized over completeness.&#x20;

## Payload Optimization

### Compression

Controls HTTP payload compression.

Supported compression methods:

- gzip&#x20;
- zstd&#x20;
- snappy&#x20;
- zlib&#x20;
- none&#x20;

Compression reduces network usage and improves throughput, especially in high-volume log ingestion scenarios.

### Encoding Controls

Field-level transformations can be applied before sending data to GreptimeDB:

- include only selected fields,&#x20;
- exclude unnecessary or high-cardinality fields,&#x20;
- normalize timestamp formats.&#x20;

These controls are essential for:

- schema stability,&#x20;
- cost optimization,&#x20;
- query performance tuning.&#x20;

## Pipeline Metadata

### Pipeline Name

Defines the **logical pipeline identity** applied to ingested logs.

Use cases include:

- preserving original log structure,&#x20;
- tagging logs by ingestion pipeline,&#x20;
- distinguishing multiple worker deployments writing to the same database.&#x20;

### Pipeline Version

Specifies a **pipeline version identifier**.

This is useful for:

- schema evolution tracking,&#x20;
- rollout verification,&#x20;
- ingestion debugging across configuration changes.&#x20;

## Network and Transport Controls

### Custom Headers

Allows adding or overriding HTTP headers on ingestion requests.

Typical use cases:

- tenant identification,&#x20;
- gateway-based routing,&#x20;
- integration with API management layers.&#x20;

### Query Parameters

Custom query parameters can be appended to ingestion requests.

Used primarily for:

- advanced GreptimeDB routing,&#x20;
- experimental ingestion features,&#x20;
- deployment-specific extensions.&#x20;

### Request Behavior

Advanced request controls are available to manage delivery under load:

- adaptive or fixed concurrency,&#x20;
- rate limiting,&#x20;
- retry strategies with backoff,&#x20;
- request timeouts.&#x20;

These settings are typically tuned in:

- high-ingestion environments,&#x20;
- constrained network conditions,&#x20;
- multi-sink topologies sharing outbound capacity.&#x20;

### TLS Configuration

Supports secure communication using TLS.

Capabilities include:

- custom CA certificates,&#x20;
- client certificates and keys,&#x20;
- server name verification,&#x20;
- strict hostname validation.&#x20;

TLS should be enabled whenever GreptimeDB is accessed over untrusted networks.
