-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Splunkenterprisereceiver add health metric (#36695) #36695
base: main
Are you sure you want to change the base?
Conversation
* Initial commit * Corrected structs to fit json API response * Added to changelog * PR number added to changelog
Build fails with
|
@@ -156,3 +157,17 @@ type DispatchArtifactContent struct { | |||
StatusCacheSize string `json:"cached_job_status_status_csv_size_mb"` | |||
CacheTotalEntries string `json:"cached_job_status_total_entries"` | |||
} | |||
|
|||
// '/services/server/health/splunkd/details | |||
type HealthArtifacts struct { |
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.
type HealthArtifacts struct { | |
type healthArtifacts struct { |
limit your exported API to the minimum to avoid dependencies down the road using your internal structs.
Entries []HealthArtifactEntry `json:"entry"` | ||
} | ||
|
||
type HealthArtifactEntry struct { |
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.
type HealthArtifactEntry struct { | |
type healthArtifactEntry struct { |
Content HealthDetails `json:"content"` | ||
} | ||
|
||
type HealthDetails struct { |
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.
type HealthDetails struct { | |
type healthDetails struct { |
| Name | Description | Values | | ||
| ---- | ----------- | ------ | | ||
| splunk.feature | The Feature name from the Splunk Health Introspection Endpoint | Any Str | | ||
| splunk.feature.health | The Health (in color form) of a Splunk Feature from the Splunk Health Introspection Endpoint | Any Str | |
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.
sure you need that? you already get the status via the value right?
Description
Adds
splunk.health
metric that uses the introspection endpoint at/services/server/health/splunkd/details
. The metric features 2 attributes:splunk.feature
: Describes the part of the server's featuresplunk.feature.health
: Describes (in red, yellow, green) the health status of the given featureThe metric will remain a value of 1 unless the feature's health becomes 'red.'
Testing
Built a custom version of splunk-otel-collector that referenced this code. Then ran it on a Splunk stack, and received metrics out. Also created generated tests.
Documentation
Added an entry to
documentation.md
describing the new metric.