Skip to content

Commit a9314fd

Browse files
fix(lmlogs): adding changes for user-configurable domain name and resource type for lm-logs (#478)
* fix(logs): add user-configurable domain name and resource type * fix(logs): addressing review comments * fix(logs): removing qa domain from example
1 parent 52564b9 commit a9314fd

File tree

6 files changed

+33
-11
lines changed

6 files changed

+33
-11
lines changed

charts/lm-logs/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
apiVersion: v2
22
description: A Helm chart for sending k8s logs to Logic Monitor
33
name: lm-logs
4-
version: 0.6.0-rc01
4+
version: 0.7.0-rc01
55
maintainers:
66
- email: dev@logicmonitor.com
77
name: LogicMonitor
88
icon: https://logicmonitor.github.io/helm-charts-qa/lm_logo.png
9-
appVersion: 1.2.0
9+
appVersion: 1.3.0
1010
home: https://logicmonitor.github.io/helm-charts-qa

charts/lm-logs/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM fluent/fluentd-kubernetes-daemonset:v1.16-debian-forward-1
22
USER root
3-
RUN gem install fluent-plugin-lm-logs -v 1.1.0
3+
RUN gem install fluent-plugin-lm-logs -v 1.2.8
44
RUN gem install fluent-plugin-multi-format-parser -v 1.0.0

charts/lm-logs/README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ The following tables lists the configurable parameters of the lm-logs chart and
2424
| `global.nameOverride` | Global storage class for dynamic provisioning | `""` |
2525
| `global.fullnameOverride` | Global storage class for dynamic provisioning | `""` |
2626
| `global.lm_company_name` | LogicMonitor account name | `nil` |
27+
| `global.lm_company_domain` | LogicMonitor company domain name | `logicmonitor.com` |
2728
| `global.lm_access_id` | LogicMonitor API Token Access ID | `nil` |
2829
| `global.lm_access_key` | LogicMonitor API Token Access Key | `nil` |
2930
| `image.repository` | Container image repository | `logicmonitor/lm-logs-k8s-fluentd` |
@@ -34,6 +35,7 @@ The following tables lists the configurable parameters of the lm-logs chart and
3435
| `resources.requests.memory` | Container memory resource requests | `700Mi` |
3536
| `fluent.device_less_logs` | beta feature. when set true, do not send resource information. send `service` and `namespace` as metadata when true | `false` |
3637
| `fluent.include_metadata` | if true send all metadata along with log msg | `true` |
38+
| `fluent.resource_type` | If specified, the value will be statically applied to all ingested logs. | `""` |
3739
| `fluent.buffer.memory` | fluentd's buffer memory plugin config | `flush_interval 1s,chunk_limit_size 8m,flush_thread_count 8`|
3840
| `tolerations` | Tolerations for pod assignment | `{}` (evaluated as a template) |
3941
| `nodeSelectors` | Node labels for pod assignment | `{}` (evaluated as a template) |
@@ -44,7 +46,7 @@ The following tables lists the configurable parameters of the lm-logs chart and
4446
| `kubernetes.multiline_concat_key` | Key to look for fluentD to concatenate multiline logs | `"log"` |
4547

4648

47-
### Avaialble Environment variables
49+
### Available Environment variables
4850
For descriptions see: https://github.com/fabric8io/fluent-plugin-kubernetes_metadata_filter
4951

5052
* FLUENT_LOG_LEVEL
@@ -70,24 +72,24 @@ When `fluent.device_less_logs=true`
7072
Anomaly detection will be done on `namespace` and `service`
7173
- namespace will be k8s namespace
7274
- service will be extracted from metadata for yaml in the following priority.
73-
- kubernetets.labels.app ( deployments )
74-
- kubernetets.labels.app_kubernetes_io/name (daemon sets)
75-
- kubernetets.container_name
76-
- kubernetets.pod_name
75+
- kubernetes.labels.app ( deployments )
76+
- kubernetes.labels.app_kubernetes_io/name (daemon sets)
77+
- kubernetes.container_name
78+
- kubernetes.pod_name
7779

7880
#### Multiline log support for k8s lm logs
7981
To use regexp to match beginning of multiline set `kubernetes.multiline_start_regexp=<some-regex-pattern>`
8082
by default the regex is set to `/^\[(\d{4}-)?\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3}.*\]/`
8183

8284
### Logs appearing in cri format
83-
If conatiner runtime is containerD or cri-o, on lm-logs ui you might see logs with prefix eg.
85+
If container runtime is containerD or cri-o, on lm-logs ui you might see logs with prefix eg.
8486
```
8587
2016-10-06T00:17:09.669794202Z stdout F The content of the log entry 1
8688
```
8789
To solve this we need to install lm-logs with following command :
8890
```
8991
helm upgrade --install -n <namespace> \
90-
--set lm_company_name="<comapny>" \
92+
--set lm_company_name="<company>" \
9193
--set lm_access_id="<access_id>" \
9294
--set lm_access_key="<access_key"> \
9395
--set env.FLUENT_CONTAINER_TAIL_PARSER_TYPE="cri" \

charts/lm-logs/templates/configmap.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ data:
4747
<match kubernetes.**>
4848
@type lm
4949
company_name {{ if .Values.lm_company_name }} {{ .Values.lm_company_name }} {{ else }} {{ required "A valid .Values.lm_company_name or .Values.global.account entry is required!" .Values.global.account }} {{ end }}
50+
company_domain {{ .Values.lm_company_domain | default .Values.global.companyDomain | default "logicmonitor.com" }}
5051
resource_mapping {"kubernetes.pod_name": "auto.name"}
52+
resource_type {{ .Values.fluent.resource_type | default "" }}
5153
{{- if and ( or .Values.lm_access_id .Values.global.accessID ) ( or .Values.lm_access_key .Values.global.accessKey) }}
5254
access_id {{ .Values.lm_access_id | default .Values.global.accessID }}
5355
access_key {{ .Values.lm_access_key | default .Values.global.accessKey }}

charts/lm-logs/values.schema.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,18 @@
9595
],
9696
"$comment": "ui:lm_company_name-ignore tf:optional"
9797
},
98+
"lm_company_domain": {
99+
"$id": "#/properties/lm_company_domain",
100+
"type": "string",
101+
"title": "Logicmonitor domain name",
102+
"description": "The LogicMonitor domain name.nValue should be trimmed from URL \"company1.logicmonitor.com\"\nexample: lmqauat.logicmonitor.com then \"logicmonitor.com\" must be a valid value.",
103+
"default": "",
104+
"examples": [
105+
"logicmonitor.com",
106+
"lmgov.us"
107+
],
108+
"$comment": "ui:lm_company_domain-ignore tf:optional"
109+
},
98110
"clusterName": {
99111
"$id": "#/properties/clusterName",
100112
"type": "string",
@@ -281,6 +293,9 @@
281293
"include_metadata": {
282294
"type": "boolean"
283295
},
296+
"resource_type": {
297+
"type" : "string"
298+
},
284299
"buffer": {
285300
"type": "object",
286301
"additionalProperties": false,

charts/lm-logs/values.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
image:
22
repository: logicmonitor/lm-logs-k8s-fluentd
33
pullPolicy: Always
4-
tag: "1.2.0"
4+
tag: "1.3.0"
55

66
lm_access_id: ""
77
lm_access_key: ""
88
lm_company_name: ""
99
lm_bearer_token: ""
10+
lm_company_domain: ""
1011

1112
global:
1213
accessID: ""
1314
accessKey: ""
1415
account: ""
1516
clusterName: ""
17+
companyDomain: ""
1618

1719
imagePullSecrets: []
1820
nameOverride: ""
@@ -32,6 +34,7 @@ resources:
3234
fluent:
3335
device_less_logs: false
3436
include_metadata: true
37+
resource_type: ""
3538
buffer:
3639
memory:
3740
flush_interval: 1s

0 commit comments

Comments
 (0)