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

[PLINT-542] Add machines metrics #19285

Open
wants to merge 7 commits into
base: sarah/add-octopus-integration
Choose a base branch
from

Conversation

sarah-witt
Copy link
Contributor

What does this PR do?

Add support for collecting metrics about machines and deployment targets

Motivation

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add the qa/skip-qa label if the PR doesn't need to be tested during QA.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

@sarah-witt sarah-witt changed the base branch from master to sarah/add-octopus-integration December 18, 2024 20:51
@sarah-witt sarah-witt marked this pull request as ready for review December 18, 2024 20:59
@sarah-witt sarah-witt requested review from a team as code owners December 18, 2024 20:59
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.36%. Comparing base (7088354) to head (69d8d13).

Additional details and impacted files
Flag Coverage Δ
octopus_deploy 99.12% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

]
machine_tags += roles
self.gauge("machine.count", 1, tags=self._base_tags + machine_tags)
self.gauge("machine.is_healthy", is_healthy, tags=self._base_tags + machine_tags)
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the purpose of also reporting it as a metric if we already report it as a tag?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's easier to monitor on, and the tag gives more specific/detailed information

roles = machine.get("Roles", [])
health_status = machine.get("HealthStatus", None)
is_healthy = health_status.startswith("Healthy")
machine_tags = [
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about adding OperatingSystem as a machine_os tag?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added!

"Uri": "hostname-test:10933/",
"IsDisabled": false,
"MachinePolicyId": "MachinePolicies-1",
"HealthStatus": "Healthy",
Copy link
Contributor

Choose a reason for hiding this comment

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

We're only testing HealthStatus with Healthy value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added multiple health status values!

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.

3 participants