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

feat: add option to specify additionalEndpoints for metrics #2788

Merged
merged 6 commits into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions deploy/helm/sumologic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,8 @@ The following table lists the configurable parameters of the Sumo Logic chart an
| `metadata.metrics.logLevel` | Flag to control logging level for OpenTelemetry Collector for metrics. Can be `debug`, `info`, `warn`, `error`, `dpanic`, `panic`, `fatal`. | `info` |
| `metadata.metrics.config.merge` | Configuration for metrics metadata otelcol, merged with defaults. See also https://github.com/SumoLogic/sumologic-otel-collector/blob/main/docs/configuration.md. | {} |
| `metadata.metrics.config.override` | Configuration for metrics metadata otelcol, replaces defaults.See also https://github.com/SumoLogic/sumologic-otel-collector/blob/main/docs/configuration.md. | {} |
| `metadata.metrics.config.extraProcessors` | Extra processors configuration for metrics pipeline. See [/docs/collecting-application-metrics.md#metrics-modifications](/docs/collecting-application-metrics.md#metrics-modifications) for more information. | `[]` |
sumo-drosiek marked this conversation as resolved.
Show resolved Hide resolved
| `metadata.metrics.config.additionalEndpoints` | List of additional endpoints for Open Telemetry Metadata Pod. | `[]` |
| `metadata.metrics.statefulset.containers.otelcol.startupProbe` | Startup probe configuration for metrics otelcol container. | `{"periodSeconds": 3, "failureThreshold": 60}` |
| `metadata.metrics.statefulset.nodeSelector` | Node selector for metrics metadata enrichment (otelcol) statefulset. [See docs/best-practices.md for more information.](/docs/best-practices.md) | `{}` |
| `metadata.metrics.statefulset.tolerations` | Tolerations for metrics metadata enrichment (otelcol) statefulset. | `[]` |
Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/sumologic/conf/metrics/otelcol/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ receivers:
data_format = "prometheusremotewrite"
path_tag = true
paths = [
{{ include "metric.remotewrites" . | indent 10 }}
{{ include "metric.endpoints" . | indent 10 }}
]
extensions:
health_check: {}
Expand Down
19 changes: 11 additions & 8 deletions deploy/helm/sumologic/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -1558,18 +1558,21 @@ Example Usage:
{{/*
Generate list of remoteWrite endpoints for telegraf configuration

'{{ include "metric.remotewrites" . }}'
'{{ include "metric.endpoints" . }}'
*/}}
{{- define "metric.remotewrites" -}}
{{- $remoteWrites := list -}}
{{- define "metric.endpoints" -}}
{{- $endpoints := list -}}
{{- $kps := get .Values "kube-prometheus-stack" -}}
{{- range $remoteWrite := $kps.prometheus.prometheusSpec.remoteWrite }}
{{- $remoteWrites = append $remoteWrites ($remoteWrite.url | trimPrefix "http://$(METADATA_METRICS_SVC).$(NAMESPACE).svc.cluster.local.:9888" | quote) -}}
{{- $endpoints = append $endpoints ($remoteWrite.url | trimPrefix "http://$(METADATA_METRICS_SVC).$(NAMESPACE).svc.cluster.local.:9888" | quote) -}}
{{- end }}
{{- range $remoteWrite := $kps.prometheus.prometheusSpec.additionalRemoteWrite }}
{{- $remoteWrites = append $remoteWrites ($remoteWrite.url | trimPrefix "http://$(METADATA_METRICS_SVC).$(NAMESPACE).svc.cluster.local.:9888" | quote) -}}
{{- $endpoints = append $endpoints ($remoteWrite.url | trimPrefix "http://$(METADATA_METRICS_SVC).$(NAMESPACE).svc.cluster.local.:9888" | quote) -}}
{{- end -}}
{{- $remoteWrites := uniq $remoteWrites -}}
{{- $remoteWrites := sortAlpha $remoteWrites -}}
{{ $remoteWrites | join ",\n" }}
{{- range $endpoint := $kps.metadata.metrics.config.additionalEndpoints }}
{{- $endpoints = append $endpoints ($endpoint.url | quote) -}}
{{- end -}}
{{- $endpoints := uniq $endpoints -}}
{{- $endpoints := sortAlpha $endpoints -}}
{{ $endpoints | join ",\n" }}
{{- end -}}
3 changes: 3 additions & 0 deletions deploy/helm/sumologic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3822,6 +3822,9 @@ metadata:
## This is an advanced feature, use with caution, and review the generated configuration first.
override: {}

## List of additional endpoints to be handled by Metrics Metadata Pods
additionalEndpoints: []

sumo-drosiek marked this conversation as resolved.
Show resolved Hide resolved
statefulset:
nodeSelector: {}
tolerations: []
Expand Down