Skip to content

[receiver/splunkenterprise] send search job TTL in seconds instead of nanoseconds - #50941

Open
grvwy wants to merge 1 commit into
open-telemetry:mainfrom
grvwy:fix-splunk-search-job-ttl-units
Open

[receiver/splunkenterprise] send search job TTL in seconds instead of nanoseconds#50941
grvwy wants to merge 1 commit into
open-telemetry:mainfrom
grvwy:fix-splunk-search-job-ttl-units

Conversation

@grvwy

@grvwy grvwy commented Sep 12, 2026

Copy link
Copy Markdown

Description

setSearchJobTTLByID formatted the configured timeout with %d which emits raw nanosecond count rather than seconds and Splunks setttl action reads the argument as seconds. A default timeout of 60s therefore dispatched every search job in Splunk with a lifespan of roughly 1902 years. Artifacts accumulated in the dispatch directory until parition filled and Splunk reported extreme search lag.

Converted the duration to whole seconds and added a tests for regression and lack of tests for this bug.

Link to tracking issue

Fixes #50940

Testing

  • Added TestSetSearchJobTTLByID to scraper_test.go. Table-driven over three timeouts: 60s -> 60, 11s -> 11, 2m -> 120
  • Confirmed it genuinely catches the bug, with the original code the test catches expected: "60" atcual: "60000000000".

Documentation

No documentation needed except comments.

Authorship

  • I, a human, wrote this pull request description myself.

… nanoseconds

setSearchJobTTLByID formatted the configured Timeout with %d. Because that value
is a time.Duration, %d emits its raw nanosecond count rather than seconds, and
Splunk's setttl action reads the argument as seconds. A default timeout of 60s
therefore asked Splunk to retain every dispatched search job for roughly 1900
years, so artifacts accumulated in the dispatch directory until the search
partition filled and Splunk reported extreme search lag.

Convert the duration to whole seconds, and add a regression test covering the
control request, which previously had no coverage at all.

Assisted-by: Claude Opus 5
@linux-foundation-easycla

linux-foundation-easycla Bot commented Sep 12, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: grvwy / name: grvwy (b1f03d3)

@github-actions github-actions Bot added the first-time contributor PRs made by new contributors label Sep 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib.

Important reminders:

  • Read our Contributing Guidelines.
  • Sign the CLA if you haven't already.
  • Follow the OpenTelemetry Generative AI policy: disclose any AI use in your contribution, and communicate (PR descriptions, review replies) in your own words rather than AI-generated text.
  • Give reviewers at least a few days before pinging them for feedback.
  • If you need help with general setup, development process, or contributor etiquette, ask in #opentelemetry-new-contributors.
  • First-time contributors should keep at most one PR marked as ready for review until their first PR is merged; once two are open for review, any further PR is automatically converted to draft.
  • If your change isn't one of our priority components, reviews may take more time.
  • Raise technical or Collector-specific questions in #otel-collector-dev or a Collector SIG meeting.

@grvwy
grvwy marked this pull request as ready for review September 12, 2026 00:36
@grvwy
grvwy requested review from a team and MovieStoreGuy as code owners September 12, 2026 00:36
@singhvibhanshu

Copy link
Copy Markdown
Member

/workflow-approve

@grvwy

grvwy commented Sep 12, 2026

Copy link
Copy Markdown
Author

This was bug was introduced in v0.126.0 PR #39569 just as an FYI if you'd like to backport it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[receiver/splunkenterprise] search job TTL converted and sent in nanoseconds instead of seconds

2 participants