-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add eks/fargate distribution with cluster-receiver-observer deployment
- Loading branch information
Ryan Fitzpatrick
committed
Jan 6, 2022
1 parent
d6f2ca7
commit 2871834
Showing
29 changed files
with
1,628 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea | ||
*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
205 changes: 205 additions & 0 deletions
205
...ts/splunk-otel-collector/templates/config/_otel-eks-fargate-cluster-receiver-observer.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,205 @@ | ||
{{/* | ||
Config for the otel-collector eks/fargate cluster receiver observer deployment. | ||
The values can be overridden in .Values.clusterReceiverObserver.config | ||
*/}} | ||
{{- define "splunk-otel-collector.clusterReceiverObserverConfig" -}} | ||
{{ $gateway := fromYaml (include "splunk-otel-collector.gateway" .) -}} | ||
{{ $clusterReceiverObserver := fromYaml (include "splunk-otel-collector.clusterReceiverObserver" .) -}} | ||
extensions: | ||
health_check: | ||
|
||
memory_ballast: | ||
size_mib: ${SPLUNK_BALLAST_SIZE_MIB} | ||
|
||
# k8s_observer w/ pod and node detection for eks/fargate deployment | ||
k8s_observer: | ||
auth_type: serviceAccount | ||
observe_pods: true | ||
observe_nodes: true | ||
|
||
receivers: | ||
# Prometheus receiver scraping metrics from the pod itself | ||
prometheus/k8s_cluster_receiver: | ||
config: | ||
scrape_configs: | ||
- job_name: 'otel-k8s-cluster-receiver-observer' | ||
scrape_interval: 10s | ||
static_configs: | ||
- targets: ["${K8S_POD_IP}:8889"] | ||
{{- if $clusterReceiverObserver.k8sEventsEnabled }} | ||
smartagent/kubernetes-events: | ||
type: kubernetes-events | ||
alwaysClusterReporter: true | ||
whitelistedEvents: | ||
- reason: Created | ||
involvedObjectKind: Pod | ||
- reason: Unhealthy | ||
involvedObjectKind: Pod | ||
- reason: Failed | ||
involvedObjectKind: Pod | ||
- reason: FailedCreate | ||
involvedObjectKind: Job | ||
{{- end }} | ||
|
||
# dynamically created kubeletstats receiver to report kubelet stats for cluster receiver "node" | ||
receiver_creator/eks-fargate-cluster-receiver: | ||
receivers: | ||
kubeletstats: | ||
rule: type == "k8s.node" && name contains "fargate" && labels["otel-eks-fargate-is-cluster-receiver-node"] == "true" | ||
config: | ||
auth_type: serviceAccount | ||
collection_interval: 10s | ||
endpoint: "`endpoint`:`kubelet_endpoint_port`" | ||
extra_metadata_labels: | ||
- container.id | ||
metric_groups: | ||
- container | ||
- pod | ||
- node | ||
watch_observers: | ||
- k8s_observer | ||
|
||
|
||
processors: | ||
{{- include "splunk-otel-collector.otelMemoryLimiterConfig" . | nindent 2 }} | ||
|
||
batch: | ||
|
||
{{- include "splunk-otel-collector.resourceDetectionProcessor" . | nindent 2 }} | ||
|
||
{{- if and $clusterReceiverObserver.k8sEventsEnabled (eq (include "splunk-otel-collector.o11yMetricsEnabled" .) "true") }} | ||
resource/add_event_k8s: | ||
attributes: | ||
- action: insert | ||
key: kubernetes_cluster | ||
value: {{ .Values.clusterName }} | ||
{{- end }} | ||
|
||
# Resource attributes specific to the collector itself. | ||
resource/add_collector_k8s: | ||
attributes: | ||
- action: insert | ||
key: k8s.node.name | ||
value: "${K8S_NODE_NAME}" | ||
- action: insert | ||
key: k8s.pod.name | ||
value: "${K8S_POD_NAME}" | ||
- action: insert | ||
key: k8s.pod.uid | ||
value: "${K8S_POD_UID}" | ||
- action: insert | ||
key: k8s.namespace.name | ||
value: "${K8S_NAMESPACE}" | ||
|
||
resource: | ||
attributes: | ||
# TODO: Remove once available in mapping service. | ||
- action: insert | ||
key: metric_source | ||
value: kubernetes | ||
# XXX: Added so that Smart Agent metrics and OTel metrics don't map to the same MTS identity | ||
# (same metric and dimension names and values) after mappings are applied. This would be | ||
# the case if somebody uses the same cluster name from Smart Agent and OTel in the same org. | ||
- action: insert | ||
key: receiver | ||
value: k8scluster | ||
- action: upsert | ||
key: k8s.cluster.name | ||
value: {{ .Values.clusterName }} | ||
{{- range .Values.extraAttributes.custom }} | ||
- action: upsert | ||
key: {{ .name }} | ||
value: {{ .value }} | ||
{{- end }} | ||
# Extract "container.image.tag" attribute from "container.image.name" here until k8scluster | ||
# receiver does it natively. | ||
- key: container.image.name | ||
pattern: ^(?P<temp_container_image_name>[^\:]+)(?:\:(?P<temp_container_image_tag>.*))? | ||
action: extract | ||
- key: container.image.name | ||
from_attribute: temp_container_image_name | ||
action: upsert | ||
- key: temp_container_image_name | ||
action: delete | ||
- key: container.image.tag | ||
from_attribute: temp_container_image_tag | ||
action: upsert | ||
- key: temp_container_image_tag | ||
action: delete | ||
|
||
exporters: | ||
{{- if eq (include "splunk-otel-collector.o11yMetricsEnabled" $) "true" }} | ||
signalfx: | ||
{{ if $gateway.enabled }} | ||
ingest_url: http://{{ include "splunk-otel-collector.fullname" . }}:9943 | ||
api_url: http://{{ include "splunk-otel-collector.fullname" . }}:6060 | ||
{{- else }} | ||
ingest_url: {{ include "splunk-otel-collector.o11yIngestUrl" . }} | ||
api_url: {{ include "splunk-otel-collector.o11yApiUrl" . }} | ||
{{- end }} | ||
access_token: ${SPLUNK_OBSERVABILITY_ACCESS_TOKEN} | ||
timeout: 10s | ||
{{- end }} | ||
|
||
{{- if and (eq (include "splunk-otel-collector.logsEnabled" $) "true") $clusterReceiverObserver.k8sEventsEnabled }} | ||
splunk_hec/o11y: | ||
endpoint: {{ include "splunk-otel-collector.o11yIngestUrl" . }}/v1/log | ||
token: "${SPLUNK_OBSERVABILITY_ACCESS_TOKEN}" | ||
sourcetype: kube:events | ||
source: kubelet | ||
{{- end }} | ||
|
||
{{- if (eq (include "splunk-otel-collector.platformMetricsEnabled" .) "true") }} | ||
{{- include "splunk-otel-collector.splunkPlatformMetricsExporter" . | nindent 2 }} | ||
{{- end }} | ||
|
||
service: | ||
extensions: [health_check, memory_ballast, k8s_observer] | ||
pipelines: | ||
# k8s metrics pipeline | ||
metrics: | ||
receivers: [receiver_creator/eks-fargate-cluster-receiver] | ||
processors: [memory_limiter, batch, resource] | ||
exporters: | ||
{{- if (eq (include "splunk-otel-collector.o11yMetricsEnabled" .) "true") }} | ||
- signalfx | ||
{{- end }} | ||
{{- if (eq (include "splunk-otel-collector.platformMetricsEnabled" $) "true") }} | ||
- splunk_hec/platform_metrics | ||
{{- end }} | ||
|
||
{{- if or (eq (include "splunk-otel-collector.splunkO11yEnabled" $) "true") (eq (include "splunk-otel-collector.platformMetricsEnabled" $) "true") }} | ||
# Pipeline for metrics collected about the collector pod itself. | ||
metrics/collector: | ||
receivers: [prometheus/k8s_cluster_receiver] | ||
processors: | ||
- memory_limiter | ||
- batch | ||
- resource | ||
- resource/add_collector_k8s | ||
- resourcedetection | ||
exporters: | ||
{{- if (eq (include "splunk-otel-collector.o11yMetricsEnabled" .) "true") }} | ||
- signalfx | ||
{{- end }} | ||
{{- if (eq (include "splunk-otel-collector.platformMetricsEnabled" $) "true") }} | ||
- splunk_hec/platform_metrics | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- if and $clusterReceiverObserver.k8sEventsEnabled (eq (include "splunk-otel-collector.o11yMetricsEnabled" .) "true") }} | ||
logs/events: | ||
receivers: | ||
- smartagent/kubernetes-events | ||
processors: | ||
- memory_limiter | ||
- batch | ||
- resource | ||
- resource/add_event_k8s | ||
exporters: | ||
- signalfx | ||
{{- if (eq (include "splunk-otel-collector.o11yLogsEnabled" .) "true") }} | ||
- splunk_hec/o11y | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
helm-charts/splunk-otel-collector/templates/configmap-agent.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.