Skip to content

Commit

Permalink
fix: labelling, docs, grafana telemetry, pepr action
Browse files Browse the repository at this point in the history
  • Loading branch information
mjnagel committed Sep 17, 2024
1 parent 970d358 commit 01c1500
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 22 deletions.
3 changes: 3 additions & 0 deletions src/grafana/values/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ grafana.ini:
reporting_enabled: false
check_for_updates: false
check_for_plugin_updates: false
feedback_links_enabled: false
plugins:
public_key_retrieval_disabled: true
auth:
# Disable the login form to force users to use SSO
disable_login_form: true
Expand Down
4 changes: 3 additions & 1 deletion src/pepr/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ components:
actions:
onDeploy:
before:
- cmd: |
- mute: true
description: "Update helm ownership for Pepr resources if necessary during the upgrade"
cmd: |
./zarf tools kubectl annotate secret -n pepr-system pepr-uds-core-api-token meta.helm.sh/release-name=module --overwrite || true
./zarf tools kubectl annotate secret -n pepr-system pepr-uds-core-module meta.helm.sh/release-name=module --overwrite || true
./zarf tools kubectl annotate secret -n pepr-system pepr-uds-core-tls meta.helm.sh/release-name=module --overwrite || true
Expand Down
4 changes: 2 additions & 2 deletions src/vector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ As with any decisions of tooling in core this can always be reevaluated in the f

### Upgrade Considerations

During the upgrade there may be some duplication/overlap of log lines shipped to Loki due to the transition from Promtail's "position" file to Vector's "checkpoint" file (both used for tracking the last log line scraped/shipped). Grafana provides a built in feature to de-duplicate log entries when querying Loki, but this does not consistently work with all log lines due to the approach used for de-duplication.
During the upgrade there may be some duplication/overlap of log lines shipped to Loki due to the transition from Promtail's "position" file to Vector's "checkpoint" file (both used for tracking the last log line scraped/shipped). Grafana provides a built in feature to de-duplicate log entries when querying Loki, but this does not consistently work with all log lines due to the approach used by Grafana for de-duplication.

To ensure easy querying of logs across the upgrade, all logs shipped by Vector also have a `collector` label (with the value of `vector`). This can be used to filter down any logs to either what was collected by Vector or what was not collected by Vector (using the `=` and `!=` operators). In general you can use these filters to filter so that any log timestamps from before your upgrade are not collected by Vector and vice-verse post-upgrade.
To ensure easy querying of logs across the upgrade, all logs shipped by Vector also have a `collector` label (with the value of `vector`). This can be used to filter down any logs to those collected by either Vector or Promtail (using the `=` and `!=` operators). In general you can use these filters along with tracking your upgrade timing to properly ignore duplicate logs for the short upgrade period.
37 changes: 18 additions & 19 deletions src/vector/values/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,22 @@ customConfig:
type: remap
inputs: ["pod_logs"]
source: |
if !exists(.kubernetes.pod_labels.app) {
if exists(.kubernetes.pod_labels."app.kubernetes.io/name") {
.kubernetes.pod_labels.app = .kubernetes.pod_labels."app.kubernetes.io/name"
} else if exists(.kubernetes.pod_labels.name) {
.kubernetes.pod_labels.app = .kubernetes.pod_labels.name
} else if exists(.kubernetes.pod_owner) {
.kubernetes.pod_labels.app = .kubernetes.pod_owner
} else {
.kubernetes.pod_labels.app = .kubernetes.pod_name
}
if exists(.kubernetes.pod_labels."app.kubernetes.io/name") {
.app = .kubernetes.pod_labels."app.kubernetes.io/name"
} else if exists(.kubernetes.pod_labels.app) {
.app = .kubernetes.pod_labels.app
} else if exists(.kubernetes.pod_owner) {
.app = replace!(.kubernetes.pod_owner, r'^([^/]+/)', "")
} else {
.app = .kubernetes.pod_name
}
if !exists(.kubernetes.pod_labels.component) {
if exists(.kubernetes.pod_labels."app.kubernetes.io/component") {
.kubernetes.pod_labels.component = .kubernetes.pod_labels."app.kubernetes.io/component"
} else {
.kubernetes.pod_labels.component = ""
}
if exists(.kubernetes.pod_labels."app.kubernetes.io/component") {
.component = .kubernetes.pod_labels."app.kubernetes.io/component"
} else if !exists(.kubernetes.pod_labels.component) {
.component = .kubernetes.pod_labels.component
} else {
.component = ""
}
node_logs_labelled:
Expand All @@ -62,10 +61,10 @@ customConfig:
codec: "raw_message"
labels:
namespace: '{{`{{ kubernetes.pod_namespace }}`}}'
app: '{{`{{ kubernetes.pod_labels.app }}`}}'
job: '{{`{{ kubernetes.pod_namespace }}`}}/{{`{{ kubernetes.pod_labels.app }}`}}'
app: '{{`{{ app }}`}}'
job: '{{`{{ kubernetes.pod_namespace }}`}}/{{`{{ app }}`}}'
container: '{{`{{ kubernetes.container_name }}`}}'
component: '{{`{{ kubernetes.pod_labels.component }}`}}'
component: '{{`{{ component }}`}}'
host: '{{`{{ kubernetes.pod_node_name }}`}}'
filename: '{{`{{ file }}`}}'
collector: "vector"
Expand Down

0 comments on commit 01c1500

Please sign in to comment.