Skip to content

Add Multiple Metrics About Search Performance to splunkenterprisereceiver #39569

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

Merged

Conversation

macolby42
Copy link
Contributor

Description

Added a new splunk.search.initiation, splunk.search.duration, splunk.search.status, and splunk.search.success metrics.

Link to tracking issue

Fixes #39566

Testing

Ran on a test stack and observed the metrics in Splunk Observability
search_example

Documentation

The only documentation added was the generated documentation about the newly added metrics.

macolby42 and others added 28 commits December 5, 2024 12:05
* Initial commit

* Corrected structs to fit json API response

* Added to changelog

* PR number added to changelog
@macolby42 macolby42 requested review from MovieStoreGuy and a team as code owners April 22, 2025 22:38
@macolby42 macolby42 changed the title Add Multiple Metrics About Search Performance to splunkenterprisereceiver (#39566) Add Multiple Metrics About Search Performance to splunkenterprisereceiver Apr 22, 2025
@atoulme
Copy link
Contributor

atoulme commented Apr 24, 2025

Almost there - some lint issues:

Error: receiver/splunkenterprisereceiver/scraper.go:2031:25: var-naming: method setSearchJobTTLById should be setSearchJobTTLByID (revive)
func (s *splunkScraper) setSearchJobTTLById(sid string) error {
                        ^
Error: receiver/splunkenterprisereceiver/scraper.go:1924:33: QF1008: could remove embedded field "ControllerConfig" from selector (staticcheck)
		if time.Since(start) > s.conf.ControllerConfig.Timeout {
		                              ^
Error: receiver/splunkenterprisereceiver/scraper.go:1946:77: QF1008: could remove embedded field "ControllerConfig" from selector (staticcheck)
	for entry.Content.DispatchState != StateDone || time.Since(start) < s.conf.ControllerConfig.Timeout {
	                                                                           ^
Error: receiver/splunkenterprisereceiver/scraper.go:2051:23: "200" can be replaced by http.StatusOK (usestdlibvars)
	if res.StatusCode != 200 {
	                     ^

@atoulme atoulme marked this pull request as draft April 24, 2025 05:25
@atoulme
Copy link
Contributor

atoulme commented Apr 24, 2025

Moving to draft while this is being worked on. Please move back to ready when done.

@macolby42 macolby42 marked this pull request as ready for review April 24, 2025 18:36
Comment on lines +160 to +163
splunk.search.status:
enabled: false
splunk.search.success:
enabled: false
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this no the same thing? One is just the count of the other?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The dispatchState property can have many different states so we capture that in splunk.search.status while splunk.search.success is more of a convience metrics that is a quick signal to knowing that the submitted searches have readed the dispatchState of DONE

@macolby42 macolby42 force-pushed the splunkenterprisereceiver_search branch from 9b9b21f to b2b48ac Compare April 29, 2025 17:38
@macolby42 macolby42 requested a review from MovieStoreGuy April 29, 2025 18:06
@MovieStoreGuy MovieStoreGuy merged commit edc64d2 into open-telemetry:main Apr 29, 2025
173 checks passed
@github-actions github-actions bot added this to the next release milestone Apr 29, 2025
@macolby42 macolby42 deleted the splunkenterprisereceiver_search branch April 30, 2025 00:12
vincentfree pushed a commit to ing-bank/opentelemetry-collector-contrib that referenced this pull request May 6, 2025
…iver (open-telemetry#39569)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Added a new `splunk.search.initiation`, `splunk.search.duration`,
`splunk.search.status`, and `splunk.search.success` metrics.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue

Fixes open-telemetry#39566

<!--Describe what testing was performed and which tests were added.-->
#### Testing

Ran on a test stack and observed the metrics in Splunk Observability

![search_example](https://github.com/user-attachments/assets/746768a8-fcca-4a23-8d12-409bb7a72b51)


<!--Describe the documentation added.-->
#### Documentation

The only documentation added was the generated documentation about the
newly added metrics.

<!--Please delete paragraphs that you did not use before submitting.-->

---------

Co-authored-by: Sean Marciniak <[email protected]>
vincentfree pushed a commit to ing-bank/opentelemetry-collector-contrib that referenced this pull request May 20, 2025
…iver (open-telemetry#39569)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Added a new `splunk.search.initiation`, `splunk.search.duration`,
`splunk.search.status`, and `splunk.search.success` metrics.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue

Fixes open-telemetry#39566

<!--Describe what testing was performed and which tests were added.-->
#### Testing

Ran on a test stack and observed the metrics in Splunk Observability

![search_example](https://github.com/user-attachments/assets/746768a8-fcca-4a23-8d12-409bb7a72b51)

<!--Describe the documentation added.-->
#### Documentation

The only documentation added was the generated documentation about the
newly added metrics.

<!--Please delete paragraphs that you did not use before submitting.-->

---------

Co-authored-by: Sean Marciniak <[email protected]>
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.

Add Metrics Around Search Performance
5 participants