<@ULVA73B9P> How do I get the perfect servers in k...
# ask-marvin
g
@Marvin How do I get the perfect servers in kubernetes, running on the helm chart to log with the json handler
m
How do get logs formatted is huge question, way more important than any data question. To help, me need Prefect version. You using Prefect 2.x or 3.x?
g
2.x
@Marvin in 2.x
m
To run Prefect servers in Kubernetes with the Helm chart and log with the JSON handler: 1. Create a
values.yaml
file
to customize your Prefect worker configuration via the Helm chart. 2. Set the logging configuration using environment variables or within the
values.yaml
file. Here's an example of what your
values.yaml
file might look like for configuring JSON logging:
Copy code
yaml
env:
  - name: PREFECT_LOGGING_FORMAT
    value: "JSON"
worker:
  cloudApiConfig:
    accountId: <target account ID>
    workspaceId: <target workspace ID>
  config:
    workPool: <target work pool name>
Finally, apply your Helm chart with the custom values:
Copy code
sh
helm install prefect-prefecthq/prefect -f values.yaml
Resources: - Deploying with Helm - Configuring Logging For fine-tuning JSON logging and handlers, check Prefect's logging docs. Make sure
PREFECT_LOGGING_FORMAT
is set correctly to JSON, making logs JSON formatted for easier parsing and handling.