-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring Observability stack (#6333)
* feat(opentelemetry): Refactoring Operator and Collector Signed-off-by: Nicolas Lamirault <[email protected]> * feat(argo-cd): typo Signed-off-by: Nicolas Lamirault <[email protected]> * feat(alloy): refactoring stack Signed-off-by: Nicolas Lamirault <[email protected]> * feat(opentelemetry): cleanup Signed-off-by: Nicolas Lamirault <[email protected]> --------- Signed-off-by: Nicolas Lamirault <[email protected]>
- Loading branch information
1 parent
61aa7ca
commit 914cdab
Showing
66 changed files
with
1,770 additions
and
694 deletions.
There are no files selected for viewing
Binary file not shown.
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,37 @@ | ||
# SPDX-FileCopyrightText: Copyright (C) Nicolas Lamirault <[email protected]> | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
--- | ||
apiVersion: v2 | ||
type: application | ||
name: alloy | ||
version: 1.0.0 | ||
appVersion: 1.0.0 | ||
dependencies: | ||
- name: alloy | ||
repository: https://grafana.github.io/helm-charts | ||
version: 0.11.0 | ||
alias: alloy-metrics | ||
- name: alloy | ||
repository: https://grafana.github.io/helm-charts | ||
version: 0.11.0 | ||
alias: alloy-logs | ||
- name: alloy | ||
repository: https://grafana.github.io/helm-charts | ||
version: 0.11.0 | ||
alias: alloy-traces | ||
- name: alloy | ||
repository: https://grafana.github.io/helm-charts | ||
version: 0.11.0 | ||
alias: alloy-events | ||
- name: alloy | ||
repository: https://grafana.github.io/helm-charts | ||
version: 0.11.0 | ||
alias: alloy-profiles | ||
- name: alloy | ||
repository: https://grafana.github.io/helm-charts | ||
version: 0.11.0 | ||
alias: alloy-frontend | ||
- name: alloy-mixin | ||
repository: oci://ghcr.io/portefaix/charts | ||
version: 0.3.1 |
File renamed without changes.
24 changes: 24 additions & 0 deletions
24
gitops/argocd/charts/opentelemetry/alloy-otel/templates/alloy/_global.alloy
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,24 @@ | ||
{{ define "alloy.config.global" }} | ||
|
||
// ******************************************** | ||
// * G E N E R A L | ||
// ******************************************** | ||
|
||
local.file "cluster_name" { | ||
filename = "/etc/alloy/cluster_name" | ||
} | ||
|
||
logging { | ||
level = "info" | ||
format = "json" | ||
} | ||
|
||
// tracing { | ||
// sampling_fraction = 1 | ||
// write_to = [ | ||
// otelcol.exporter.otlp.local.input, | ||
// // otelcol.exporter.otlp.grafana_cloud.input | ||
// ] | ||
// } | ||
|
||
{{ end }} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
54 changes: 54 additions & 0 deletions
54
...argocd/charts/opentelemetry/alloy-otel/templates/alloy/endpoints/_endpoints_metrics.alloy
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,54 @@ | ||
{{ define "alloy.config.endpoints.metrics" }} | ||
|
||
// ******************************************** | ||
// * M E T R I C S | ||
// ******************************************** | ||
|
||
// [Mimir Local] | ||
|
||
prometheus.remote_write "local" { | ||
endpoint { | ||
url = {{ .Values.observability.metrics.prometheus | quote }} | ||
|
||
headers = { | ||
// "X-Scope-OrgID" = {{ .Values.observability.cluster_name | quote }}, | ||
"X-Scope-OrgID" = local.file.cluster_name.content, | ||
} | ||
} | ||
|
||
external_labels = { | ||
// cluster = {{ .Values.observability.cluster_name | quote }}, | ||
cluster = local.file.cluster_name.content, | ||
{{- range $k, $v := .Values.observability.metrics.externalLabels }} | ||
{{ $k }} = {{ $v | quote }}, | ||
{{- end }} | ||
} | ||
} | ||
|
||
// [Grafana Cloud] | ||
|
||
prometheus.remote_write "grafana_cloud" { | ||
endpoint { | ||
url = {{ .Values.observability.metrics.grafana_cloud | quote }} | ||
|
||
basic_auth { | ||
username = env("GRAFANA_CLOUD_METRICS_ID") | ||
password = env("GRAFANA_CLOUD_METRICS_APIKEY") | ||
} | ||
|
||
headers = { | ||
// "X-Scope-OrgID" = {{ .Values.observability.cluster_name | quote }}, | ||
"X-Scope-OrgID" = local.file.cluster_name.content, | ||
} | ||
} | ||
|
||
external_labels = { | ||
// cluster = {{ .Values.observability.cluster_name | quote }}, | ||
cluster = local.file.cluster_name.content, | ||
{{- range $k, $v := .Values.observability.metrics.externalLabels }} | ||
{{ $k }} = {{ $v | quote }}, | ||
{{- end }} | ||
} | ||
} | ||
|
||
{{ end }} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
52 changes: 52 additions & 0 deletions
52
...gocd/charts/opentelemetry/alloy-otel/templates/alloy/metrics/_metrics_prom_operator.alloy
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,52 @@ | ||
{{ define "alloy.config.metrics.prom_operator" }} | ||
|
||
// ******************************************** | ||
// * P R O M E T H E U S O P E R A T O R | ||
// ******************************************** | ||
|
||
// ServiceMonitor | ||
|
||
prometheus.operator.servicemonitors "service_monitors" { | ||
forward_to = [ | ||
prometheus.remote_write.local.receiver, | ||
// prometheus.remote_write.grafana_cloud.receiver, | ||
] | ||
|
||
selector { | ||
match_labels = { | ||
monitoring = "portefaix", | ||
} | ||
} | ||
} | ||
|
||
// PodMonitor | ||
|
||
prometheus.operator.podmonitors "pod_monitors" { | ||
forward_to = [ | ||
prometheus.remote_write.local.receiver, | ||
// prometheus.remote_write.grafana_cloud.receiver, | ||
] | ||
|
||
selector { | ||
match_labels = { | ||
monitoring = "portefaix", | ||
} | ||
} | ||
} | ||
|
||
// Probes | ||
|
||
prometheus.operator.probes "probes" { | ||
forward_to = [ | ||
prometheus.remote_write.local.receiver, | ||
// prometheus.remote_write.grafana_cloud.receiver, | ||
] | ||
|
||
selector { | ||
match_labels = { | ||
monitoring = "portefaix", | ||
} | ||
} | ||
} | ||
|
||
{{ end }} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
49 changes: 49 additions & 0 deletions
49
gitops/argocd/charts/opentelemetry/alloy-otel/templates/configmap-metrics.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,49 @@ | ||
# SPDX-FileCopyrightText: Copyright (C) Nicolas Lamirault <[email protected]> | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
{{- with .Values.additionalAnnotations }} | ||
annotations: | ||
{{ toYaml . | indent 4 }} | ||
{{- end }} | ||
labels: | ||
{{- include "alloy.labels" (index .Subcharts "alloy-metrics") | nindent 4 }} | ||
portefaix.xyz/version: v0.54.0 | ||
name: {{ include "alloy.fullname" (index .Subcharts "alloy-metrics") }} | ||
namespace: {{ .Release.Namespace }} | ||
data: | ||
cluster_name: {{ .Values.observability.cluster_name }} | ||
config.alloy: |- | ||
{{- include "alloy.config.global" . | indent 4}} | ||
|
||
{{- include "alloy.config.portefaix" . | indent 4 }} | ||
|
||
{{- include "alloy.config.endpoints.metrics" . | indent 4 }} | ||
|
||
{{- include "alloy.config.metrics.router" . | indent 4 }} | ||
{{- include "alloy.config.metrics.otlp" . | indent 4 }} | ||
{{- include "alloy.config.metrics.prom_operator" . | indent 4 }} | ||
{{- include "alloy.config.metrics.rules" . | indent 4 }} | ||
|
||
{{- if .Values.observability.cloud.aws.enabled -}} | ||
{{- include "alloy.config.cloud.aws" . | indent 4 }} | ||
{{- end }} | ||
|
||
{{- if .Values.observability.cloud.azure.enabled -}} | ||
{{- include "alloy.config.cloud.azure" . | indent 4 }} | ||
{{- end }} | ||
|
||
{{- if .Values.observability.cloud.gcp.enable -}} | ||
{{- include "alloy.config.cloud.gcp" . | indent 4 }} | ||
{{- end }} | ||
|
||
{{- if .Values.observability.cloud.digitalocean.enabled -}} | ||
{{- include "alloy.config.cloud.digitalocean" . | indent 4 }} | ||
{{- end }} | ||
|
||
{{- if .Values.observability.cloud.scaleway.enabled -}} | ||
{{- include "alloy.config.cloud.scaleway" . | indent 4 }} | ||
{{- end }} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.