Skip to content

Commit

Permalink
Refactor filter-container-metrics example to add-filter-processor and…
Browse files Browse the repository at this point in the history
… expand content (#811)
  • Loading branch information
jvoravong committed Jun 19, 2023
1 parent 2b30170 commit 2baa7c0
Show file tree
Hide file tree
Showing 14 changed files with 678 additions and 66 deletions.
7 changes: 7 additions & 0 deletions examples/add-filter-processor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Example of chart configuration

## Filter Processor
The
[filter processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/filterprocessor#filter-processor)
determines when telemetry data should be dropped. If any condition
is met, the telemetry data is dropped.
82 changes: 82 additions & 0 deletions examples/add-filter-processor/add-filter-processor-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
clusterName: CHANGEME
splunkObservability:
realm: CHANGEME
accessToken: CHANGEME
metricsEnabled: true
tracesEnabled: true
logsEnabled: true

agent:
config:
processors:
# Exclude specific metrics from containers named 'containerXName' or 'containerYName'
filter/exclude_metrics_from_container:
metrics:
exclude:
match_type: regexp
resource_attributes:
- key: k8s.container.name
value: '^(containerXName|containerYName)$'
# Exclude logs from pods named 'podNameX'
filter/exclude_logs_from_pod:
logs:
exclude:
match_type: regexp
resource_attributes:
- key: k8s.pod.name
value: '^(podNameX)$'
# Exclude logs from nodes named 'nodeNameX'
filter/exclude_logs_from_node:
logs:
exclude:
match_type: regexp
resource_attributes:
- key: k8s.node.name
value: '^(nodeNameX)$'
# Exclude spans from traces for services housed in containers named 'containerXName' or 'containerYName'
filter/exclude_spans_from_traces_from_container:
spans:
exclude:
match_type: regexp
attributes:
- key: k8s.container.name
value: '^(containerXName|containerYName)$'
# Exclude all telemetry data (metrics, logs, traces) from a namespace named 'namespaceX'
filter/exclude_all_telemetry_data_from_namespace:
logs:
exclude:
match_type: regexp
resource_attributes:
- key: k8s.namespace.name
value: '^(namespaceX)$'
metrics:
exclude:
match_type: regexp
resource_attributes:
- key: k8s.namespace.name
value: '^(namespaceX)$'
traces:
span:
- 'attributes["k8s.namespace.name"] != "namespaceX"'
# Exclude metrics from a cluster named 'clusterX'
filter/exclude_metrics_from_cluster:
metrics:
exclude:
match_type: regexp
resource_attributes:
- key: k8s.cluster.name
value: '^(clusterX)$'
# Define the data processing pipelines for logs, metrics, and traces
service:
pipelines:
logs:
processors:
- memory_limiter
- k8sattributes
- filter/logs
- batch
- resourcedetection
- resource
- resource/logs
- filter/exclude_logs_from_pod
- filter/exclude_logs_from_node
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,21 @@ metadata:
data:
relay: |
exporters:
sapm:
access_token: ${SPLUNK_OBSERVABILITY_ACCESS_TOKEN}
endpoint: https://ingest.CHANGEME.signalfx.com/v2/trace
signalfx:
access_token: ${SPLUNK_OBSERVABILITY_ACCESS_TOKEN}
api_url: https://api.CHANGEME.signalfx.com
correlation: null
ingest_url: https://ingest.CHANGEME.signalfx.com
sync_host_metadata: true
splunk_hec/o11y:
disable_compression: true
endpoint: https://ingest.CHANGEME.signalfx.com/v1/log
log_data_enabled: true
profiling_data_enabled: false
token: ${SPLUNK_OBSERVABILITY_ACCESS_TOKEN}
extensions:
health_check: null
k8s_observer:
Expand All @@ -33,13 +42,57 @@ data:
zpages: null
processors:
batch: null
filter/exclude_containers:
filter/exclude_all_telemetry_data_from_namespace:
logs:
exclude:
match_type: regexp
resource_attributes:
- key: k8s.namespace.name
value: ^(namespaceX)$
metrics:
exclude:
match_type: regexp
resource_attributes:
- key: k8s.namespace.name
value: ^(namespaceX)$
traces:
span:
- attributes["k8s.namespace.name"] != "namespaceX"
filter/exclude_logs_from_node:
logs:
exclude:
match_type: regexp
resource_attributes:
- key: k8s.node.name
value: ^(nodeNameX)$
filter/exclude_logs_from_pod:
logs:
exclude:
match_type: regexp
resource_attributes:
- key: k8s.pod.name
value: ^(podNameX)$
filter/exclude_metrics_from_cluster:
metrics:
exclude:
match_type: regexp
resource_attributes:
- Key: k8s.container.name
Value: ^(containerX|containerY)$
- key: k8s.cluster.name
value: ^(clusterX)$
filter/exclude_metrics_from_container:
metrics:
exclude:
match_type: regexp
resource_attributes:
- key: k8s.container.name
value: ^(containerXName|containerYName)$
filter/exclude_spans_from_traces_from_container:
spans:
exclude:
attributes:
- key: k8s.container.name
value: ^(containerXName|containerYName)$
match_type: regexp
filter/logs:
logs:
exclude:
Expand Down Expand Up @@ -140,6 +193,8 @@ data:
override: true
timeout: 10s
receivers:
fluentforward:
endpoint: 0.0.0.0:8006
hostmetrics:
collection_interval: 10s
scrapers:
Expand All @@ -151,6 +206,12 @@ data:
network: null
paging: null
processes: null
jaeger:
protocols:
grpc:
endpoint: 0.0.0.0:14250
thrift_http:
endpoint: 0.0.0.0:14268
kubeletstats:
auth_type: serviceAccount
collection_interval: 10s
Expand Down Expand Up @@ -224,13 +285,34 @@ data:
- k8s_observer
signalfx:
endpoint: 0.0.0.0:9943
smartagent/signalfx-forwarder:
listenAddress: 0.0.0.0:9080
type: signalfx-forwarder
zipkin:
endpoint: 0.0.0.0:9411
service:
extensions:
- health_check
- k8s_observer
- memory_ballast
- zpages
pipelines:
logs:
exporters:
- splunk_hec/o11y
processors:
- memory_limiter
- k8sattributes
- filter/logs
- batch
- resourcedetection
- resource
- resource/logs
- filter/exclude_logs_from_pod
- filter/exclude_logs_from_node
receivers:
- fluentforward
- otlp
metrics:
exporters:
- signalfx
Expand All @@ -239,7 +321,6 @@ data:
- batch
- resourcedetection
- resource
- filter/exclude_containers
receivers:
- hostmetrics
- kubeletstats
Expand All @@ -257,6 +338,21 @@ data:
- resource
receivers:
- prometheus/agent
traces:
exporters:
- sapm
- signalfx
processors:
- memory_limiter
- k8sattributes
- batch
- resourcedetection
- resource
receivers:
- otlp
- jaeger
- smartagent/signalfx-forwarder
- zipkin
telemetry:
metrics:
address: 0.0.0.0:8889
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ data:
processors:
batch:
send_batch_max_size: 32768
filter/exclude_containers:
metrics:
exclude:
match_type: regexp
resource_attributes:
- Key: k8s.container.name
Value: ^(containerX|containerY)$
memory_limiter:
check_interval: 2s
limit_mib: ${SPLUNK_MEMORY_LIMIT_MIB}
Expand Down Expand Up @@ -98,7 +91,6 @@ data:
- batch
- resource
- resource/k8s_cluster
- filter/exclude_containers
receivers:
- k8s_cluster
metrics/collector:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
# Source: splunk-otel-collector/templates/configmap-fluentd-json.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: default-splunk-otel-collector-fluentd-json
labels:
app.kubernetes.io/name: splunk-otel-collector
helm.sh/chart: splunk-otel-collector-0.79.0
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: default
app.kubernetes.io/version: "0.79.0"
app: splunk-otel-collector
chart: splunk-otel-collector-0.79.0
release: default
heritage: Helm
data:
source.containers.parse.conf: |-
@type json
time_format %Y-%m-%dT%H:%M:%S.%NZ
output.filter.conf: ""

output.transform.conf: ""
Loading

0 comments on commit 2baa7c0

Please sign in to comment.