-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix logs #537
fix logs #537
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -305,3 +305,57 @@ vmagent: | |
tenant: tenant-root | ||
remoteWrite: | ||
url: http://vminsert-shortterm.tenant-root.svc:8480/insert/0/prometheus | ||
|
||
fluent-bit: | ||
readinessProbe: | ||
httpGet: | ||
path: / | ||
daemonSetVolumes: | ||
- name: varlog | ||
hostPath: | ||
path: /var/log | ||
- name: varlibdockercontainers | ||
hostPath: | ||
path: /var/lib/docker/containers | ||
daemonSetVolumeMounts: | ||
- name: varlog | ||
mountPath: /var/log | ||
- name: varlibdockercontainers | ||
mountPath: /var/lib/docker/containers | ||
readOnly: true | ||
config: | ||
outputs: | | ||
[OUTPUT] | ||
Name http | ||
Match kube.* | ||
Host vlogs-generic.tenant-root.svc | ||
port 9428 | ||
compress gzip | ||
uri /insert/jsonline?_stream_fields=stream,kubernetes_pod_name,kubernetes_container_name,kubernetes_namespace_name&_msg_field=log&_time_field=date | ||
format json_lines | ||
json_date_format iso8601 | ||
header AccountID 0 | ||
header ProjectID 0 | ||
filters: | | ||
[FILTER] | ||
Name kubernetes | ||
Match kube.* | ||
Merge_Log On | ||
Keep_Log On | ||
K8S-Logging.Parser On | ||
K8S-Logging.Exclude On | ||
[FILTER] | ||
Name nest | ||
Match * | ||
Wildcard pod_name | ||
Operation lift | ||
Nested_under kubernetes | ||
Add_prefix kubernetes_ | ||
[FILTER] | ||
Name modify | ||
Match * | ||
Add tenant tenant-root | ||
[FILTER] | ||
Name modify | ||
Match * | ||
Add cluster root-cluster | ||
Comment on lines
+339
to
+361
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Parameterize tenant and cluster names in filters The tenant and cluster names are currently hard-coded. These should be parameterized to support different environments and multi-tenant deployments. filters: |
[FILTER]
Name modify
Match *
- Add tenant tenant-root
+ Add tenant ${TENANT_NAME}
[FILTER]
Name modify
Match *
- Add cluster root-cluster
+ Add cluster ${CLUSTER_NAME} Additionally, consider adding a filter to handle multiline logs (e.g., stack traces) before the Kubernetes filter: filters: |
+ [FILTER]
+ Name multiline
+ Match *
+ multiline.key_content log
+ multiline.parser java
[FILTER]
Name kubernetes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enhance output configuration for reliability and security
The current output configuration lacks important reliability and security features:
📝 Committable suggestion