-
Notifications
You must be signed in to change notification settings - Fork 16
DLPX-96312 Add InfluxDB/Telegraf infrastructure for Engine Performance Analytics #119
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
Open
dbshah12
wants to merge
13
commits into
develop
Choose a base branch
from
dlpx/pr/dbshah12/5d79e679-49b6-4c0a-8241-1c919bfcaedb
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
398bc87
DLPX-96312 Add InfluxDB/Telegraf infrastructure for Engine Performanc…
dbshah12 e5e0587
nginx
dbshah12 e7b0552
DLPX-96312 Add nfs and iscsi data in influxDb
dbshah12 bfbb270
DLPX-96312 Sending all data to influxDB now
dbshah12 d27a122
Back merged
dbshah12 07eec3f
DLPX-96312 Resolved Slack Review comments
dbshah12 b30f511
DLPX-96312 Add perf-diagnostics-deploy skill for Telegraf/InfluxDB de…
dbshah12 0fb7aea
DLPX-96312 Filter garbage stat names from estat metaslab-alloc output
dbshah12 60660da
DLPX-96312 Trim Telegraf field sets and intervals to reduce InfluxDB …
dbshah12 c2403c3
DLPX-96312 Route non-Grafana metrics to separate support_metrics Infl…
dbshah12 33e9533
DLPX-96312 Route tcp_stats to default InfluxDB bucket instead of supp…
dbshah12 5c849f5
fix(connstat): replace mawk with Python to fix stdout buffering
dbshah12 daae5c1
DLPX-96312 Fix tcp_stats data to have right fields only in default bu…
dbshah12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,233 @@ | ||
| --- | ||
| name: perf-diagnostics-deploy | ||
| description: Use when making changes to Telegraf or InfluxDB config files in the performance-diagnostics repo and wanting to test those changes on a live Delphix engine via SSH | ||
| --- | ||
|
|
||
| # Performance Diagnostics Deploy & Verify | ||
|
|
||
| ## Overview | ||
|
|
||
| Workflow for making config changes to the performance-diagnostics repo, deploying them to a Delphix test engine over SSH, and verifying the changes are working correctly via InfluxDB queries. | ||
|
|
||
| ## Workflow | ||
|
|
||
| ```dot | ||
| digraph deploy { | ||
| "Make changes" -> "Ask: test on engine?"; | ||
| "Ask: test on engine?" -> "Done" [label="no"]; | ||
| "Ask: test on engine?" -> "Ask: which engine hostname?" [label="yes"]; | ||
| "Ask: which engine hostname?" -> "SSH as delphix, ask for password"; | ||
| "SSH as delphix, ask for password" -> "Deploy changed files"; | ||
| "Deploy changed files" -> "Restart services"; | ||
| "Restart services" -> "Wait 5 min"; | ||
| "Wait 5 min" -> "Query InfluxDB, verify changes"; | ||
| } | ||
| ``` | ||
|
|
||
| ## Step 1 — Make Changes | ||
|
|
||
| Make the requested code/config changes. Summarise what was changed and why before asking about testing. | ||
|
|
||
| ## Step 2 — Ask to Test | ||
|
|
||
| ``` | ||
| Changes done. Do you want to test these on a Delphix engine? | ||
| ``` | ||
|
|
||
| If no → stop. If yes → proceed. | ||
|
|
||
| ## Step 3 — Get Engine + Password | ||
|
|
||
| ``` | ||
| Which Delphix engine hostname should I deploy to? | ||
| ``` | ||
|
|
||
| Then SSH using `sshpass`: | ||
| ```bash | ||
| sshpass -p "$PASSWORD" ssh -o StrictHostKeyChecking=no delphix@$HOST "..." | ||
| ``` | ||
|
|
||
| Ask for the SSH password if not already known. Default user is always `delphix`. | ||
|
|
||
| ## Step 4 — Deploy Changed Files | ||
|
|
||
| **File locations on engine:** | ||
|
|
||
| | Repo path | Engine path | | ||
| |---|---| | ||
| | `telegraf/telegraf.base` | `/etc/telegraf/telegraf.base` | | ||
| | `telegraf/telegraf.inputs.*` | `/etc/telegraf/telegraf.inputs.*` | | ||
| | `telegraf/connstat-stats.sh` | `/etc/telegraf/connstat-stats.sh` | | ||
| | `telegraf/nfs-threads.sh` | `/etc/telegraf/nfs-threads.sh` | | ||
| | `telegraf/zcache-stats.sh` | `/etc/telegraf/zcache-stats.sh` | | ||
| | `telegraf/zpool-iostat-o.sh` | `/etc/telegraf/zpool-iostat-o.sh` | | ||
| | `telegraf/delphix-telegraf-service` | `/usr/bin/delphix-telegraf-service` | | ||
| | `telegraf/perf_playbook` | `/usr/bin/perf_playbook` | | ||
| | `telegraf/delphix-telegraf.service` | `/lib/systemd/system/delphix-telegraf.service` | | ||
| | `influxdb/delphix-influxdb-init` | `/usr/bin/delphix-influxdb-init` | | ||
| | `influxdb/delphix-influxdb-service` | `/usr/bin/delphix-influxdb-service` | | ||
| | `influxdb/perf_influxdb` | `/usr/bin/perf_influxdb` | | ||
| | `influxdb/influxdb.toml` | `/etc/influxdb/influxdb.toml` | | ||
| | `influxdb/influxdb-init.conf` | `/etc/influxdb/influxdb-init.conf` | | ||
| | `influxdb/delphix-influxdb.service` | `/lib/systemd/system/delphix-influxdb.service` | | ||
| | `influxdb/influxdb-nginx.conf` | `/opt/delphix/server/etc/nginx/conf.d/influxdb.conf` | | ||
|
|
||
| Only copy files that were actually changed. Use `scp` to `/tmp/` first, then `sudo cp` to destination. Set `chmod +x` on any shell scripts. | ||
|
|
||
| **InfluxDB data directory:** `/var/lib/influxdb/engine` | ||
|
|
||
| ## Step 5 — Restart Services | ||
|
|
||
| ```bash | ||
| sudo systemctl restart delphix-influxdb | ||
| sleep 5 | ||
| sudo systemctl restart delphix-telegraf | ||
|
|
||
| # Confirm both are active | ||
| systemctl is-active delphix-influxdb | ||
| systemctl is-active delphix-telegraf | ||
| ``` | ||
|
|
||
| ## Step 6 — Wait 5 Minutes | ||
|
|
||
| Wait for data to flow into InfluxDB. Use `ScheduleWakeup` with `delaySeconds: 270` (within cache window). | ||
|
|
||
| ## Step 7 — Verify via InfluxDB Query | ||
|
|
||
| Get the InfluxDB credentials from the engine: | ||
| ```bash | ||
| sudo cat /etc/influxdb/influxdb_meta | ||
| ``` | ||
|
|
||
| Query InfluxDB using the Flux API to verify the changes for the **last 5 minutes** of data. Tailor the query to what was changed: | ||
|
|
||
| | Change type | What to verify | | ||
| |---|---| | ||
| | New measurement added | `from(bucket:"default") |> range(start: -5m) |> filter(fn: (r) => r._measurement == "new_measurement") |> count()` | | ||
| | Field removed (e.g. `wwid` tag) | Check tag keys don't include the removed tag | | ||
| | Histogram processors | Verify `hist_estat_*` measurements exist with bucket fields | | ||
| | `microseconds` field | Check field exists in relevant measurements | | ||
| | `connstat` aggregation | Verify `tcp_stats` has `service` and `connections` fields | | ||
|
|
||
| Query via curl: | ||
| ```bash | ||
| curl -s -X POST "http://localhost:8086/api/v2/query?org=delphix" \ | ||
| -H "Authorization: Token $INFLUXDB_READ_TOKEN" \ | ||
| -H "Content-Type: application/vnd.flux" \ | ||
| -d 'from(bucket:"default") |> range(start: -5m) |> filter(fn:(r) => r._measurement == "MEASUREMENT") |> limit(n:5)' | ||
| ``` | ||
|
|
||
| Report results clearly: what measurements exist, what fields/tags are present, and whether the change is confirmed working. | ||
|
|
||
| Then ask: | ||
|
|
||
| ``` | ||
| Verification done. Do you want to commit these changes? | ||
| ``` | ||
|
|
||
| If no → stop. If yes → proceed to Step 8. | ||
|
|
||
| ## Step 8 — Commit Changes | ||
|
|
||
| Show the latest commit: | ||
| ```bash | ||
| git log -1 --oneline | ||
| ``` | ||
|
|
||
| Ask: | ||
| ``` | ||
| Latest commit: "<hash> <message>" | ||
| Do you want to (1) amend that commit or (2) create a new commit? | ||
| ``` | ||
|
|
||
| **If amend:** | ||
| ```bash | ||
| git add -A | ||
| git commit --amend --no-edit | ||
| ``` | ||
|
|
||
| **If new commit:** | ||
| Ask: | ||
| ``` | ||
| What should the commit message be? (include the Jira ID, e.g. "DLPX-12345 Fix xyz") | ||
| ``` | ||
|
|
||
| Then: | ||
| ```bash | ||
| git add -A | ||
| git commit -m "<message from user>" | ||
| ``` | ||
|
|
||
| Then ask: | ||
| ``` | ||
| Commit done. Do you want to push and update/raise a PR? | ||
| ``` | ||
|
|
||
| If no → stop. If yes → proceed to Step 9. | ||
|
|
||
| ## Step 9 — Push and PR | ||
|
|
||
| `git review` is a Delphix tool that pushes the branch and creates/updates the PR in one command. Use it instead of `git push` + `gh pr create`. | ||
|
|
||
| First check for an existing open PR on the current branch: | ||
| ```bash | ||
| gh pr list --head "$(git branch --show-current)" --state open | ||
| ``` | ||
|
|
||
| **If PR exists → update it:** | ||
|
|
||
| ```bash | ||
| git review -r <PR_number> | ||
| ``` | ||
|
|
||
| Then fetch the current PR description and update it to reflect the new changes: | ||
| ```bash | ||
| gh pr view <number> --json body | ||
| gh pr edit <number> --body "..." | ||
| ``` | ||
| Keep the existing structure but add/update the relevant sections. | ||
|
|
||
| **If no PR exists → raise a new one:** | ||
|
|
||
| Ask: | ||
| ``` | ||
| What is the Jira ticket number for this PR? (e.g. DLPX-12345) | ||
| ``` | ||
|
|
||
| Fetch the Jira issue using the Jira MCP tool (`mcp__jira__jira_get_issue`) to understand the problem context. Then run: | ||
|
|
||
| ```bash | ||
| git review | ||
| ``` | ||
|
|
||
| This creates the PR as a draft. Get the PR URL from the output, then set a full description: | ||
|
|
||
| ```bash | ||
| gh pr edit <number> --title "<JIRA>: <short title>" --body "$(cat <<'EOF' | ||
| ## Summary | ||
| - <bullet points describing what changed and why> | ||
|
|
||
| ## Problem | ||
| <derived from Jira issue description> | ||
|
|
||
| ## Solution | ||
| <what was implemented> | ||
|
|
||
| ## Testing | ||
| - [ ] Deployed to test engine | ||
| - [ ] InfluxDB queries confirmed data flowing correctly | ||
| - [ ] <other relevant checks> | ||
|
|
||
| Jira: <JIRA_URL> | ||
| EOF | ||
| )" | ||
| ``` | ||
|
|
||
| Return the PR URL to the user. | ||
|
|
||
| ## Common Mistakes | ||
|
|
||
| - Forgetting `chmod +x` on shell scripts → Telegraf fails with `EXEC` error | ||
| - Restarting Telegraf before InfluxDB is ready → Telegraf starts with `[[outputs.discard]]` | ||
| - Querying before 5 minutes pass → no data in range, looks broken but isn't | ||
| - Copying the wrong file path (influxdb vs telegraf directories) |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.