Promtail Gateway Getting Start

The Promtail Gateway is an optional service that can receive logs data from the agent through gRPC, HTTP communication.

The Promtail Gateway is an optional service that can receive logs data from the agent through gRPC, HTTP communication.

  1. gRPC, HTTP Service
  2. Logs data insert to Database(ElasticSearch, Loki, ETC) (Optional)

How to setting promtail-gateway

--gateway.grpc-server.host-port string          The host:port (e.g. 127.0.0.1:15610 or :15610) of the gateway's GRPC server (default ":15610")
--gateway.grpc-server.tls.cert string           Path to a TLS Certificate file, used to identify this server to clients
--gateway.grpc-server.tls.client-ca string      Path to a TLS CA (Certification Authority) file used to verify certificates presented by clients (if unset, all clients are permitted)
--gateway.grpc-server.tls.enabled               Enable TLS on the server
--gateway.grpc-server.tls.key string            Path to a TLS Private Key file, used to identify this server to clients
--gateway.http-server.host-port string          The host:port (e.g. 127.0.0.1:15610 or :15611) of the gateway's HTTP server (default ":15611")
--gateway.http-server.tls.cert string           Path to a TLS Certificate file, used to identify this server to clients
--gateway.http-server.tls.client-ca string      Path to a TLS CA (Certification Authority) file used to verify certificates presented by clients (if unset, all clients are permitted)
--gateway.http-server.tls.enabled               Enable TLS on the server
--gateway.http-server.tls.key string            Path to a TLS Private Key file, used to identify this server to clients

How to set up the Storage Type

1. Setting environmental variables

ElasticSearch

STORAGE_TYPE=elasticsearch

Loki

STORAGE_TYPE=loki

Promtail-gateway

STORAGE_TYPE=gateway

Kafka

STORAGE_TYPE=kafka

2. Option description by storage type

Docker-compose Example

version: '2'
services:
  clymene-ingester:
    image: bourbonkk/promtail-gateway:latest
    ports:
      - "15610:15610"
    environment:
      - STORAGE_TYPE=elasticsearch
    command:
      - --log-level=debug
      - --es.server-urls=http://[ELASTICSEARCH-IP]:9200

k8s Example

apiVersion: apps/v1
kind: Deployment
metadata:
  name: promtail-gateway
  namespace: clymene
  labels:
    app: promtail-gateway
spec:
  selector:
    matchLabels:
      app: promtail-gateway
  replicas: 1
  template:
    metadata:
      labels:
        app: promtail-gateway
    spec:
      containers:
        - name: promtail-gateway
          image: bourbonkk/promtail-gateway:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 15610
          args:
            - --es.server-urls=http://[ELASTICSEARCH-IP]:9200
            - --log-level=info
          env:
            - name: STORAGE_TYPE
              value: elasticsearch
      securityContext:
        runAsUser: 1000

Use gateway Architecture

Last modified February 11, 2023: update 2.2.2 release (0cc96d8)