Skip to content

Commit

Permalink
autoscaling (#12)
Browse files Browse the repository at this point in the history
* revert replicas change

* autoscaling

* try tempo-distributed

* would require config update

* use bitnami image

* rebase

* update values
  • Loading branch information
morga471 committed Mar 17, 2025
1 parent 2a353f5 commit 0aef5cb
Show file tree
Hide file tree
Showing 7 changed files with 156 additions and 12 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "terraform" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
101 changes: 101 additions & 0 deletions .github/workflows/terragrunt-cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: 'Terraform Module CI'

on:
push:
branches:
- main
paths:
- '**/*.hcl'
- '**/*.tf'
pull_request:
branches:
- main
paths:
- '**/*.hcl'
- '**/*.tf'

permissions:
contents: read
pull-requests: write

jobs:
validate:
name: 'Validate Module'
runs-on: self-hosted

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.5.0

- name: Terraform Init
run: |
terraform init -backend=false
- name: Terraform Format
run: |
terraform fmt -check
- name: Terraform Validate
run: |
terraform validate
- name: Run tflint
uses: terraform-linters/setup-tflint@v3
if: github.event_name == 'pull_request'

- name: Lint Terraform
if: github.event_name == 'pull_request'
run: |
tflint --format compact
release:
name: 'Create Release'
needs: validate
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: self-hosted
permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install Commitizen
run: |
pip install commitizen
- name: Configure Git
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- name: Bump Version and Generate Changelog
id: cz
run: |
cz bump --yes
echo "new_version=$(cz version --project)" >> $GITHUB_OUTPUT
echo "changelog=$(cz changelog --dry-run)" >> $GITHUB_OUTPUT
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.cz.outputs.new_version }}
release_name: Release v${{ steps.cz.outputs.new_version }}
draft: false
prerelease: false
body: ${{ steps.cz.outputs.changelog }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,6 @@ Developer NOTE: We should automate this configuration.
|------|-------------|
| <a name="output_module_name"></a> [module\_name](#output\_module\_name) | The name of this module. |
| <a name="output_module_version"></a> [module\_version](#output\_module\_version) | The version of this module. |
| <a name="output_tempo_internal_endpoint"></a> [tempo\_internal\_endpoint](#output\_tempo\_internal\_endpoint) | internal endpoint for tempo |
| <a name="output_tempo_otlp_endpoint"></a> [tempo\_otlp\_endpoint](#output\_tempo\_otlp\_endpoint) | internal otlp endpoint for tempo |
<!-- END_TF_DOCS -->
4 changes: 2 additions & 2 deletions copy_images.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ locals {
enabled = true
dest_path = null
name = "tempo"
source_image = "grafana/tempo"
source_registry = "docker.io"
source_image = "bitnami/grafana-tempo"
source_registry = "public.ecr.aws"
source_tag = var.tempo_tag
tag = var.tempo_tag
}
Expand Down
10 changes: 3 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ locals {
tempo_internal_port_number = 3100
tempo_internal_url = format("http://%v:%v/", local.tempo_internal_hostname, local.tempo_internal_port_number)

tempo_otlp_port_number = 4317
tempo_otlp_url = format("http://%v:%v", local.tempo_internal_hostname, local.tempo_otlp_port_number)
tempo_otlp_port_number = 4317
tempo_otlp_url = format("http://%v:%v", local.tempo_internal_hostname, local.tempo_otlp_port_number)
}

################################################################################
Expand Down Expand Up @@ -54,11 +54,7 @@ resource "helm_release" "tempo" {

set {
name = "replicas"
value = "3"
}
set {
name = "tempo.storage.trace.s3.insecure"
value = "false"
value = "1"
}
set {
name = "tempo.repository"
Expand Down
4 changes: 2 additions & 2 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ output "tempo_internal_endpoint" {
port_number = local.tempo_internal_port_number
url = local.tempo_internal_url
}
}
}

output "tempo_otlp_endpoint" {
description = "internal otlp endpoint for tempo"
Expand All @@ -18,7 +18,7 @@ output "tempo_otlp_endpoint" {
port_number = local.tempo_otlp_port_number
url = local.tempo_otlp_url
}
}
}

output "module_name" {
description = "The name of this module."
Expand Down
36 changes: 35 additions & 1 deletion tempo_values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,53 @@ persistence:
ingester:
autoscaling:
enabled: true
resources:
requests:
cpu: "1m"
memory: "1Mi"
limits:
cpu: "200m"
memory: "256Mi"
distributor:
autoscaling:
enabled: true
resources:
requests:
cpu: "1m"
memory: "1Mi"
limits:
cpu: "200m"
memory: "256Mi"
compactor:
autoscaling:
enabled: true
resources:
requests:
cpu: "1m"
memory: "1Mi"
limits:
cpu: "200m"
memory: "256Mi"
querier:
autoscaling:
enabled: true
resources:
requests:
cpu: "1m"
memory: "1Mi"
limits:
cpu: "200m"
memory: "256Mi"
gateway:
autoscaling:
enabled: true

resources:
requests:
cpu: "1m"
memory: "1Mi"
limits:
cpu: "200m"
memory: "256Mi"
traces:
jaeger:
zipkin:
Expand Down

0 comments on commit 0aef5cb

Please sign in to comment.