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

MM-54986: Disable app and/or agent profiling #658

Merged
merged 7 commits into from
Nov 2, 2023

Conversation

agarciamontoro
Copy link
Member

@agarciamontoro agarciamontoro commented Oct 30, 2023

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

@agarciamontoro agarciamontoro added the 2: Dev Review Requires review by a core committer label Oct 30, 2023
@agarciamontoro agarciamontoro changed the title MM-54986: Agent profiling MM-54986: Disable app and/or agent profiling Oct 30, 2023
@agarciamontoro agarciamontoro force-pushed the MM-54986.agent.profiling branch from cadb710 to c34699e Compare October 30, 2023 20:15
@streamer45
Copy link
Contributor

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.

Copy link
Member

@isacikgoz isacikgoz left a 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.

@agarciamontoro
Copy link
Member Author

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.

@agarciamontoro
Copy link
Member Author

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:

image

  • EnableAppProfiling: true
  • EnableAgentProfiling: true
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']
  • EnableAppProfiling: false
  • EnableAgentProfiling: true
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']
  • EnableAppProfiling: true
  • EnableAgentProfiling: false
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']
  • EnableAppProfiling: false
  • EnableAgentProfiling: false
log-level: debug
no-self-profiling: true
scrape-configs:
    - job-name: pryoscope
      scheme: http
      scrape-interval: 60s
      enabled-profiles: [cpu, mem, goroutines]

Copy link
Contributor

@streamer45 streamer45 left a 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 🥇

Copy link
Member

@agnivade agnivade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one

@agarciamontoro agarciamontoro added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core committer labels Nov 2, 2023
@agarciamontoro agarciamontoro merged commit b17782a into master Nov 2, 2023
1 check passed
@agarciamontoro agarciamontoro deleted the MM-54986.agent.profiling branch November 2, 2023 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants