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

New component: File Receiver #14638

Closed
2 tasks
pmcollins opened this issue Oct 3, 2022 · 26 comments
Closed
2 tasks

New component: File Receiver #14638

pmcollins opened this issue Oct 3, 2022 · 26 comments
Labels
Accepted Component New component has been sponsored

Comments

@pmcollins
Copy link
Member

pmcollins commented Oct 3, 2022

The purpose and use-cases of the new component

The File Receiver reads the output of a File Exporter and replays it into a collector.

The intent is for this receiver to be a counterpart to the File Exporter. Like the File Exporter, it should ultimately support:

  • JSON and Protobuf
  • metrics, logs, and traces
  • compression
  • automatically reading from rotated files as written by a File Exporter

However, initial versions can support just a subset of these features and still be useful.

When it replays telemetry, it should read the timestamps of the next telemetry message and wait for the appropriate amount of time before sending, while setting telemetry timestamps to be current (this can be a setting if preferable). Users should be able to set a multiplier in the config so that telemetry can be sent faster or slower than initially received.

This functionality could be used for development, demos, and for reproducing issues.

Example configuration for the component

file:
  path: metrics.json
  format: json
  compression: zstd
  duration_multiplier: 0.5

Telemetry data types supported

Traces, metrics, and logs.

Is this a vendor-specific component?

  • This is a vendor-specific component
  • If this is a vendor-specific component, I am proposing to contribute this as a representative of the vendor.

Sponsor (optional)

No response

Additional context

@ccordi and I have written an early implementation that can read metrics in JSON format.

@pmcollins pmcollins added the needs triage New item requiring triage label Oct 3, 2022
@atingchen
Copy link
Contributor

Hi, there is already a otlpjsonfile receiver that may work for the json format. We should talk about how to adapt or merge with that one

@atingchen
Copy link
Contributor

Can we import data using fileconsume?

@atingchen
Copy link
Contributor

atingchen commented Oct 4, 2022

Can we rename 'otlpjsonfile receiver' to 'file receiver'? This will cause a breaking change. @djaglowski @atoulme

@djaglowski
Copy link
Member

If we can sufficiently generalize the otlpjsonfile receiver, then I think it could reasonably be "renamed". However, I think we might as well just start by copying the codebase. If this component progresses far enough, then we can probably deprecate the otlpjsonfile receiver.

@atingchen
Copy link
Contributor

I feel like this might be a better transition to the new receiver.

@atoulme
Copy link
Contributor

atoulme commented Oct 4, 2022

The otlpjsonfile receiver was named as such because it served the purpose of reading from specific files. I don't think this is the same as this receiver, which aims to read from a file, but also replay and do more with it.
The feedback I had around otlpjsonfile was that the file exporter should be renamed otlpjsonfile, not the other way around.
In any case, that's not related to this proposal. Maybe this receiver should be named "replay" receiver?

@atingchen
Copy link
Contributor

@atoulme Thanks for your opinion.
File exporter now not only exports data in json format, but also supports data in proto format and compressed data. So I think it might be inappropriate to rename the file exporter to otlpjsonfile.
Let's keep the parallel development of the two receivers. I think the code of otlpjsonfile can be reused by the new receiver, because the new receiver also needs to read the json format data exported by the file exporter by default.

@djaglowski
Copy link
Member

The feedback I had around otlpjsonfile was that the file exporter should be renamed otlpjsonfile, not the other way around.

If I remember correctly, the rationale was that the a receiver focused on ingesting only one specific format should be named accodingly.

What is proposed here is a receiver that would ingest all formats emitted by the corresponding fileexporter. I believe this would be sufficient to warrant the more generic name of filereceiver.

this receiver, which aims to read from a file, but also replay and do more with it

This is an important point. The replay use case makes sense in its own right, but the primary purpose of the filereceiver should be to read signals from files without altering them. In my opinion, the replay use case would best be served by a separate receiver that shares much of the code from this one.

@evan-bradley evan-bradley added Sponsor Needed New component seeking sponsor and removed needs triage New item requiring triage labels Oct 5, 2022
@atingchen
Copy link
Contributor

@djaglowski Can we accept this receiver?

@djaglowski
Copy link
Member

I'm willing to sponsor this component without the replay functionality and would be open adding replay oriented features later.

@atingchen
Copy link
Contributor

Hi @pmcollins. Do you still have time to support this recently?

@pmcollins
Copy link
Member Author

Hi @atingchen, I'd be happy to provide an initial implementation (JSON, metrics, no compression) based on the work we have already done here. Additional features would need to be done separately.

Hi @djaglowski, regarding replay functionality, I'm envisioning making available: 1) reading the timestamps of the metrics at the playhead and waiting the delta duration to send them and 2) setting the metrics timestamp to be current. Both of these could be enabled or disabled via a configuration setting. Can these features be added to this receiver out of the gate?

@djaglowski
Copy link
Member

I'm envisioning making available: 1) reading the timestamps of the metrics at the playhead and waiting the delta duration to send them and 2) setting the metrics timestamp to be current. Both of these could be enabled or disabled via a configuration setting. Can these features be added to this receiver out of the gate?

The functionality seems reasonable to me, but for the sake of being able to review the code, it would be very helpful to me if we have a fully functioning receiver first. We can add replay immediately afterwards though.

@pmcollins
Copy link
Member Author

Ah, got it. Will do it like that then, thanks.

@pmcollins
Copy link
Member Author

Sorry for the delay. I'm starting on this now.

@MovieStoreGuy MovieStoreGuy added Accepted Component New component has been sponsored and removed Sponsor Needed New component seeking sponsor labels Dec 28, 2022
@MovieStoreGuy
Copy link
Contributor

@djaglowski are you happy being the sponsor for this? I assume your answer hasn't change :)

@djaglowski
Copy link
Member

Yes, thanks for updating the labels accordingly.

@rboada04
Copy link

@pmcollins Hi, is there an issue to track the support for reading trace files and rotated files?

@pmcollins
Copy link
Member Author

Hi @rboada04, there is not as of yet. Since those capabilities are mentioned above, I thought we could just use this issue. Do you think we should capture them separately?

@rboada04
Copy link

rboada04 commented Feb 27, 2023

It may be good to track in a different issue if the support for each of the telemetry data type (e.g. traces, logs) will be done separately.

At a minimum, I think we need to keep a checklist on this issue of the open items that have been called out. Support for traces & logs, and use of the fileconsumer package come to mind.

codeboten pushed a commit that referenced this issue Mar 23, 2023
 This change adds the ability to replay metrics at the same rate that they were originally received. (I also have a change to update the timestamps to current values but left that out for now to keep the diff smaller.)

Link to tracking Issue: #14638
@github-actions
Copy link
Contributor

github-actions bot commented May 1, 2023

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@github-actions github-actions bot added the Stale label May 1, 2023
@remram44
Copy link

remram44 commented May 1, 2023

Not inactive, work is happening in #20440

@atoulme atoulme removed the Stale label May 1, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2023

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@github-actions github-actions bot added the Stale label Jul 3, 2023
@remram44
Copy link

remram44 commented Jul 3, 2023

I actually don't know what the next step is. The feature is still wanted though!

@github-actions github-actions bot removed the Stale label Jul 3, 2023
@crobert-1
Copy link
Member

This receiver has been merged and is included in releases of the contrib collector now.

We can close this issue as completed by #20440 and this PR now, right?

@atoulme
Copy link
Contributor

atoulme commented Jul 21, 2023

Correct. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Component New component has been sponsored
Projects
None yet
Development

No branches or pull requests

9 participants