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

Receive logs in normal JSON or plain text from Kafka. #20734

Closed
h0cheung opened this issue Apr 6, 2023 · 5 comments
Closed

Receive logs in normal JSON or plain text from Kafka. #20734

h0cheung opened this issue Apr 6, 2023 · 5 comments
Labels
enhancement New feature or request receiver/kafka

Comments

@h0cheung
Copy link
Contributor

h0cheung commented Apr 6, 2023

Component(s)

receiver/kafka

Is your feature request related to a problem? Please describe.

Some tools and cloud services may send logs to Kafka in JSON format or even as plain text. We don't have a way to receive them yet. The raw unmarshaler can only receive them as bytes, and we can't even find any component to decode them into strings. Also, it doesn't add ObservedTime to the logs, which should be added.

Describe the solution you'd like

We should add a text unmarshaler to decode the logs from Kafka messages into strings, and add ObservedTime to them. For compatibility, encodings rather than UTF-8, such as GBK, BIG5, SHIFT_JIS, etc. should be supported.

Describe alternatives you've considered

No response

Additional context

No response

@h0cheung h0cheung added enhancement New feature or request needs triage New item requiring triage labels Apr 6, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2023

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@atoulme atoulme removed the needs triage New item requiring triage label Apr 6, 2023
@atoulme
Copy link
Contributor

atoulme commented Apr 6, 2023

That sounds like a good enhancement to me (I implemented raw support, maybe raw should move from byte array to string).

h0cheung added a commit to h0cheung/opentelemetry-collector-contrib that referenced this issue May 16, 2023
…ver (open-telemetry#20734)

The decoder is copied from operator helper in stanza to coreinternal.

Use a config like `encoding: text_utf-8` to specify the character encoding.

Signed-off-by: zhanghonghaobj <[email protected]>
codeboten pushed a commit that referenced this issue May 17, 2023
#20857)

Add text unmarshaler, which will decode the kafka message as text and insert it as the body of a log record.

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

github-actions bot commented Jun 6, 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.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2023

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@crobert-1
Copy link
Member

crobert-1 commented Oct 5, 2023

It looks like this was actually resolved by #20857 and #24028, I'll mark it as such.

yutingcaicyt pushed a commit to yutingcaicyt/opentelemetry-collector-contrib that referenced this issue Jan 17, 2024
…ver (open-telemetry#20734)

The decoder is copied from operator helper in stanza to coreinternal.

Use a config like `encoding: text_utf-8` to specify the character encoding.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request receiver/kafka
Projects
None yet
Development

No branches or pull requests

3 participants