Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
568ee46
Pradeep | fix Centralized Logging in .NET added in Csharp
ironhawkeyepradeep Sep 22, 2025
fe8b1b0
Pradeep | code Ref
ironhawkeyepradeep Sep 22, 2025
e528bef
Pradeep | fix autologging added
ironhawkeyepradeep Sep 22, 2025
c2cf710
Pradeep | code ref
ironhawkeyepradeep Sep 22, 2025
5ebffb4
Merge pull request #127 from pradeepwhozzat/clickup-86d078pzu1
ankitdubeyoffice Sep 22, 2025
b700a4e
Update GiddhTemplate.csproj
pradeepwhozzat Sep 22, 2025
7034ddf
Merge pull request #129 from pradeepwhozzat/patch-5
ankitdubeyoffice Sep 22, 2025
f8a71b2
Pradeep | log msg beautify
ironhawkeyepradeep Sep 23, 2025
58fc359
Merge pull request #130 from Walkover-Web-Solution/clickup-86d078pzu1
ankitdubeyoffice Sep 23, 2025
33f9979
Pradeep | fix logging issue while pdf generation
ironhawkeyepradeep Sep 23, 2025
4667654
Merge pull request #131 from Walkover-Web-Solution/clickup-86d078pzu1
pradeepwhozzat Sep 23, 2025
ca16f98
Pradeep | code ref
ironhawkeyepradeep Sep 23, 2025
0b1f6aa
Merge pull request #132 from Walkover-Web-Solution/clickup-86d078pzu1
pradeepwhozzat Sep 23, 2025
ef8f932
Pradeep | log added with annottation
ironhawkeyepradeep Sep 24, 2025
c386798
Pradeep | code ref
ironhawkeyepradeep Sep 24, 2025
a509bb2
Merge pull request #133 from Walkover-Web-Solution/clickup-86d078pzu1
pradeepwhozzat Sep 24, 2025
59dbb00
Dilpreet | Master | Prod - UTGST amount is not displaying in tax bifu…
Oct 1, 2025
0cc2116
PR changes
Oct 1, 2025
92e8700
fixed issue PR changes
Oct 1, 2025
e97070b
Merge pull request #134 from Walkover-Web-Solution/86cupaqz6-master
dilpreetsinghofficial Oct 1, 2025
cdf3b18
Pradeep | fix nullity check added in the thermal html
ironhawkeyepradeep Oct 3, 2025
5a8c940
Pradeep | code ref
ironhawkeyepradeep Oct 3, 2025
7fc9ac0
Merge pull request #135 from Walkover-Web-Solution/clickup-86cuqnpg7
ankitdubeyoffice Oct 3, 2025
921a990
Dilpreet | Master | CUstomer Address hide and estimate proforma issue
Oct 8, 2025
76727e0
Merge pull request #137 from Walkover-Web-Solution/sfscdsrg-master
dilpreetsinghofficial Oct 8, 2025
c9c1925
Dilpreet | Prod | Tally Template Columns Issue (Other Tax)
Oct 17, 2025
45b8584
Update PdfService.cs
dilpreetsinghofficial Oct 17, 2025
be46a9c
Merge pull request #140 from Walkover-Web-Solution/gfscdsrg-master
ankitdubeyoffice Oct 17, 2025
4ed858e
Prod - UTGST amount is not displaying in tax bifurcation table on PDF
Oct 28, 2025
888568b
Merge pull request #142 from Walkover-Web-Solution/gfscdsrg-mastr
ankitdubeyoffice Oct 28, 2025
1970a07
Pradeep | Divya - improvement in grafana implementation (master)
ironhawkeyepradeep Nov 18, 2025
85cd21f
Merge pull request #145 from Walkover-Web-Solution/grafana-imp
pradeepwhozzat Nov 18, 2025
57b771c
code ref
ironhawkeyepradeep Nov 18, 2025
f0ed7c5
Merge pull request #146 from Walkover-Web-Solution/grafana-imp
pradeepwhozzat Nov 18, 2025
6e87669
added logging
DivyaThawani1 Nov 20, 2025
dcc4a28
added logging
ironhawkeyepradeep Nov 20, 2025
40e9155
Update PdfService.cs
pradeepwhozzat Nov 20, 2025
dc62ca9
Merge pull request #147 from Walkover-Web-Solution/grafana-imp
pradeepwhozzat Nov 20, 2025
b85787f
added logging
ironhawkeyepradeep Nov 20, 2025
06dfec1
Merge pull request #148 from Walkover-Web-Solution/grafana-imp
pradeepwhozzat Nov 20, 2025
b8a06fb
removed logging from c #
DivyaThawani1 Nov 20, 2025
849453b
Pradeep | Centralized Logging added through program.cs
ironhawkeyepradeep Nov 20, 2025
5f8fb54
Merge pull request #150 from Walkover-Web-Solution/grafana-imp
pradeepwhozzat Nov 20, 2025
f226d01
Update PdfService.cs by divya
pradeepwhozzat Nov 20, 2025
58f91db
Update PdfService.cs
pradeepwhozzat Nov 20, 2025
9d04a44
Update PdfService.cs by divya
pradeepwhozzat Nov 20, 2025
bf19c59
Update PdfService.cs by divya
pradeepwhozzat Nov 20, 2025
0a36919
slart alert improvemnet and added ope-telemetry
DivyaThawani1 Nov 20, 2025
c84cb52
Update OpenTelemetry package versions and enhance OpenTelemetry setup…
DivyaThawani1 Nov 20, 2025
7cd0d08
Merge pull request #151 from Walkover-Web-Solution/grafana-imp
pradeepwhozzat Nov 20, 2025
7083a15
added logging
ironhawkeyepradeep Nov 20, 2025
c3adb62
Merge pull request #152 from Walkover-Web-Solution/grafana-imp
pradeepwhozzat Nov 20, 2025
39c3a57
added proper indentation
DivyaThawani1 Nov 21, 2025
f6c9e5e
updated
DivyaThawani1 Nov 21, 2025
c90cc84
Merge branch 'grafana-imp' of https://github.com/Walkover-Web-Solutio…
DivyaThawani1 Nov 21, 2025
99129d8
updated traces
DivyaThawani1 Nov 21, 2025
1dccab1
updated grafana setup script
DivyaThawani1 Nov 21, 2025
cc73b6b
comma added
DivyaThawani1 Nov 21, 2025
0cc5549
Merge pull request #153 from Walkover-Web-Solution/grafana-imp
pradeepwhozzat Nov 21, 2025
cf976de
improved build
DivyaThawani1 Nov 21, 2025
ceb4d70
Merge pull request #154 from Walkover-Web-Solution/grafana-imp
DivyaThawani1 Nov 21, 2025
85758ef
added tracing
DivyaThawani1 Nov 21, 2025
ea48be4
Merge pull request #155 from Walkover-Web-Solution/grafana-imp
DivyaThawani1 Nov 21, 2025
3dd1591
added slack alert back
DivyaThawani1 Nov 21, 2025
94fe58b
addded logger
DivyaThawani1 Nov 21, 2025
4dfbfa5
Merge pull request #156 from Walkover-Web-Solution/grafana-imp
pradeepwhozzat Nov 21, 2025
e2d6060
updated log path
DivyaThawani1 Nov 21, 2025
fa97a3e
Merge pull request #157 from Walkover-Web-Solution/grafana-imp
DivyaThawani1 Nov 21, 2025
43d9a69
added some changes
ironhawkeyepradeep Nov 21, 2025
ed5d1ad
Merge pull request #158 from Walkover-Web-Solution/grafana-imp
pradeepwhozzat Nov 21, 2025
65b5d63
docs: added comprehensive documentation
dvCodeWorld Dec 23, 2025
5682194
refactor: renamed loop variable from 'c' to 'character' in SanitizeFi…
dvCodeWorld Dec 23, 2025
312e700
Merge pull request #159 from Walkover-Web-Solution/divyanshu-docs
dvCodeWorld Dec 23, 2025
6d7c5bc
feat: added support for account custom fields in invoice template
dvCodeWorld Dec 30, 2025
6898b12
Merge pull request #160 from Walkover-Web-Solution/86d1dc8bb-master
dilpreetsinghofficial Dec 30, 2025
6a7bf2a
refactor: changed Value property type from string to object in LabelV…
dvCodeWorld Jan 5, 2026
c259876
Merge pull request #161 from Walkover-Web-Solution/86d1dc8bb-master
ankitdubeyoffice Jan 5, 2026
61d636f
feat: Account statement template
dvCodeWorld Jan 9, 2026
33f62eb
remove console
dvCodeWorld Jan 9, 2026
ed51efc
Merge pull request #163 from Walkover-Web-Solution/86d1hb412-master
ankitdubeyoffice Jan 9, 2026
9f11de0
feat: Account statement template
dvCodeWorld Jan 10, 2026
bb0ad91
Merge branch 'master' of https://github.com/Walkover-Web-Solution/GID…
dvCodeWorld Jan 10, 2026
c61842c
Merge pull request #164 from Walkover-Web-Solution/86d1hb412-master
dvCodeWorld Jan 10, 2026
60b7eca
revert chrome path changes
dvCodeWorld Jan 10, 2026
3468151
Merge pull request #165 from Walkover-Web-Solution/86d1hb412-master
dvCodeWorld Jan 10, 2026
bd5e793
feat: add alternative route for account statement API endpoint
dvCodeWorld Jan 10, 2026
95d40f3
feat: Support Ship To and Bill To in PO/PB invoice pdf
dvCodeWorld Jan 12, 2026
82745e1
Merge pull request #166 from Walkover-Web-Solution/86d1j52cd-master
ankitdubeyoffice Jan 12, 2026
e1e48c7
fix(bug): Bill to/ship to address coming for invoice template
dvCodeWorld Jan 13, 2026
9b5a136
Merge pull request #167 from Walkover-Web-Solution/86d1j52cd-master
ankitdubeyoffice Jan 13, 2026
afafc23
feat: add pincode field to account statement template address section
dvCodeWorld Jan 15, 2026
6195eb5
Merge pull request #168 from Walkover-Web-Solution/86d1jnrb0-master
dvCodeWorld Jan 15, 2026
720b50a
fix(bug): No setting coming on bill to/ship to address on template
dvCodeWorld Jan 15, 2026
2881c7c
Merge pull request #169 from Walkover-Web-Solution/86d1j9abe-master
dvCodeWorld Jan 15, 2026
794fc5f
Show account Pincode on voucher pdf
ankitdubeyoffice Jan 20, 2026
9c2f205
Merge pull request #171 from Walkover-Web-Solution/master-child
ankitdubeyoffice Jan 20, 2026
3240aef
feat: Optimize memory usage by streaming PDFs to disk instead of load…
dvCodeWorld Jan 22, 2026
0e9e10c
Merge pull request #173 from Walkover-Web-Solution/optmise-master
pradeepwhozzat Jan 22, 2026
915a8e4
Pradeep | alloy verison updated
pradeepwhozzat Jan 28, 2026
03500e3
Merge branch 'production' of https://github.com/Walkover-Web-Solution…
dvCodeWorld Jan 28, 2026
f2b9f98
Merge pull request #175 from Walkover-Web-Solution/sync-master
dvCodeWorld Jan 28, 2026
5f9607c
removed attribute not supported
DivyaThawani1 Jan 31, 2026
4bfd661
Merge pull request #176 from Walkover-Web-Solution/hotfix-grafana-master
DivyaThawani1 Jan 31, 2026
9802c65
updated path of log file
DivyaThawani1 Jan 31, 2026
072d582
Merge pull request #177 from Walkover-Web-Solution/hotfix-grafana-master
DivyaThawani1 Jan 31, 2026
1c8498f
feat: Improve PDF generation stability with concurrency control and e…
dvCodeWorld Feb 12, 2026
3869525
Merge branch 'master' of https://github.com/Walkover-Web-Solution/GID…
dvCodeWorld Feb 12, 2026
accabd5
feat: Add concurrency control and enhanced error handling for Account…
dvCodeWorld Feb 12, 2026
d09983b
Merge pull request #178 from Walkover-Web-Solution/sync-master
pradeepwhozzat Feb 12, 2026
d372504
feat: Reduce default memory reservation from 1GB to 512MB
dvCodeWorld Feb 16, 2026
10c705b
Merge pull request #179 from Walkover-Web-Solution/change-default-mem…
pradeepwhozzat Feb 16, 2026
1bcdfcb
feat: Reduce default memory reservation from 512MB to 200MB
dvCodeWorld Feb 16, 2026
f7e6037
Merge pull request #180 from Walkover-Web-Solution/change-default-mem…
dvCodeWorld Feb 16, 2026
7bcaf0c
Update README.md
pradeepwhozzat Feb 17, 2026
2bcb5d6
Merge pull request #181 from Walkover-Web-Solution/pradeepwhozzat-pat…
pradeepwhozzat Feb 17, 2026
bd97436
Pradeep | memory code ref
pradeepwhozzat Feb 17, 2026
a6fece2
Merge pull request #182 from Walkover-Web-Solution/test-fixes
pradeepwhozzat Feb 17, 2026
df8a53e
Pradeep | timeout decreased
pradeepwhozzat Feb 17, 2026
b4b3416
Merge pull request #183 from Walkover-Web-Solution/test-fixes
pradeepwhozzat Feb 17, 2026
44283df
Revert "Update README.md"
pradeepwhozzat Feb 17, 2026
9145495
Merge pull request #184 from Walkover-Web-Solution/revert-181-pradeep…
pradeepwhozzat Feb 17, 2026
cd9f650
Pradeep | fix chrom path
pradeepwhozzat Feb 17, 2026
61c7a03
Merge pull request #185 from Walkover-Web-Solution/test-fixes
pradeepwhozzat Feb 17, 2026
61c8b0b
fix: Replace GstEntriesTotal with total in grand total display logic
ankitdubeyoffice Feb 17, 2026
e88ad63
fix: Standardize Total property casing in AccountStatementModel and t…
ankitdubeyoffice Feb 17, 2026
699dccd
Merge pull request #186 from Walkover-Web-Solution/master-child
dvCodeWorld Feb 17, 2026
111c001
Merge pull request #174 from Walkover-Web-Solution/clickup-86d1r2yuc
pradeepwhozzat Feb 18, 2026
7246b66
Increase reserved memory from 200MB/100MB to 1GB across all environments
dvCodeWorld Feb 20, 2026
2c4a18f
Merge pull request #188 from Walkover-Web-Solution/revert-changes-master
dvCodeWorld Feb 20, 2026
7fd89e1
Trigger CI/Cd
dvCodeWorld Feb 20, 2026
e2dab01
Add author information to README.md
dvCodeWorld Feb 20, 2026
f278b85
Merge pull request #189 from Walkover-Web-Solution/revert-changes-master
dvCodeWorld Feb 20, 2026
bbec661
fix: Set Content-Disposition header inline for PDF streaming in Accou…
ankitdubeyoffice Feb 24, 2026
93c7b12
Merge pull request #190 from Walkover-Web-Solution/master-child
dvCodeWorld Feb 24, 2026
46a1e39
Update Readme.md
pradeepwhozzat Feb 24, 2026
7a00da0
Merge pull request #191 from Walkover-Web-Solution/pradeepwhozzat-pat…
pradeepwhozzat Feb 24, 2026
3b07163
Revert "Divyanshu | Master | Increase reserved memory from 200MB/100M…
pradeepwhozzat Feb 24, 2026
a346fa8
Merge pull request #192 from Walkover-Web-Solution/revert-188-revert-…
pradeepwhozzat Feb 24, 2026
5f625d9
fix: Change Content-Disposition to attachment and adjust PDF generati…
ankitdubeyoffice Feb 24, 2026
11b2bc6
Merge pull request #193 from Walkover-Web-Solution/master-child
dvCodeWorld Feb 24, 2026
b31ad00
Revert "Update Readme.md"
pradeepwhozzat Feb 25, 2026
08feaad
Merge pull request #194 from Walkover-Web-Solution/revert-191-pradeep…
pradeepwhozzat Feb 25, 2026
5fe4a26
Pradeep | swap file added and concurrent request enabled
pradeepwhozzat Feb 25, 2026
13dcdda
nPradeep | limit increased
pradeepwhozzat Feb 25, 2026
4cc8040
Revert "Ankit | Test | Prod- Displaying incorrect Invoice Total in PDF "
pradeepwhozzat Feb 25, 2026
f94acea
Merge pull request #195 from Walkover-Web-Solution/revert-186-master-…
pradeepwhozzat Feb 25, 2026
c014d21
Pradeep | fix time out issue while i/o operation
pradeepwhozzat Feb 26, 2026
ed9e728
Merge pull request #196 from Walkover-Web-Solution/clickup-86d20v6uv
pradeepwhozzat Feb 26, 2026
530216e
Revert "Revert "Update Readme.md""
pradeepwhozzat Feb 26, 2026
f9371d4
Merge pull request #198 from Walkover-Web-Solution/revert-194-revert-…
pradeepwhozzat Feb 26, 2026
f2172b3
Pradeep | code ref
pradeepwhozzat Feb 26, 2026
ef09e94
Merge pull request #199 from Walkover-Web-Solution/clickup-86d20v6uv
pradeepwhozzat Feb 26, 2026
7317abe
Pradeep | chrome path fixes
pradeepwhozzat Feb 26, 2026
735dc9f
Anshika | Master | optimize PDF generation with HTML caching and sha…
dvCodeWorld Feb 27, 2026
86a00e7
refactor: increase JS heap size and add cache cleanup for expired ent…
dvCodeWorld Feb 27, 2026
637191e
Merge pull request #200 from Walkover-Web-Solution/code-optimaisation…
dvCodeWorld Feb 27, 2026
3d5bc82
refactor: move PDF options initialization outside try block and extra…
dvCodeWorld Feb 27, 2026
d80279c
Merge pull request #201 from Walkover-Web-Solution/code-optimaisation…
dvCodeWorld Feb 27, 2026
5fbfb81
Revert "Anshika | Test | move PDF options initialization outside try…
ankitdubeyoffice Feb 27, 2026
fa86731
Merge pull request #202 from Walkover-Web-Solution/revert-201-code-op…
ankitdubeyoffice Feb 27, 2026
b3e43af
Revert "Anshika | Master | optimize PDF generation with HTML caching…
ankitdubeyoffice Feb 27, 2026
d8dde8e
Merge pull request #203 from Walkover-Web-Solution/revert-200-code-op…
ankitdubeyoffice Feb 27, 2026
7c27dd0
Anshika | Master | reduce PDF generation semaphore concurrency to 1
ankitdubeyoffice Feb 27, 2026
04e8cc1
Merge pull request #204 from Walkover-Web-Solution/master-child
ankitdubeyoffice Feb 27, 2026
7ee34e7
Anshika | Master | add styles caching and dispose browser after PDF g…
ankitdubeyoffice Feb 27, 2026
500f300
Merge pull request #205 from Walkover-Web-Solution/master-child
ankitdubeyoffice Feb 27, 2026
d700fa5
Revert "Revert "Revert "Update Readme.md"""
pradeepwhozzat Mar 2, 2026
b798980
Merge pull request #206 from Walkover-Web-Solution/revert-198-revert-…
pradeepwhozzat Mar 2, 2026
f1d0f30
Pradeep | fix the cpu spike issue
pradeepwhozzat Mar 2, 2026
1760d39
Merge pull request #207 from Walkover-Web-Solution/clickup-86d20v6uv
pradeepwhozzat Mar 2, 2026
ae7e4aa
Revert "Pradeep | fix the cpu spike issue"
pradeepwhozzat Mar 2, 2026
06c784f
Merge pull request #208 from Walkover-Web-Solution/revert-207-clickup…
pradeepwhozzat Mar 2, 2026
a5d9644
Pradeep | fix insufficient memory error
pradeepwhozzat Mar 2, 2026
9be9735
Merge pull request #209 from Walkover-Web-Solution/clickup-86d20v6uv
pradeepwhozzat Mar 2, 2026
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
Binary file modified .DS_Store
Binary file not shown.
41 changes: 32 additions & 9 deletions .ebextensions/003_add_grafana_repo.config
Original file line number Diff line number Diff line change
@@ -1,15 +1,38 @@
commands:
01_add_grafana_repo:
01_download_alloy:
command: |
sudo wget -q -O /tmp/grafana.key https://rpm.grafana.com/gpg.key
sudo rpm --import /tmp/grafana.key
echo -e '[grafana]\nname=grafana\nbaseurl=https://rpm.grafana.com\nrepo_gpgcheck=1\nenabled=1\ngpgcheck=1\ngpgkey=https://rpm.grafana.com/gpg.key\nsslverify=1\nsslcacert=/etc/pki/tls/certs/ca-bundle.crt' | sudo tee /etc/yum.repos.d/grafana.repo
echo "[INFO] Downloading Grafana Alloy v1.12.2..."
ALLOY_VERSION="1.12.2"
RPM_FILE="alloy-${ALLOY_VERSION}-1.amd64.rpm"
DOWNLOAD_URL="https://github.com/grafana/alloy/releases/download/v${ALLOY_VERSION}/${RPM_FILE}"

curl -L -o /tmp/alloy.rpm "$DOWNLOAD_URL"

if [ ! -s /tmp/alloy.rpm ]; then
echo "[ERROR] Alloy RPM download failed."
exit 1
fi

02_install_alloy:
command: sudo yum install -y alloy
command: |
echo "[INFO] Installing Alloy..."
sudo rpm -Uvh /tmp/alloy.rpm || true

03_prepare_directories:
command: |
echo "[INFO] Creating Alloy directories..."
sudo mkdir -p /etc/alloy
sudo mkdir -p /etc/systemd/system/alloy.service.d

04_set_root_user:
command: |
echo "[INFO] Setting Alloy to run as root..."
echo "[Service]" | sudo tee /etc/systemd/system/alloy.service.d/override.conf
echo "User=root" | sudo tee -a /etc/systemd/system/alloy.service.d/override.conf
echo "Group=root" | sudo tee -a /etc/systemd/system/alloy.service.d/override.conf

03_install_unzip:
command: sudo yum install -y unzip
05_reload_systemd:
command: |
echo "[INFO] Reloading systemd..."
sudo systemctl daemon-reload

09_restart_alloy:
command: sudo systemctl restart alloy
52 changes: 52 additions & 0 deletions .ebextensions/005_memory_optimization.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
commands:
01_configure_vm_settings:
command: |
cat > /etc/sysctl.d/99-pdf-memory-optimization.conf << 'EOF'
# Limit page cache to approximately 100MB to maximize memory for PDF generation
# vm.vfs_cache_pressure controls the tendency to reclaim memory used for caching
# Default is 100. Higher values (200) = more aggressive cache reclamation
vm.vfs_cache_pressure = 200

# vm.min_free_kbytes ensures kernel keeps minimum free memory
# Set to ~50MB (51200 KB) to ensure some buffer
vm.min_free_kbytes = 51200

# vm.swappiness controls swap usage tendency
# Lower value (10) = prefer using RAM over swap
# This keeps PDF generation in RAM for better performance
vm.swappiness = 10

# vm.dirty_ratio limits percentage of RAM for dirty pages (pending disk writes)
# Set to 10% to prevent excessive buffering
vm.dirty_ratio = 10

# vm.dirty_background_ratio starts background writes earlier
# Set to 5% to flush cache to disk sooner
vm.dirty_background_ratio = 5

# vm.overcommit_memory controls memory allocation strategy
# 1 = Always allow overcommit (useful for Chrome which requests more than it uses)
vm.overcommit_memory = 1

# vm.overcommit_ratio percentage of RAM that can be overcommitted
# 80% allows some overcommit while preventing extreme cases
vm.overcommit_ratio = 80
EOF

# Apply the settings immediately
sysctl -p /etc/sysctl.d/99-pdf-memory-optimization.conf
ignoreErrors: false

02_configure_transparent_hugepages:
command: |
# Disable transparent huge pages for better memory predictability
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag
ignoreErrors: true

03_drop_caches_on_startup:
command: |
# Clear existing caches on deployment to start fresh
sync
echo 3 > /proc/sys/vm/drop_caches
ignoreErrors: true
14 changes: 14 additions & 0 deletions .ebextensions/swap.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
commands:
01_create_swap:
command: |
if [ ! -f /swapfile ]; then
fallocate -l 4G /swapfile || dd if=/dev/zero of=/swapfile bs=1M count=4096
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap sw 0 0' >> /etc/fstab
fi
02_set_swappiness:
command: |
sysctl vm.swappiness=10
echo 'vm.swappiness=10' >> /etc/sysctl.conf
222 changes: 127 additions & 95 deletions .platform/hooks/postdeploy/grafana-setup.sh
Original file line number Diff line number Diff line change
@@ -1,138 +1,170 @@
#!/bin/bash

set -e

GRAFANA_APP_ENV=$(/opt/elasticbeanstalk/bin/get-config environment -k ENVIRONMENT)
SERVER_REGION=$(/opt/elasticbeanstalk/bin/get-config environment -k SERVER_REGION)
ALLOY_CONF_DIR="/etc/alloy"
sudo mkdir -p "${ALLOY_CONF_DIR}"

# ========= Load Environment Variables from EB =========
GRAFANA_APP_ENV=$(/opt/elasticbeanstalk/bin/get-config environment -k ENVIRONMENT 2>/dev/null || true)
SERVER_REGION=$(/opt/elasticbeanstalk/bin/get-config environment -k SERVER_REGION 2>/dev/null || true)

# write endpoints.json (GRAFANA_APP_ENV will be expanded)
sudo tee ${ALLOY_CONF_DIR}/endpoints.json > /dev/null <<EOF
# Fallback
GRAFANA_APP_ENV="${GRAFANA_APP_ENV:-TEST}"
SERVER_REGION="${SERVER_REGION:-IN}"

# ============= Create endpoints.json =============
sudo tee "${ALLOY_CONF_DIR}/endpoints.json" > /dev/null <<EOF
{
"environment": "${GRAFANA_APP_ENV}",
"server_region": "${SERVER_REGION}",
"company": "Walkover",
"product": "Giddh",
"service_name": "giddh-template",
"orgId": "14",
"logs": {
"url": "http://loghub.msg91.com:3100/loki/api/v1/push"
},
"metrics": {
"url": "http://loghub.msg91.com:9009/api/v1/push"
},
"tempo": {
"url": "http://loghub.msg91.com:4317"
},
"pyroscope": {
"url": "http://loghub.msg91.com:4040"
}
"environment": "${GRAFANA_APP_ENV}",
"server_region": "${SERVER_REGION}",
"company": "Walkover",
"product": "Giddh",
"service_name": "giddh-template",
"orgId": "14",
"logs": {
"url": "http://loghub.msg91.com:3100/loki/api/v1/push"
},
"metrics": {
"url": "http://loghub.msg91.com:9009/api/v1/push"
},
"tempo": {
"url": "http://loghub.msg91.com:4317"
},
"pyroscope": {
"url": "http://loghub.msg91.com:4040"
}
}
EOF

sudo tee ${ALLOY_CONF_DIR}/config.alloy > /dev/null <<'EOF'
# ============= Create config.alloy =============
sudo tee "${ALLOY_CONF_DIR}/config.alloy" > /dev/null <<'EOF'
local.file "endpoints" {
filename = "/etc/alloy/endpoints.json"
filename = "/etc/alloy/endpoints.json"
}

// loki config for logs
local.file_match "logs" {
path_targets = [
{
"job" = "nginx",
"namespace" = "/var/log/nginx",
"__path__" = "/var/log/nginx/*.log",
},
{
"job" = "application",
"namespace" = "/var/log/template-logs",
"__path__" = "/var/log/template-logs/*.log",
},
]
ignore_older_than = "24h"
sync_period = "10s"
path_targets = [
{
job = "nginx",
namespace = "/var/log/nginx",
__path__ = "/var/log/nginx/*.log",
},
{
job = "application",
namespace = "/var/log/template-logs",
__path__ = "/var/log/template-logs/*.log",
},
]
sync_period = "10s"
}

loki.source.file "log_source_file" {
targets = local.file_match.logs.targets
forward_to = [loki.process.log_process.receiver]
tail_from_end = true
targets = local.file_match.logs.targets
forward_to = [loki.process.log_process.receiver]
tail_from_end = true
}

loki.process "log_process" {
forward_to = [loki.write.log_write.receiver]
stage.decolorize {}
stage.static_labels {
values = {
env = json_path(local.file.endpoints.content, ".environment")[0],
server_region = json_path(local.file.endpoints.content, ".server_region")[0],
company = json_path(local.file.endpoints.content, ".company")[0],
product = json_path(local.file.endpoints.content, ".product")[0],
service_name = json_path(local.file.endpoints.content, ".service_name")[0],
instance = constants.hostname,
}
}
forward_to = [loki.write.log_write.receiver]

stage.decolorize {}

stage.static_labels {
values = {
env = json_path(local.file.endpoints.content, ".environment")[0],
server_region = json_path(local.file.endpoints.content, ".server_region")[0],
company = json_path(local.file.endpoints.content, ".company")[0],
product = json_path(local.file.endpoints.content, ".product")[0],
service_name = json_path(local.file.endpoints.content, ".service_name")[0],
instance = constants.hostname,
}
}
}

loki.write "log_write" {
endpoint {
url = json_path(local.file.endpoints.content, ".logs.url")[0]
headers = {
"X-Scope-OrgID" = json_path(local.file.endpoints.content, ".orgId")[0],
}
retry_on_http_429 = true
}
endpoint {
url = json_path(local.file.endpoints.content, ".logs.url")[0]
headers = {
"X-Scope-OrgID" = json_path(local.file.endpoints.content, ".orgId")[0],
}
retry_on_http_429 = true
}
}

// prometheus config for system monitering
prometheus.exporter.unix "metrics" {
disable_collectors = []
include_exporter_metrics = true

filesystem {
fs_types_exclude = "^(autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|iso9660|mqueue|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$"
mount_points_exclude = "^/(dev|proc|run/credentials/.+|sys|var/lib/docker/.+)($|/)"
mount_timeout = "5s"
}

netclass {
ignored_devices = "^(veth.*|cali.*|[a-f0-9]{15})$"
}

netdev {
device_exclude = "^(veth.*|cali.*|[a-f0-9]{15})$"
}
include_exporter_metrics = true
}

prometheus.scrape "metrics_scrape" {
scrape_interval = "15s"
targets = prometheus.exporter.unix.metrics.targets
forward_to = [prometheus.relabel.metrics_relabel.receiver]
scrape_interval = "15s"
targets = prometheus.exporter.unix.metrics.targets
forward_to = [prometheus.relabel.metrics_relabel.receiver]
}

prometheus.scrape "app_metrics_scrape" {
scrape_interval = "15s"
targets = [
{
__address__ = "127.0.0.1:5000",
__metrics_path__ = "/metrics",
job = "giddh-template-app",
},
]
forward_to = [prometheus.relabel.metrics_relabel.receiver]
}

prometheus.relabel "metrics_relabel" {
forward_to = [prometheus.remote_write.metrics_write.receiver]
forward_to = [prometheus.remote_write.metrics_write.receiver]
}

prometheus.remote_write "metrics_write" {
endpoint {
url = json_path(local.file.endpoints.content, ".metrics.url")[0]
headers = {
"X-Scope-OrgID" = json_path(local.file.endpoints.content, ".orgId")[0],
}
}
endpoint {
url = json_path(local.file.endpoints.content, ".metrics.url")[0]
headers = {
"X-Scope-OrgID" = json_path(local.file.endpoints.content, ".orgId")[0],
}
}

external_labels = {
env = json_path(local.file.endpoints.content, ".environment")[0],
server_region = json_path(local.file.endpoints.content, ".server_region")[0],
company = json_path(local.file.endpoints.content, ".company")[0],
product = json_path(local.file.endpoints.content, ".product")[0],
service_name = json_path(local.file.endpoints.content, ".service_name")[0],
instance = constants.hostname,
env = json_path(local.file.endpoints.content, ".environment")[0],
server_region = json_path(local.file.endpoints.content, ".server_region")[0],
company = json_path(local.file.endpoints.content, ".company")[0],
product = json_path(local.file.endpoints.content, ".product")[0],
service_name = json_path(local.file.endpoints.content, ".service_name")[0],
instance = constants.hostname,
}
}

otelcol.receiver.otlp "trace" {
grpc { endpoint = "0.0.0.0:4317" }
http { endpoint = "0.0.0.0:4318" }
output {
traces = [otelcol.processor.batch.trace_batch.input]
}
}
otelcol.processor.batch "trace_batch" {
timeout = "10s"
output {
traces = [otelcol.exporter.otlp.trace_write.input]
}
}
otelcol.exporter.otlp "trace_write" {
client {
endpoint = json_path(local.file.endpoints.content, ".tempo.url")[0]
tls {
insecure = true
}
headers = {
"X-Scope-OrgID" = json_path(local.file.endpoints.content, ".orgId")[0],
}
compression = "none"
}
}
EOF

echo "[INFO] Restarting alloy service..."
sudo systemctl daemon-reexec
sudo systemctl restart alloy
echo "[INFO] Grafana setup complete."

echo "[INFO] Grafana Alloy configuration applied successfully."
Loading