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

Add note about '/liveness' endpoint for standalone agent #1090

Merged
merged 4 commits into from
Jun 4, 2024

Conversation

kilfoyle
Copy link
Contributor

@kilfoyle kilfoyle commented May 28, 2024

This updates the "Configure monitoring for standalone Elastic Agents" docs page to include mention of the /liveness endpoint added for 8.15. Rel: elastic/elastic-agent#107 (comment)

ADD: Please see my comment below for an additional change to the Fleet-managed agent docs.


Screenshot 2024-05-28 at 11 21 02 AM

Closes: #1090

Copy link

A documentation preview will be available soon.

Request a new doc build by commenting
  • Rebuild this PR: run docs-build
  • Rebuild this PR and all Elastic docs: run docs-build rebuild

run docs-build is much faster than run docs-build rebuild. A rebuild should only be needed in rare situations.

If your PR continues to fail for an unknown reason, the doc build pipeline may be broken. Elastic employees can check the pipeline status here.

@kilfoyle kilfoyle marked this pull request as ready for review May 28, 2024 15:22
@kilfoyle kilfoyle requested a review from a team as a code owner May 28, 2024 15:22
@kilfoyle kilfoyle requested a review from cmacknz May 28, 2024 15:23
shainaraskas
shainaraskas previously approved these changes May 28, 2024
Copy link
Contributor

@shainaraskas shainaraskas left a comment

Choose a reason for hiding this comment

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

approved w/ suggest!

@kilfoyle
Copy link
Contributor Author

ADD: The "Enable agent monitoring" setting in Fleet wasn't documented at all, so I've added it to the Elastic Agent policies page that applies to Fleet-managed agents.

@cmacknz @nimarezainia If the /liveness endpoint should be mentioned in the Fleet docs, maybe we should provide an example of how to call it? As Shaina mentioned, the "where that server is configured to be exposed" part might not be clear, so an example could help.


Screenshot 2024-05-28 at 4 03 42 PM

…agent-monitoring.asciidoc

Co-authored-by: shainaraskas <[email protected]>
Copy link
Contributor

@karenzone karenzone left a comment

Choose a reason for hiding this comment

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

LGTM

@kilfoyle kilfoyle merged commit 3e7d7ef into elastic:main Jun 4, 2024
3 checks passed
@@ -38,6 +38,11 @@ To enable monitoring, set `agent.monitoring.enabled` to `true`. Also set the
collected. If neither setting is specified, monitoring is turned off. Set
`use_output` to specify the output to which monitoring events are sent.

Setting `agent.monitoring.enabled` to `true` also exposes a `/liveness` endpoint. By default, the endpoint
Copy link
Member

Choose a reason for hiding this comment

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

It's actually agent.monitoring.enabled.http that needs to be enabled, agent.monitoring.enabled controls whether we collect monitoring data from agent to be shipped to Fleet.

The liveness probe is an HTTP feature. Sorry for the late review.

Copy link
Contributor Author

@kilfoyle kilfoyle Jun 5, 2024

Choose a reason for hiding this comment

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

Thanks for spotting this @cmacknz!

A couple of questions:

  • Just to make sure I get it right, should it be agent.monitoring.enabled.http or agent.monitoring.http.enabled? In your comment you mentioned the latter.
  • I don't think the setting is available to in Fleet, so I think I should mention the setting only in the standalone agent docs (here). Does that seem right to you?

ADD: Here's a PR with the changes: #1100

@zez3
Copy link

zez3 commented Aug 13, 2024

The current documentation still does not reflect the new liveness option

@kilfoyle can you please fix that?

@nimarezainia
Copy link
Contributor

@zez3 seems to be here: https://www.elastic.co/guide/en/fleet/8.15/elastic-agent-monitoring-configuration.html

image

@kilfoyle
Copy link
Contributor Author

Thanks @nimarezainia!

@zez3
Copy link

zez3 commented Aug 13, 2024

So this will work only for standalone Agents?

@zez3
Copy link

zez3 commented Aug 13, 2024

It can be configured to also monitor the component states and return an error if anything is degraded or has failed.

How?

@zez3
Copy link

zez3 commented Aug 13, 2024

So this will work only for standalone Agents?

I see elastic/kibana#180922 (comment) , so this is not yet fully functional in fleet

@cmacknz
Copy link
Member

cmacknz commented Aug 13, 2024

It isn't in the Fleet UI yet, but the Fleet overrides API will let you control it. We have tests proving Fleet can control the parameters, there just isn't a UI box for it yet.

The request to turn on the HTTP endpoint, which also enables the /liveness endpoint would look something like the following from dev tools:

PUT kbn:/api/fleet/agent_policies/65df03d7-5d26-490c-a24a-ae05095c1a4a
{
    "name": "Agent policy 1",
    "namespace": "default",
    "overrides": {
      "agent": {
          "monitoring": map[string]interface{}{
            "http": map[string]interface{}{
              "enabled": true,
              "host":    "localhost",
              "port":    6792,
            },
        }
    }
}

There is a failon query parameter that controls what it considers "live" to be: https://github.com/elastic/elastic-agent/blob/44528c49507c18e71a4cfd2a6ba4f0904bd32009/elastic-agent.reference.yml#L155-L168

@nimarezainia
Copy link
Contributor

Fleet UI changes: elastic/kibana#153950

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

Successfully merging this pull request may close these issues.

6 participants