Skip to content

Add ability to call diagnostics with V2 protocol and add defaults.#39

Merged
blakerouse merged 3 commits intoelastic:mainfrom
blakerouse:v2-diagnostics
Sep 9, 2022
Merged

Add ability to call diagnostics with V2 protocol and add defaults.#39
blakerouse merged 3 commits intoelastic:mainfrom
blakerouse:v2-diagnostics

Conversation

@blakerouse
Copy link
Copy Markdown
Contributor

Overview

Completes the TODO for supporting the new diagnostics for the V2 protocol. With this change any component that uses the client gets all the defaults from the runtime/pprof included.

The client can have diagnostics that each unit will inherit and then each unit can define its own diagnostic as well.

Elastic Agent will call this per unit to provide all the diagnostics information for the running components unit.

@blakerouse blakerouse added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Sep 7, 2022
@blakerouse blakerouse self-assigned this Sep 7, 2022
@elasticmachine
Copy link
Copy Markdown

elasticmachine commented Sep 7, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-09-07T15:05:36.882+0000

  • Duration: 3 min 3 sec

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

Copy link
Copy Markdown
Member

@cmacknz cmacknz left a comment

Choose a reason for hiding this comment

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

A few minor comments, mostly LGTM.

We will need to have everyone update their agent client version for this to work, we'll need follow up TODOs for this.


// unit hooks after client hooks; allows unit specific to override client hooks
unit.dmx.RLock()
for n, d := range unit.diagHooks {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a reason not to do this in the same lock protected block as for n, d := range c.diagHooks above? I assume it is intentionally the same mutex for both maps?

It's not incorrect I just wanted to double check the intent here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Different lock is used because each unit can have its own hooks and can be registered at any time. So we need to have a unique lock per unit for hook registration.

Co-authored-by: Craig MacKenzie <craig.mackenzie@elastic.co>
Copy link
Copy Markdown
Member

@cmacknz cmacknz left a comment

Choose a reason for hiding this comment

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

LGTM, leave this up for a day or so to give the others time to review. They may find something I can't see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants