lm-logs

by LogicMonitor

Helm chartv0.3.5Verified publisher

A Helm chart for sending k8s logs to Logic Monitor

About this chart

Send Kubernetes logs to LM Logs

This chart deploy a fluentd based daemonset to collect and forward logs to LogicMonitor

Prerequisite

Deploy

Install the lm-logs chart, filling in the required values.

helm install -n <namespace> \
--set lm_company_name="<lm_company_name>" \
--set lm_access_id="<lm_access_id>" \
--set lm_access_key="<lm_access_key>" \
lm-logs logicmonitor/lm-logs

Parameters

The following tables lists the configurable parameters of the lm-logs chart and their default values.

ParameterDescriptionDefault
global.imagePullSecretsList of global registry secret names[] (does not add image pull secrets to deployed pods)
global.nameOverrideGlobal storage class for dynamic provisioning""
global.fullnameOverrideGlobal storage class for dynamic provisioning""
global.lm_company_nameLogicMonitor account namenil
global.lm_access_idLogicMonitor API Token Access IDnil
global.lm_access_keyLogicMonitor API Token Access Keynil
image.repositoryContainer image repositorylogicmonitor/lm-logs-k8s-fluentd
image.pullPolicyContainer image pull policyIfNotPresent
image.tagContainer image tag""
resources.limits.memoryContainer memory resource limit1000Mi
resources.requests.cpu.Container cpu resource requests300m
resources.requests.memoryContainer memory resource requests700Mi
fluent.device_less_logsbeta feature. when set true, do not send resource information. send service and namespace as metadata when truefalse
fluent.include_metadataif true send all metadata along with log msgtrue
fluent.buffer.memoryfluentd's buffer memory plugin configflush_interval 1s,chunk_limit_size 8m,flush_thread_count 8
tolerationsTolerations for pod assignment{} (evaluated as a template)
nodeSelectorsNode labels for pod assignment{} (evaluated as a template)
affinityAffinity for pod assignment{} (evaluated as a template)
envMap to add extra environment variables{}
kubernetes.multiline_start_regexpRegexp to match beginning of multiline/^\[(\d{4}-)?\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3}.*\]/
kubernetes.cluster_nameClusterName given while adding k8s cluster""

Avaialble Environment variables

For descriptions see: https://github.com/fabric8io/fluent-plugin-kubernetes_metadata_filter

  • FLUENT_LOG_LEVEL
  • FLUENT_CONTAINER_TAIL_TAG
  • FLUENT_CONTAINER_TAIL_EXCLUDE_PATH
  • FLUENT_CONTAINER_TAIL_PARSER_TYPE
  • FLUENT_FILTER_KUBERNETES_URL
  • KUBERNETES_VERIFY_SSL
  • KUBERNETES_CA_FILE
  • FLUENT_KUBERNETES_METADATA_SKIP_LABELS
  • FLUENT_KUBERNETES_METADATA_SKIP_CONTAINER_METADATA
  • FLUENT_KUBERNETES_METADATA_SKIP_MASTER_URL
  • FLUENT_KUBERNETES_METADATA_SKIP_NAMESPACE_METADATA

New deviceless logs k8s integration (beta)

Note: This feature may not be available to all customers. To enable this feature set fluent.device_less_logs=true

Problems with current integration

  • k8s pods are ephemeral, anomaly detection is done per pod. Which creates high volume of anomalies and makes it hard to monitor.
  • When new pod is created, argus takes time to register it as LM Device and resource mapping fails until then. Consequently we miss initial pod logs.

When fluent.device_less_logs=true Anomaly detection will be done on namespace and service

  • namespace will be k8s namespace
  • service will be extracted from metadata for yaml in the following priority.
    • kubernetets.labels.app ( deployments )
    • kubernetets.labels.app_kubernetes_io/name (daemon sets)
    • kubernetets.container_name
    • kubernetets.pod_name

Multiline log support for k8s lm logs

To use regexp to match beginning of multiline set kubernetes.multiline_start_regexp=<some-regex-pattern> by default the regex is set to /^\[(\d{4}-)?\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3}.*\]/

Deploy lm-logs with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has lm-logs on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartlm-logs is pinned at v0.3.5 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply