Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Add support for metrics in containers and jobs (#830) #1758

Merged
merged 11 commits into from
Jun 20, 2023

Conversation

g-linville
Copy link
Contributor

@g-linville g-linville commented Jun 10, 2023

for #830

Depends on acorn-io/aml#7

Unfortunately this change updated a ridiculous number of test files.

This new feature allows users to specify metrics inside the Acornfile like this:

containers: "mycontainer": {
  image: "myimage"
  metrics: {
    port: 8081
    path: "/metrics"
  }
  ports: ["8080/http", "8081/http"]
}

Acorn runtime will create prometheus.io/{scrape,port,path} annotations on the resulting pods.

Checklist

  • The title of this PR would make a good line in Acorn's Release Note's Changelog
  • The title of this PR ends with a link to the main issue being address in parentheses, like: This is a title (#1216). Here's an example
  • All relevant issues are referenced in the PR description. NOTE: don't use GitHub keywords that auto-close issues
  • Commits follow contributing guidance
  • Automated tests added to cover the changes. If tests couldn't be added, an explanation is provided in the Verification and Testing section
  • Changes to user-facing functionality, API, CLI, and upgrade impacts are clearly called out in PR description
  • PR has at least two approvals before merging (or a reasonable exception, like it's just a docs change)

@g-linville g-linville changed the title Add support for metrics in containers and jobs Add support for metrics in containers and jobs (#830) Jun 12, 2023
Copy link
Contributor

@njhale njhale left a comment

Choose a reason for hiding this comment

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

Looks good!

Just one line of questions for you @g-linville

pkg/controller/appdefinition/deploy.go Show resolved Hide resolved
Copy link
Contributor

@njhale njhale left a comment

Choose a reason for hiding this comment

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

lgtm (pending rebase)

@@ -365,6 +365,9 @@ type Container struct {
ComputeClass *string `json:"class,omitempty"`
Memory *int64 `json:"memory,omitempty"`

// Metrics is available on containers and jobs, but not sidecars
Copy link
Contributor

Choose a reason for hiding this comment

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

How are you enforcing this? AML?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. The AML scheme will not allow users to specify metrics in a sidecar. It has to be done at the container level.

If the metrics are available from the sidecar, it will still work as long as the port that they specify for the metrics is one that the sidecar is using.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! Sounds good to me.

Signed-off-by: Grant Linville <grant@acorn.io>
Signed-off-by: Grant Linville <grant@acorn.io>
Signed-off-by: Grant Linville <grant@acorn.io>
Signed-off-by: Grant Linville <grant@acorn.io>
Signed-off-by: Grant Linville <grant@acorn.io>
Signed-off-by: Grant Linville <grant@acorn.io>
Signed-off-by: Grant Linville <grant@acorn.io>
Signed-off-by: Grant Linville <grant@acorn.io>
Signed-off-by: Grant Linville <grant@acorn.io>
Signed-off-by: Grant Linville <grant@acorn.io>
Signed-off-by: Grant Linville <grant@acorn.io>
@g-linville g-linville merged commit fb40c49 into acorn-io:main Jun 20, 2023
2 checks passed
@g-linville g-linville deleted the first-class-metrics branch June 20, 2023 00:43
cloudnautique pushed a commit to cloudnautique/runtime that referenced this pull request Sep 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants