-
Notifications
You must be signed in to change notification settings - Fork 42
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
MM-54986: Disable app and/or agent profiling #658
Conversation
cadb710
to
c34699e
Compare
One concern is that without tweaking the template we'd still be registering an application but with no targets. I am wondering if that could potentially get confusing or even cause issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, feel free to ask for another review if what Claudio mentioned causes any issues.
Ended up using go-yaml not to parse the generated string, but to generate the yaml from scratch. I'm testing it right now in a deployment to make sure that the generated config is valid for Pyroscope. |
Tested this with 2 app nodes, 2 agents, and all combinations of the settings, and all work. If both are false, we just don't get anything:
log-level: debug
no-self-profiling: true
scrape-configs:
- job-name: pryoscope
scheme: http
scrape-interval: 60s
enabled-profiles: [cpu, mem, goroutines]
static-configs:
- application: mattermost
spy-name: gospy
targets: ['app-0:8067', 'app-1:8067']
- application: agentsab
spy-name: gospy
targets: ['agent-0:4000', 'agent-1:4000']
log-level: debug
no-self-profiling: true
scrape-configs:
- job-name: pryoscope
scheme: http
scrape-interval: 60s
enabled-profiles: [cpu, mem, goroutines]
static-configs:
- application: agents
spy-name: gospy
targets: ['agent-0:4000', 'agent-1:4000']
log-level: debug
no-self-profiling: true
scrape-configs:
- job-name: pryoscope
scheme: http
scrape-interval: 60s
enabled-profiles: [cpu, mem, goroutines]
static-configs:
- application: mattermost
spy-name: gospy
targets: ['app-0:8067', 'app-1:8067']
log-level: debug
no-self-profiling: true
scrape-configs:
- job-name: pryoscope
scheme: http
scrape-interval: 60s
enabled-profiles: [cpu, mem, goroutines] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks so much better, I appreciate the time taken to rework this 🥇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one
Summary
Motivated for the huge amount of memory consumed by profiling 50 agents in the ceiling tests, we decided to allow the user to selectively disable that type of profiling. This PR solves that by making it optional to profile both the app and the agent nodes.
Note that the approach to test the generated yaml is a bit esoteric, but parsing the generated yaml seemed even more convoluted than this. I'm open to changing it if your eyes bleed a lot when reading the test, though.Ended up using go-yaml to generate the config, much easier and cleaner.Ticket Link
https://mattermost.atlassian.net/browse/MM-54986