Skip to content
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

Hostname and _sourceHost fix for v0.17 #530

Merged
merged 5 commits into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions deploy/helm/sumologic/conf/traces/traces.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@
source_name_key_name '_sourceName'
collector_key_name '_collector'
collector_value "{{- if .Values.sumologic.collectorName }}{{ .Values.sumologic.collectorName }}{{- else}}{{ .Values.sumologic.clusterName }}{{- end}}"

source_name "#{ENV['SOURCE_NAME']}"
source_host "#{ENV['SOURCE_HOST']}"
log_format "#{ENV['LOG_FORMAT']}"
kubernetes_meta "#{ENV['KUBERNETES_META']}"
kubernetes_meta_reduce "#{ENV['KUBERNETES_META_REDUCE']}"
add_stream "#{ENV['ADD_STREAM']}"
add_time "#{ENV['ADD_TIME']}"
source_category "#{ENV['SOURCE_CATEGORY']}"
source_category_prefix "#{ENV['SOURCE_CATEGORY_PREFIX']}"
source_category_replace_dash "#{ENV['SOURCE_CATEGORY_REPLACE_DASH']}"
exclude_namespace_regex "#{ENV['EXCLUDE_NAMESPACE_REGEX']}"
exclude_pod_regex "#{ENV['EXCLUDE_POD_REGEX']}"
exclude_container_regex "#{ENV['EXCLUDE_CONTAINER_REGEX']}"
exclude_host_regex "#{ENV['EXCLUDE_HOST_REGEX']}"
</filter>
{{- if .Values.sumologic.traces.fluentd_stdout }}
<filter tracing.**>
Expand Down
2 changes: 2 additions & 0 deletions deploy/helm/sumologic/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ spec:
value: {{ .Values.sumologic.sourceCategoryReplaceDash | quote }}
- name: SOURCE_NAME
value: {{ .Values.sumologic.sourceName | quote }}
- name: SOURCE_HOST
value: {{ .Values.sumologic.sourceHost | quote }}
- name: KUBERNETES_META
value: {{ .Values.sumologic.kubernetesMeta | quote }}
- name: KUBERNETES_META_REDUCE
Expand Down
12 changes: 7 additions & 5 deletions deploy/helm/sumologic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ sumologic:
## Set the _sourceName metadata field in SumoLogic.
sourceName: "%{namespace}.%{pod}.%{container}"

## Set the _sourceHost metadata field in SumoLogic.
sourceHost: "%{source_host}"

## Set the _sourceCategory metadata field in SumoLogic.
sourceCategory: "%{namespace}/%{pod_name}"

Expand Down Expand Up @@ -538,7 +541,7 @@ otelcol:
memBallastSizeMib: "683"
image:
name: "sumologic/opentelemetry-collector"
tag: "0.2.7.0"
tag: "0.2.7.1"
pullPolicy: IfNotPresent
config:
receivers:
Expand All @@ -563,6 +566,8 @@ otelcol:
k8s_tagger:
# When true, only IP is assigned and passed (so it could be tagged on another collector)
passthrough: false
# Enable calls for owners
owner_lookup_enabled: true
# Extracted fields and assigned names
extract:
metadata:
Expand All @@ -575,27 +580,24 @@ otelcol:
- hostName
- namespace
- node
- owners
- podId
- podName
- replicaSetName
- serviceName
- startTime
- statefulSetName
tags:
containerId: container_id
containerName: container
cluster: cluster
daemonSetName: daemonset
deployment: deployment
hostName: hostname
hostName: host
namespace: namespace
node: node
podId: pod_id
podName: pod
replicaSetName: replicaset
serviceName: service_name
startTime: start_time
statefulSetName: statefulset
annotations:
- tag_name: pod_annotation_%s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class SumoContainerOutput < Fluent::Plugin::Filter
config_param :source_category_prefix, :string, :default => "kubernetes/"
config_param :source_name, :string, :default => "%{namespace}.%{pod}.%{container}"
config_param :log_format, :string, :default => "json"
config_param :source_host, :string, :default => ""
config_param :source_host, :string, :default => "%{source_host}"
config_param :exclude_container_regex, :string, :default => ""
config_param :exclude_facility_regex, :string, :default => ""
config_param :exclude_host_regex, :string, :default => ""
Expand Down