-
Notifications
You must be signed in to change notification settings - Fork 42
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 ECS fields to process & FS resources #254
Conversation
This pull request does not have a backport label. Could you fix it @uri-weisman? 🙏
|
@@ -40,15 +43,65 @@ const ( | |||
CMDArgumentMatcher = "\\b%s[\\s=]\\/?(\\S+)" | |||
ProcessResourceType = "process" | |||
ProcessSubType = "process" | |||
userHz = 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value of HZ varies across kernel versions and hardware platforms.
There is an assumption here for certain conditions that might not be respected between different deployments and versions.
I think that we can use https://man7.org/linux/man-pages/man3/sysconf.3.html and pull the value of _SC_CLK_TCK
in order to reduce this assumption.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for raising this up @jeniawhite .
It is a borrowed implementation from go-sysinfo, we decided to deliver it with this known limitation while opening 2 new tickets to the go-sysinfo repo.
- Linux kernel ticks assumption is error prone go-sysinfo#122
- Make the "host FS" location configurable go-sysinfo#12
Once those tasks will be delivered, possibly by us, we'll change our implementation to use the go-sysinfo pkg.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
.github/workflows/unit-test.yml
Outdated
@@ -78,6 +78,9 @@ jobs: | |||
runs-on: ubuntu-latest | |||
timeout-minutes: 15 | |||
steps: | |||
- uses: actions/setup-go@v3 | |||
with: | |||
go-version: 1.18 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please set go version using the env var like the unit tests job?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -80,6 +80,8 @@ func (r K8sResource) GetMetadata() fetching.ResourceMetadata { | |||
} | |||
} | |||
|
|||
func (r K8sResource) GetElasticCommonData() any { return nil } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this sit in the kube_fetcher?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me to reside next to the rest of the Resource interface
type Resource interface {
GetMetadata() ResourceMetadata
GetData() any
GetElasticCommonData() any
}
If you feel this is not the place we can move them all.
The work has been done as part of the ECS mapping epic: