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(metric-architecture)!: remove loggregator support and make log-cache the default metric source #2983

Merged
merged 39 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
5c61ef1
cleanup pipeline from all loggregator things
geigerj0 Jun 4, 2024
0b19997
format make-file a bit
geigerj0 Jun 4, 2024
907e134
fix pipeline creation when git-branch contains slashes
geigerj0 Jun 4, 2024
c18b1fb
remove non-working script (yq ".releases[].url" is always null)
geigerj0 Jun 4, 2024
8ff7bab
exchange manifest in issue template
geigerj0 Jun 4, 2024
7a97c49
make app-autoscaler the default manifest during manifest-tests
geigerj0 Jun 4, 2024
abbcfea
cleanup readme and reduce it to a bare minimum
geigerj0 Jun 4, 2024
29e8ee0
remove unused app-autoscaler-deployment.yml manifest
geigerj0 Jun 4, 2024
d80ef7d
merge configure-log-cache-and-forward-metrics-via-mtls.yml into app-a…
geigerj0 Jun 5, 2024
dcd8592
disable requirement of succeeded jobs for testing
geigerj0 Jun 5, 2024
b7a934d
align make target names
geigerj0 Jun 5, 2024
4a0e805
remove metricsserver and metricsgateway from deployment manifest temp…
geigerj0 Jun 5, 2024
3012a3e
remove unused loggregator certificates and ops-files
geigerj0 Jun 5, 2024
69c439e
fix phony of make-target
geigerj0 Jun 5, 2024
501ea8c
delete job and package of metricsserver and metricsgateway
geigerj0 Jun 5, 2024
fc67f0e
remove metricsserver and metricsgateway code, adjust integration test…
geigerj0 Jun 7, 2024
ffcd3e2
remove metricsserver and metricsgateway from drawings, delete outdate…
geigerj0 Jun 7, 2024
0789f64
remove websockethandler that has no usage
geigerj0 Jun 11, 2024
b5d19af
remove use_log_cache feature flag, make metricclientfactory always re…
geigerj0 Jun 11, 2024
7c1e226
merge main
geigerj0 Jun 11, 2024
316032d
remove forgotten metricsserver/metricsgateway occurences in ops file
geigerj0 Jun 11, 2024
eb6b7f2
remove info that operator uses appinstancemetrics table that is no lo…
geigerj0 Jun 11, 2024
70f98d2
merge main
geigerj0 Jun 12, 2024
f68e224
replace direct credhub references with variables in manifest template
geigerj0 Jun 14, 2024
478d7d4
remove example operations
geigerj0 Jun 14, 2024
d8894de
revert "disable requirement of succeeded jobs for testing"
geigerj0 Jun 14, 2024
d9c98eb
delete test related to metricsserver
geigerj0 Jun 14, 2024
fc345a1
restore accidentally deleted diagram
geigerj0 Jun 14, 2024
7b34491
remove leftover occurences of instancemetrics_db
geigerj0 Jun 14, 2024
0df1171
remove leftover arrow to metricsserver url
geigerj0 Jun 14, 2024
716204b
move liquibase file that deletes the appinstancemetrics table to the …
geigerj0 Jun 14, 2024
7fb45eb
bring back the autoscaler-diagram
geigerj0 Jun 14, 2024
655432e
merge main
geigerj0 Jun 14, 2024
3fdc401
use mTLS instead of UAA for log cache connection
geigerj0 Jun 14, 2024
16f04ba
return err on .Start() and expose a function to retrieve url via .URL()
geigerj0 Jun 14, 2024
4d34f66
copy liquibasefile during packaging
geigerj0 Jun 14, 2024
3f4e6df
remove merge leftovers
geigerj0 Jun 14, 2024
1478296
improve readme
geigerj0 Jun 14, 2024
2442a53
Merge branch 'main' into appautoscaler-703/make-logcache-default
bonzofenix Jun 17, 2024
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: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Describe your issue here.
* Version of app-autoscaler-release
* Specify the database (postgres/mysql) along-with it's version
* How did you deploy the release?
* Is your manifest based on [app-autoscaler-deployment.yml](https://github.com/cloudfoundry/app-autoscaler-release/blob/main/templates/app-autoscaler-deployment.yml)?
* Is your manifest based on [app-autoscaler.yml](https://github.com/cloudfoundry/app-autoscaler-release/blob/main/templates/app-autoscaler.yml)?
* Which, if any, [ops-files](https://github.com/cloudfoundry/app-autoscaler-release/tree/main/example/operation) did you apply?
* How did you run the acceptance-tests?
* If you did not run them, please consider running them and attaching the output as well.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ spec-test:
bundle install
bundle exec rspec

.PHONY: release
.PHONY: bosh-release
bosh-release: go-mod-tidy go-mod-vendor scheduler db build/autoscaler-test.tgz
build/autoscaler-test.tgz:
@echo " - building bosh release into build/autoscaler-test.tgz"
Expand Down
438 changes: 46 additions & 392 deletions README.md

Large diffs are not rendered by default.

80 changes: 1 addition & 79 deletions ci/autoscaler/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
---
anchors:
app-autoscaler-ops-files: &app-autoscaler-ops-files
OPS_FILES: |
operations/add-releases.yml
operations/instance-identity-cert-from-cf.yml
operations/add-postgres-variables.yml
operations/enable-nats-tls.yml
operations/loggregator-certs-from-cf.yml
operations/append-deployment-name-to-loggregator-nozzle-shard-id.yml
operations/add-extra-plan.yml
operations/set-release-version.yml
operations/enable-scheduler-logging.yml

app-autoscaler-ops-files-log-cache-metron: &app-autoscaler-ops-files-log-cache-metron
OPS_FILES: |
operations/add-releases.yml
operations/instance-identity-cert-from-cf.yml
operations/add-postgres-variables.yml
operations/enable-nats-tls.yml
operations/loggregator-certs-from-cf.yml
operations/add-extra-plan.yml
operations/set-release-version.yml
operations/configure-log-cache-and-forward-metrics-via-mtls.yml
operations/enable-metricsforwarder-via-metron-agent.yml
operations/remove-metricsserver.yml
operations/remove-metricsgateway.yml
operations/enable-scheduler-logging.yml

app-autoscaler-ops-files-log-cache-syslog: &app-autoscaler-ops-files-log-cache-syslog
Expand All @@ -33,13 +17,9 @@ anchors:
operations/instance-identity-cert-from-cf.yml
operations/add-postgres-variables.yml
operations/enable-nats-tls.yml
operations/loggregator-certs-from-cf.yml
operations/add-extra-plan.yml
operations/set-release-version.yml
operations/configure-log-cache-and-forward-metrics-via-mtls.yml
operations/enable-metricsforwarder-via-syslog-agent.yml
operations/remove-metricsserver.yml
operations/remove-metricsgateway.yml
operations/enable-scheduler-logging.yml

app-autoscaler-ops-files-log-cache-syslog-cf: &app-autoscaler-ops-files-log-cache-syslog-cf
Expand All @@ -66,16 +46,13 @@ anchors:
operations/instance-identity-cert-from-cf.yml
operations/add-postgres-variables.yml
operations/enable-nats-tls.yml
operations/loggregator-certs-from-cf.yml
operations/append-deployment-name-to-loggregator-nozzle-shard-id.yml
operations/postgres-persistent-disk.yml
operations/add-extra-plan.yml
operations/set-release-version.yml

groups:
- name: all
jobs:
- acceptance
- acceptance-log-cache-metron
- acceptance-log-cache-syslog
- acceptance-log-cache-syslog-cf
Expand All @@ -92,7 +69,6 @@ groups:
- update-java
- name: autoscaler-release
jobs:
- acceptance
- acceptance-log-cache-metron
- acceptance-log-cache-syslog
- draft
Expand Down Expand Up @@ -246,59 +222,6 @@ jobs:
file: ci/ci/autoscaler/tasks/run-integration-tests.yml
timeout: 45m

- name: acceptance
public: true
build_logs_to_retain: 100
serial: true
on_success:
task: cleanup
file: ci/ci/autoscaler/tasks/cleanup-autoscaler.yml
params: &acceptance-params
DEPLOYMENT_NAME: ((acceptance_deployment_name))
plan:
- in_parallel:
- get: bbl-state
- get: app-autoscaler-release
passed: [unit-tests, integration-tests]
trigger: true
- get: ci
- task: make-prerelease
file: ci/ci/autoscaler/tasks/make/make.yaml
params:
# ⚠️ Here it is used that make officially guarantees to reach the goals in the provided order.
TARGETS: generate-fakes generate-openapi-generated-clients-and-servers go-mod-tidy go-mod-vendor db scheduler
timeout: 15m
- task: deploy-autoscaler
file: ci/ci/autoscaler/tasks/deploy-autoscaler.yml
params:
<<: *acceptance-params
<<: *app-autoscaler-ops-files
timeout: 30m
- task: register-broker
file: ci/ci/autoscaler/tasks/register-broker.yml
params:
<<: *acceptance-params
timeout: 5m
- in_parallel:
- task: autoscaler-acceptance-api
file: ci/ci/autoscaler/tasks/run-acceptance-tests.yml
params:
<<: *acceptance-params
SUITES: api
timeout: 15m
- task: autoscaler-acceptance-app
file: ci/ci/autoscaler/tasks/run-acceptance-tests.yml
params:
<<: *acceptance-params
SUITES: app
timeout: 45m
- task: autoscaler-acceptance-broker
file: ci/ci/autoscaler/tasks/run-acceptance-tests.yml
params:
<<: *acceptance-params
SUITES: broker
timeout: 15m

- name: acceptance-log-cache-metron
public: true
build_logs_to_retain: 100
Expand Down Expand Up @@ -490,7 +413,7 @@ jobs:
file: ci/ci/autoscaler/tasks/deploy-autoscaler.yml
params:
<<: *performance-env
<<: *app-autoscaler-ops-files
<<: *app-autoscaler-ops-files-log-cache-syslog
timeout: 30m
- task: register-broker
file: ci/ci/autoscaler/tasks/register-broker.yml
Expand Down Expand Up @@ -522,7 +445,6 @@ jobs:
- get: ci
- get: app-autoscaler-release
passed:
- acceptance
- acceptance-log-cache-metron
- acceptance-log-cache-syslog
trigger: true
Expand Down
18 changes: 7 additions & 11 deletions ci/autoscaler/scripts/deploy-autoscaler.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#! /usr/bin/env bash
# shellcheck disable=SC2086,SC2034,SC2155
set -euo pipefail

script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source "${script_dir}/vars.source.sh"

Expand All @@ -14,13 +13,8 @@ ops_files=${OPS_FILES:-"${autoscaler_dir}/operations/add-releases.yml\
${autoscaler_dir}/operations/add-postgres-variables.yml\
${autoscaler_dir}/operations/connect_to_postgres_with_certs.yml\
${autoscaler_dir}/operations/enable-nats-tls.yml\
${autoscaler_dir}/operations/loggregator-certs-from-cf.yml\
${autoscaler_dir}/operations/add-extra-plan.yml\
${autoscaler_dir}/operations/set-release-version.yml\
${autoscaler_dir}/operations/configure-log-cache-and-forward-metrics-via-mtls.yml\
${autoscaler_dir}/operations/remove-metricsserver.yml\
${autoscaler_dir}/operations/remove-metricsgateway.yml\
${autoscaler_dir}/operations/enable-log-cache-via-uaa.yml\
${autoscaler_dir}/operations/enable-metricsforwarder-via-syslog-agent.yml\
${autoscaler_dir}/operations/enable-scheduler-logging.yml"}

Expand Down Expand Up @@ -96,11 +90,13 @@ function create_manifest(){
-v admin_password="$(credhub get -n /bosh-autoscaler/cf/cf_admin_password -q)" \
-v cf_client_id=autoscaler_client_id \
-v cf_client_secret=autoscaler_client_secret \
-v eventgenerator_uaa_client_id=firehose_exporter \
-v eventgenerator_uaa_client_secret="$(credhub get -n /bosh-autoscaler/cf/uaa_clients_firehose_exporter_secret --quiet)"\
-v eventgenerator_uaa_skip_ssl_validation=true \
-v metricsforwarder_host="${metricsforwarder_host}" \
-v skip_ssl_validation=true \
-v log_cache_syslog_tls_ca="$(credhub get -n /bosh-autoscaler/cf/log_cache_syslog_tls --key ca --quiet)"\
-v syslog_agent_log_cache_tls_certificate="$(credhub get -n /bosh-autoscaler/cf/syslog_agent_log_cache_tls --key certificate --quiet)"\
-v syslog_agent_log_cache_tls_key="$(credhub get -n /bosh-autoscaler/cf/syslog_agent_log_cache_tls --key private_key --quiet)"\
-v metricscollector_ca_cert="$(credhub get -n /bosh-autoscaler/cf/log_cache --key ca --quiet)"\
-v metricscollector_client_cert="$(credhub get -n /bosh-autoscaler/cf/log_cache --key certificate --quiet)"\
-v metricscollector_client_key="$(credhub get -n /bosh-autoscaler/cf/log_cache --key private_key --quiet)"\
-v skip_ssl_validation=true \
> "${tmp_manifest_file}"

# shellcheck disable=SC2064
Expand Down
5 changes: 4 additions & 1 deletion ci/autoscaler/set-pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ function main(){
export PIPELINE_NAME="app-autoscaler-release"
set_pipeline $PIPELINE_NAME
else
export PIPELINE_NAME="app-autoscaler-release-${CURRENT_BRANCH}"
local current_branch_without_slashes
current_branch_without_slashes="$(echo "${CURRENT_BRANCH}" | sed 's/\//-/g')" # Concourse can't handle slashes in pipeline names

export PIPELINE_NAME="app-autoscaler-release-${current_branch_without_slashes}"
set_pipeline "$PIPELINE_NAME"
pause_jobs "$PIPELINE_NAME"
unpause_job "$PIPELINE_NAME/set-pipeline"
Expand Down
1 change: 0 additions & 1 deletion ci/autoscaler/tasks/deploy-previous-autoscaler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ params:
# Optional: relative to the root of the release input. The files will be
# checked to see if they exist, if not they will be excluded from the list
OPS_FILES: |
example/operation/loggregator-certs-from-cf.yml
example/operation/postgres-persistent-disk.yml


Expand Down
1 change: 1 addition & 0 deletions devbox.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,7 @@
},
"ruby@latest": {
"last_modified": "2024-05-22T06:18:38Z",
"plugin_version": "0.0.2",
"resolved": "github:NixOS/nixpkgs/3f316d2a50699a78afe5e77ca486ad553169061e#ruby_3_3",
"source": "devbox-search",
"version": "3.3.1",
Expand Down
1 change: 0 additions & 1 deletion docs/components-db-usage.drawio

This file was deleted.

4 changes: 2 additions & 2 deletions docs/components-db-usage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 0 additions & 16 deletions docs/developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,3 @@
- Evaluates app policies rules and generates scaling events based on metrics cache.
- Manages coolDown threshold for scaling events.

### MetricsServer (To be Deprecated)

![Alt text](./images/metrics_server.svg)

**Responsabilities:**

- For Timer metrics it caches and compiles httpStartStop events to collect a average response time and throughput metric for a configured interval, by default 60 Seconds.
- Keeps track of current metrics sharded by node.
- if persistence is enabled, it stores metrics in DB.
- Provides HTTPServer GET endpoint to retrieve metrics_history by appid/metrictype.
- Transforms GAUGE envelopes into autoscaler compatible metrics (memoryutil, )

### MetricsGateway (To be Deprecated)

![Alt text](./images/metrics_gateway.svg)

4 changes: 2 additions & 2 deletions docs/images/autoscaler.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions docs/images/components-db-usage.svg

This file was deleted.

4 changes: 2 additions & 2 deletions docs/images/eventgenerator.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions docs/images/metrics_gateway.svg

This file was deleted.

4 changes: 0 additions & 4 deletions docs/images/metrics_server.svg

This file was deleted.

53 changes: 0 additions & 53 deletions docs/log-cache.md

This file was deleted.

Empty file removed example/.gitkeep
Empty file.
12 changes: 0 additions & 12 deletions example/operation/add-extra-plan.yml

This file was deleted.

20 changes: 0 additions & 20 deletions example/operation/alternative-vm-type.yml

This file was deleted.

Loading
Loading