-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(metrics): use
sumologic.metrics.excludeNamespaceRegex
instead o…
…f `sumologic.logs.container.excludeNamespaceRegex`
- Loading branch information
1 parent
c1964af
commit 3c3c4fc
Showing
8 changed files
with
457 additions
and
1 deletion.
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
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
4 changes: 4 additions & 0 deletions
4
tests/helm/testdata/goldenfile/metadata_metrics_otc/exclude-namespace.input.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
sumologic: | ||
collectionMonitoring: false | ||
metrics: | ||
excludeNamespaceRegex: my_metrics_excludeNamespaceRegex |
201 changes: 201 additions & 0 deletions
201
tests/helm/testdata/goldenfile/metadata_metrics_otc/exclude-namespace.output.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
--- | ||
# Source: sumologic/templates/metrics/otelcol/configmap.yaml | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: RELEASE-NAME-sumologic-otelcol-metrics | ||
namespace: sumologic | ||
labels: | ||
app: RELEASE-NAME-sumologic-otelcol-metrics | ||
chart: "sumologic-%CURRENT_CHART_VERSION%" | ||
release: "RELEASE-NAME" | ||
heritage: "Helm" | ||
data: | ||
config.yaml: | | ||
exporters: | ||
sumologic/default: | ||
decompose_otlp_histograms: true | ||
endpoint: ${SUMO_ENDPOINT_DEFAULT_OTLP_METRICS_SOURCE} | ||
max_request_body_size: 16777216 | ||
metric_format: otlp | ||
sending_queue: | ||
enabled: true | ||
num_consumers: 10 | ||
queue_size: 10000 | ||
storage: file_storage | ||
timeout: 30s | ||
extensions: | ||
file_storage: | ||
compaction: | ||
directory: /tmp | ||
on_rebound: true | ||
directory: /var/lib/storage/otc | ||
timeout: 10s | ||
health_check: {} | ||
pprof: {} | ||
processors: | ||
batch: | ||
send_batch_max_size: 2048 | ||
send_batch_size: 1024 | ||
timeout: 1s | ||
filter/drop_unnecessary_metrics: | ||
error_mode: ignore | ||
metrics: | ||
metric: | ||
- resource.attributes["job"] != "pod-annotations" and IsMatch(name, "scrape_.*") | ||
- IsMatch(name, "^(apiserver_request_duration_seconds|coredns_dns_request_duration_seconds|kubelet_runtime_operations_duration_seconds)$") | ||
groupbyattrs: | ||
keys: | ||
- container | ||
- namespace | ||
- pod | ||
- service | ||
groupbyattrs/group_by_name: | ||
keys: | ||
- __name__ | ||
- job | ||
k8s_tagger: | ||
extract: | ||
delimiter: _ | ||
labels: | ||
- key: '*' | ||
tag_name: pod_labels_%s | ||
metadata: | ||
- daemonSetName | ||
- deploymentName | ||
- nodeName | ||
- replicaSetName | ||
- serviceName | ||
- statefulSetName | ||
owner_lookup_enabled: true | ||
passthrough: false | ||
pod_association: | ||
- from: build_hostname | ||
memory_limiter: | ||
check_interval: 5s | ||
limit_percentage: 75 | ||
spike_limit_percentage: 20 | ||
metricstransform: | ||
transforms: | ||
action: update | ||
include: ^prometheus_remote_write_(.*)$$ | ||
match_type: regexp | ||
new_name: $$1 | ||
resource: | ||
attributes: | ||
- action: upsert | ||
from_attribute: namespace | ||
key: k8s.namespace.name | ||
- action: delete | ||
key: namespace | ||
- action: upsert | ||
from_attribute: pod | ||
key: k8s.pod.name | ||
- action: delete | ||
key: pod | ||
- action: upsert | ||
from_attribute: container | ||
key: k8s.container.name | ||
- action: delete | ||
key: container | ||
- action: upsert | ||
from_attribute: node | ||
key: k8s.node.name | ||
- action: delete | ||
key: node | ||
- action: upsert | ||
from_attribute: service | ||
key: prometheus_service | ||
- action: delete | ||
key: service | ||
- action: upsert | ||
from_attribute: service.name | ||
key: job | ||
- action: delete | ||
key: service.name | ||
- action: upsert | ||
key: _origin | ||
value: kubernetes | ||
- action: upsert | ||
key: cluster | ||
value: kubernetes | ||
resource/delete_source_metadata: | ||
attributes: | ||
- action: delete | ||
key: _sourceCategory | ||
- action: delete | ||
key: _sourceHost | ||
- action: delete | ||
key: _sourceName | ||
resource/remove_k8s_pod_pod_name: | ||
attributes: | ||
- action: delete | ||
key: k8s.pod.pod_name | ||
source: | ||
collector: kubernetes | ||
exclude: | ||
k8s.namespace.name: sumologic|my_metrics_excludeNamespaceRegex | ||
sumologic_schema: | ||
add_cloud_namespace: false | ||
transform/remove_name: | ||
error_mode: ignore | ||
metric_statements: | ||
- context: resource | ||
statements: | ||
- delete_key(attributes, "__name__") | ||
transform/set_name: | ||
error_mode: ignore | ||
metric_statements: | ||
- context: datapoint | ||
statements: | ||
- set(attributes["__name__"], metric.name) where IsMatch(metric.name, "^cloudprovider_.*") | ||
receivers: | ||
otlp: | ||
protocols: | ||
http: | ||
endpoint: 0.0.0.0:4318 | ||
telegraf: | ||
agent_config: | | ||
[agent] | ||
interval = "30s" | ||
flush_interval = "30s" | ||
omit_hostname = true | ||
[[inputs.http_listener_v2]] | ||
# wait longer than prometheus | ||
read_timeout = "30s" | ||
write_timeout = "30s" | ||
service_address = ":9888" | ||
data_format = "prometheusremotewrite" | ||
paths = [ | ||
"/prometheus.metrics" | ||
] | ||
service: | ||
extensions: | ||
- health_check | ||
- file_storage | ||
- pprof | ||
pipelines: | ||
metrics: | ||
exporters: | ||
- sumologic/default | ||
processors: | ||
- memory_limiter | ||
- metricstransform | ||
- groupbyattrs | ||
- resource | ||
- k8s_tagger | ||
- source | ||
- sumologic_schema | ||
- resource/remove_k8s_pod_pod_name | ||
- resource/delete_source_metadata | ||
- transform/set_name | ||
- groupbyattrs/group_by_name | ||
- transform/remove_name | ||
- filter/drop_unnecessary_metrics | ||
- batch | ||
receivers: | ||
- telegraf | ||
- otlp | ||
telemetry: | ||
logs: | ||
level: info |
15 changes: 15 additions & 0 deletions
15
tests/helm/testdata/goldenfile/metadata_metrics_otc/templates.input.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
sumologic: | ||
collectorName: my_collectorName | ||
metrics: | ||
excludeNamespaceRegex: my_metrics_excludeNamespaceRegex | ||
otelcol: | ||
extraProcessors: | ||
- resource/add-metrics-resource-attribute: | ||
attributes: | ||
- action: insert | ||
key: environment | ||
value: staging | ||
- resource/remove-metrics-resource-attribute: | ||
attributes: | ||
- action: delete | ||
key: redundant-attribute |
Oops, something went wrong.