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

[receiver/awsfirehosereceiver] Add support to ingest logs from services that send directly to firehose #36184

Closed

Conversation

kaiyan-sheng
Copy link
Contributor

@kaiyan-sheng kaiyan-sheng commented Nov 4, 2024

Description

Add support for logs sent from services directly to Firehose. For example VPC flow logs can be sent directly to Firehose and our awsfirehosereceiver should be able to process these requests on top of logs from CloudWatch.

This introduces a new record_type: firehoselogs to separate the log type from record_type: cwlogs. Since there can be logs from different AWS services send directly to Firehose, the format will be different too. This record_type: firehoselogs will process the request, store the whole record data into message field, store the timestamp and firehose ARN.

Link to tracking issue

#36379

Testing

Unit tests and manual smoke tests.

Documentation

Added a section in the README file.

@kaiyan-sheng kaiyan-sheng marked this pull request as ready for review November 7, 2024 22:19
@kaiyan-sheng kaiyan-sheng requested a review from a team as a code owner November 7, 2024 22:19
@kaiyan-sheng kaiyan-sheng requested a review from ChrsMark November 7, 2024 22:19
Copy link
Member

@mwear mwear left a comment

Choose a reason for hiding this comment

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

Can you take a look at the failing checks?

@kaiyan-sheng kaiyan-sheng marked this pull request as draft November 19, 2024 22:19
Comment on lines +6 to +10
type firehoseLog struct {
Timestamp int64 `json:"timestamp"`
FirehoseARN string `json:"firehoseARN"`
Message string `json:"message"`
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nothing produces JSON with these fields does it? IIUC it's just for passing around in memory? If that's the case, I'd suggest dropping the json:"..." tags, as they confused me, and may confuse others.

This is unlike cwlog, where the cWLog struct holds the JSON structure of logs coming from CloudWatch.

builders := make(map[resourceAttributes]*resourceLogsBuilder)
for _, record := range records {
var log firehoseLog
log.Message = string(record)
Copy link
Contributor

Choose a reason for hiding this comment

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

This will lead to unparsed JSON stored in the log record body, right? Should we be attempting to decode the record as JSON, and storing that as a structured body?

Copy link
Contributor

github-actions bot commented Dec 5, 2024

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

Copy link
Contributor

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Dec 20, 2024
@kaiyan-sheng kaiyan-sheng deleted the add_firehose_logs branch December 25, 2024 20:14
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.

3 participants