FTS — Fluent Typed Scripting

Shape your telemetry with FTS.

FTS is Fluent Bit’s native processor for logs, metrics, and traces. Write your rules in Lua; FTS preserves telemetry types and OpenTelemetry context.

Fluent Bit 5.2 Logs · Metrics · Traces

FTS processor · log policy Lua

Configured with name: fts under processors.logs.

01 / Input log

{"id":9007199254740993,"password":"example-secret"}

02 / Lua policy

local fb = require("fluentbit")

function process(log)
  fb.redact(log.body, {"password"})
end

03 / Result

{"id":9007199254740993,"password":"[REDACTED]"}

The password changes. The exact integer ID stays intact.

Already using the Lua filter?

Both use Lua syntax. FTS adds a native telemetry-processing model: Fluent Bit manages typed signal data and policy errors while your script defines the transformation.

Lua filter FTS processor
Signals Logs Logs, metrics, and traces
Values in the script Converted Lua tables and numbers Typed telemetry values, including exact integers, nulls, and binary data
OpenTelemetry context Group and record metadata tables through the extended callback Named resource, scope, and attribute properties
If a running policy fails, by default The original log chunk passes through Changes to the affected item roll back; that item is dropped

The Lua filter has settings for integer fields, nulls, arrays, and timestamp precision. FTS exposes a typed value model directly. Keep working Lua filter scripts when they meet your needs; choose FTS for typed, multi-signal policies and explicit error handling.

Your data. Your rules.

An FTS policy tells the processor what to change, keep, or drop. Lua is the interface for expressing those rules.

Hide sensitive fields

Replace passwords, tokens, and other known fields before sending data to a destination.

Make data consistent

Use common environment labels and metric units so data from different services is easier to query.

Reduce noise

Filter out events you do not need, or combine compatible metric series using the labels that matter to you.

What does “typed” mean?

Changing a password field should not change a request ID. FTS preserves the values your policy leaves untouched, including large integer IDs, nulls, and binary data.

Lua is still Lua: you do not need a new language or static type declarations.

The ID in the example above

Before
9007199254740993
After
9007199254740993Same value. No rounding.

Works with logs, metrics, and traces

Write a policy for the data you want to change. FTS also gives you access to OpenTelemetry resource and application context when it is present.

See examples for logs, metrics, and traces

Logs

Clean up application logs

Read a JSON message and hide its password and authorization fields.

This example drops records when the message is missing or cannot be read as a JSON object.

Logs examples and reference

Logs policy / Lua

local fb = require("fluentbit")

function process(log)
  if not fb.unpack_json(log, "message") then
    return fb.DROP
  end
  fb.redact(log.body, {"password", "authorization"})
end

Metrics

Keep the metric labels you need

Combine matching request counts by route and status.

Only points in the same metric family with matching time windows are combined.

Metrics examples and reference

Metrics policy / Lua

local fb = require("fluentbit")

function process(metric)
  if metric.name == "http.server.requests" then
    fb.aggregate_metric(metric,
      {"http.route", "http.response.status_code"}, "sum")
  end
end

Traces

Hide sensitive span fields

Replace password and authorization values in span attributes.

Trace IDs and parent relationships stay unchanged. Other fields need their own redaction rules.

Traces examples and reference

Traces policy / Lua

local fb = require("fluentbit")

function process(span)
  fb.redact(span.attributes,
    {"password", "authorization"})
end

Try your first policy

The quickstart shows how to add a Lua policy to a Fluent Bit pipeline and inspect the result. FTS is included in Fluent Bit 5.2.

A few things to know before you start
  • Redaction replaces the structured fields you name. Secrets inside message text need their own rules.
  • By default, a failed policy drops the affected item. Review the error-handling options before using a privacy policy.
  • Existing Lua filter scripts can keep running. FTS uses a different API, so moving a script requires adapting it.