If the labels are not showing up then it means maybe fluent bit’s kubernetes filter is not configured correctly. For this you need to manually enrich the events using a custom Lua filter if the default kubernetes metadata collection isn’t sufficient.
Regarding your query, whether it requires direct calls to the Kubernetes API server via Lua scripts. Yes, Lua plugin would require direct API calls to the k8s API server to fetch Job labels. But the Fluent Bit Lua filter plugin has some limitations, like the Lua plugin does not include the necessary HTTP modules to fetch job metadata from the k8s API. To resolve this you need to enrich the data through an external processor. Refer to this How to configure Fluent Bit to collect logs for your K8s cluster blog by Giulia Di Pietro, which will be helpful to resolve the issue.
Note: If you intend to use Lua to interact with kubernetes API directly you will need to implement HTTP requests within Lua however this may require additional modules that aren't included by default fluent bit’s Lua plugin.