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

[exporter/loki] Fix converting log resources to loki labels for multiple log lines #14333

Merged
merged 3 commits into from
Sep 27, 2022

Conversation

rogeriospinaintelipost
Copy link
Contributor

Description:

See the issue description in #14288

Link to tracking Issue:
Resolves #14288

Testing:
Unit tests.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 20, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

@rogeriospinaintelipost rogeriospinaintelipost changed the title [issue-14288] Fix converting log resources to loki labels for multiple log lines [exporter/loki] Fix converting log resources to loki labels for multiple log lines Sep 20, 2022
@jpkrohling
Copy link
Member

@kovrus, can you review this one?

Copy link
Member

@kovrus kovrus left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -63,6 +59,10 @@ func LogsToLoki(ld plog.Logs) (*logproto.PushRequest, *PushReport) {
log := plog.NewLogRecord()
logs.At(k).CopyTo(log)

// we may remove attributes, so we make a copy and change our version
resource := pcommon.NewResource()
Copy link
Member

Choose a reason for hiding this comment

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

I have a feeling we can optimize this, but I'm OK with this approach for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[exporter/loki] Not translating labels(from resources) correctly when multiple logRecords
4 participants