Skip to content

Instantly share code, notes, and snippets.

@edsiper
Last active January 22, 2019 18:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save edsiper/71842b5ee81d2e0745625ce3b10b4912 to your computer and use it in GitHub Desktop.
Save edsiper/71842b5ee81d2e0745625ce3b10b4912 to your computer and use it in GitHub Desktop.
article_kubecon

suggest parser

apiVersion: v1
kind: Pod
metadata:
  name: apache-logs
  labels:
    app: apache-logs
  annotations:
    fluentbit.io/parser: apache
spec:
  containers:
  - name: apache
    image: edsiper/apache_logs

suggest exclude

apiVersion: v1
kind: Pod
metadata:
  name: apache-logs
  labels:
    app: apache-logs
  annotations:
    fluentbit.io/exclude: "true"
spec:
  containers:
  - name: apache-exclude
    image: edsiper/apache_logs

API Root

$ curl -s http://127.0.0.1:2020 | jq

{
  "fluent-bit": {
    "version": "0.13.0",
    "edition": "Community",
    "flags": [
      "FLB_HAVE_TLS",
      "FLB_HAVE_METRICS",
      "FLB_HAVE_SQLDB",
      "FLB_HAVE_TRACE",
      "FLB_HAVE_METRICS",
      "FLB_HAVE_HTTP_SERVER"
    ]
  }
}

JSON Metrics

$ curl -s http://127.0.0.1:2020/api/v1/metrics | jq

{
  "input": {
    "tail.0": {
      "records": 1000024,
      "bytes": 139632211
    }
  },
  "output": {
    "stdout.0": {
      "proc_records": 1000024,
      "proc_bytes": 139632211,
      "errors": 0,
      "retries": 0,
      "retries_failed": 0
    }
  }
}

Prometheus

fluentbit_input_records_total{name="tail.0"} 1000024 1524676748483
fluentbit_input_bytes_total{name="tail.0"} 139632211 1524676748483
fluentbit_output_proc_records_total{name="stdout.0"} 1000024 1524676748483
fluentbit_output_proc_bytes_total{name="stdout.0"} 139632211 1524676748483
fluentbit_output_errors_total{name="stdout.0"} 0 1524676748483
fluentbit_output_retries_total{name="stdout.0"} 0 1524676748483
fluentbit_output_retries_failed_total{name="stdout.0"} 0 1524676748483
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment