Skip to content
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

otlpjsonfilereceiver: add a replay_file config option to support heartbeats #31534

Merged
merged 3 commits into from
Apr 18, 2024

Conversation

ridwanmsharif
Copy link
Member

Description:

This change adds a config option to allow users to replay static telemetry at an interval (poll_interval is the configurable interval).

This is useful for some usecases like:

  • Sending a heartbeat log to a logging backend, as a signal that the logging agent is alive
  • Sending static metadata as metrics to metrics backend. The metadata can be read using the otlpjsonfilereceiver that uses this package and config.

Link to tracking Issue:
#31533

Testing:

  • Manual testing
  • unit test for the fileconsumer
  • test for the otlpjsonfilereceiver

Documentation:

@ridwanmsharif ridwanmsharif requested a review from a team March 2, 2024 02:26
Copy link

linux-foundation-easycla bot commented Mar 2, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@atoulme
Copy link
Contributor

atoulme commented Mar 2, 2024

Please add a changelog. Do you mean to use the PollInterval setting to set the replay interval?

@ridwanmsharif ridwanmsharif force-pushed the ridwanmsharif/replay branch from 9ffb51b to 6fb5853 Compare March 4, 2024 16:36
@ridwanmsharif
Copy link
Member Author

Please add a changelog. Do you mean to use the PollInterval setting to set the replay interval?

Yes, PollInterval is what you would use to configure the intervals for the replay

@ridwanmsharif ridwanmsharif force-pushed the ridwanmsharif/replay branch from 6fb5853 to 25ac8d8 Compare March 4, 2024 17:21
@ridwanmsharif ridwanmsharif force-pushed the ridwanmsharif/replay branch from 25ac8d8 to d87a14c Compare March 8, 2024 20:12
@ridwanmsharif ridwanmsharif changed the title pkg/stanza: add a replay_file config option to support heartbeats otlpjsonfilereceiver: add a replay_file config option to support heartbeats Mar 8, 2024
@ridwanmsharif ridwanmsharif requested a review from djaglowski March 8, 2024 20:16
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Mar 23, 2024
@djaglowski djaglowski removed the Stale label Apr 4, 2024
@ridwanmsharif ridwanmsharif force-pushed the ridwanmsharif/replay branch 2 times, most recently from 98ad43d to ccf8920 Compare April 17, 2024 21:06
Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

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

Nice, I like how this came out. It gives me hope we can move further in the direction of modularizing various aspects of the fileconsumer package.

@djaglowski
Copy link
Member

Code looks good to me generally, just some CI failures to address

This change adds a config option to allow users to replay static
telemetry at an interval (poll_interval is the configurable interval).

This is useful for some  usecases like:
- Sending a heartbeat log to a logging backend, as a signal that the
  logging agent is alive
- Sending static metadata as metrics to metrics backend. The metadata
  can be read using the `otlpjsonfilereceiver` that uses this package
  and config.

Signed-off-by: Ridwan Sharif <[email protected]>
… instead

This change does the following:
- Removes the replay_file option from the filecononsumer config, in
  favor of a build option
- When no tracking is used, we don't keep track of known or previously
  polled files. Instead reading only currently polled files that fit the
  pattern
- Adds tests
@ridwanmsharif ridwanmsharif force-pushed the ridwanmsharif/replay branch 2 times, most recently from e486da7 to 9e73ca3 Compare April 18, 2024 18:27
Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

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

Thanks @ridwanmsharif!

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.

4 participants