πͺ΅ Alloy Logs Guide
Let's make sure your application logs successfully make it into Loki!
(For complex collector configurations, hit up the official Grafana Alloy documentation.)
π― Method 1: Pushing Logs Directly (Recommended!)β
The cleanest, fastest, and strictly recommended way to ship your application logs into our stack is by configuring your service to push them directly to our internal Alloy endpoint. π
- π Internal Endpoint:
http://infra-alloy
Ensure you are pointing to the correct port for your protocol:
- 4317 - gRPC
- 4318 - HTTP
π§² Method 2: Scraping via Pod Labels (Legacy/3rd-Party)β
Wait! Only use this method for stubborn 3rd-party services or legacy applications that physically cannot push logs over the network.
To force Alloy to scrape logs from these pods, just stick this custom label onto your deployment template:
Label Key: mapcolonies.io/alloy-api-logs
Label Value: "true"
Deployment Template
kind: Deployment
apiVersion: apps/v1
metadata:
# β Do NOT put it here in the Deployment labels
labels:
app.kubernetes.io/name: SOME_NAME
spec:
template:
metadata:
# β
Put it right here in the Pod labels!
labels:
mapcolonies.io/alloy-api-logs: 'true'