Skip to content

Commit

Permalink
Merge branch 'release-v3' into update-releasing-guide-for-v3
Browse files Browse the repository at this point in the history
  • Loading branch information
dmolenda-sumo authored Sep 21, 2023
2 parents 4d35cee + 279470a commit 89594d3
Show file tree
Hide file tree
Showing 11 changed files with 830 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changelog/3281.fixed.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
fix(logs)!: move JSON parsing after user-defined processors

The log body will now always be a string if accessed in extra processors.
Users who want to access specific fields in their parsed JSON log
should explicitly call ParseJSON in their processor definition.
1 change: 1 addition & 0 deletions .changelog/3286.added.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
feat(logs): add `sumologic.logs.additionalFields` property
1 change: 1 addition & 0 deletions deploy/helm/sumologic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ The following table lists the configurable parameters of the Sumo Logic chart an
| `sumologic.logs.defaultFluentd.excludePriorityRegex` | Configuration option only for Fluentd, a regular expression for priority. Matching priority will be excluded from Sumo. The logs will still be sent to FluentD. | `""` |
| `sumologic.logs.defaultFluentd.excludeUnitRegex` | Configuration option only for Fluentd, a regular expression for unit. Matching unit will be excluded from Sumo. The logs will still be sent to FluentD. . | `""` |
| `sumologic.logs.fields` | Fields to be created at Sumo Logic to ensure logs are tagged with relevant metadata. [Sumo Logic help](https://help.sumologic.com/docs/manage/fields/#manage-fields) | `["cluster", "container", "daemonset", "deployment", "host", "namespace", "node", "pod", "service", "statefulset"]` |
| `sumologic.logs.additionalFields` | Additional Fields to be created in Sumo Logic. [Sumo Logic help](https://help.sumologic.com/docs/manage/fields/#manage-fields) | `[]` |
| `sumologic.logs.metadata.provider` | Defines logs metadata enrichment provider - `otelcol` or `fluentd`. `otelcol` is the default and is recommended. `fluentd` is deprecated. | `otelcol` |
| `sumologic.logs.sourceType` | The type of the Sumo Logic source being used for logs ingestion. Can be `http` for [HTTP Source](https://help.sumologic.com/docs/send-data/hosted-collectors/http-source/logs-metrics/) or `otlp` for [OTLP/HTTP Source](https://help.sumologic.com/docs/send-data/hosted-collectors/http-source/otlp/). | `http` |
| `sumologic.metrics.enabled` | Set the enabled flag to false for disabling metrics ingestion altogether. | `true` |
Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/sumologic/conf/logs/otelcol/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -583,12 +583,12 @@ service:
- resource/containers_copy_node_to_host
- sumologic_schema
- source/containers
- transform/containers_parse_json
{{- if .Values.sumologic.logs.container.otelcol.extraProcessors }}
{{- range $processor := .Values.sumologic.logs.container.otelcol.extraProcessors }}
{{ printf "- %s" ( $processor | keys | first ) | indent 8 }}
{{- end }}
{{- end }}
- transform/containers_parse_json
- resource/remove_pod_name
- resource/drop_annotations
- transform/add_timestamp
Expand Down
16 changes: 16 additions & 0 deletions deploy/helm/sumologic/conf/setup/fields.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,19 @@ resource "sumologic_field" {{ $value | quote }} {
state = "Enabled"
}
{{- end }}

{{- range $value := .Values.sumologic.logs.additionalFields }}
resource "sumologic_field" {{ $value | quote }} {
count = var.create_fields ? 1 : 0

lifecycle {
# ignore changes for name and type, as older installations have been case sensitive
# see: https://github.com/SumoLogic/sumologic-kubernetes-collection/issues/2865
ignore_changes = [field_name, data_type]
}

field_name = {{ $value | quote }}
data_type = "String"
state = "Enabled"
}
{{- end }}
4 changes: 4 additions & 0 deletions deploy/helm/sumologic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,10 @@ sumologic:
- service
- statefulset

## Additional fields to be created in Sumo Logic.
## https://help.sumologic.com/docs/manage/fields/#manage-fields
additionalFields: []

sourceType: http

### Metrics configuration
Expand Down
2 changes: 2 additions & 0 deletions docs/opentelemetry-collector/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ sumologic:
collector:
otelcol:
enabled: true
remoteWriteProxy:
enabled: false

kube-prometheus-stack:
prometheus:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,9 @@ data:
- resource/containers_copy_node_to_host
- sumologic_schema
- source/containers
- transform/containers_parse_json
- resource/add-resource-attribute-container
- resource/remove-container
- transform/containers_parse_json
- resource/remove_pod_name
- resource/drop_annotations
- transform/add_timestamp
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sumologic:
logs:
additionalFields:
- addfield1
- addfield2
Loading

0 comments on commit 89594d3

Please sign in to comment.