Skip to content

Commit

Permalink
file
Browse files Browse the repository at this point in the history
  • Loading branch information
khushijain21 committed Dec 31, 2024
1 parent cd0fa59 commit eb36d63
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
12 changes: 1 addition & 11 deletions receiver/otlpjsonfilereceiver/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,7 @@ func createProfilesReceiver(_ context.Context, settings receiver.Settings, confi
}
input, err := cfg.Config.Build(settings.TelemetrySettings, func(ctx context.Context, token emit.Token) error {
p, _ := profilesUnmarshaler.UnmarshalProfiles(token.Body)
// Appends token.Attributes
for i := 0; i < p.ResourceProfiles().Len(); i++ {
resourceProfile := p.ResourceProfiles().At(i)
for j := 0; j < resourceProfile.ScopeProfiles().Len(); j++ {
scopeProfile := resourceProfile.ScopeProfiles().At(j)
for k := 0; k < scopeProfile.Profiles().Len(); k++ {
profile := scopeProfile.Profiles().At(k)
appendToMap(token, profile.Attributes())
}
}
}
// TODO Append token.Attributes
if p.ResourceProfiles().Len() != 0 {
_ = profiles.ConsumeProfiles(ctx, p)
}
Expand Down
3 changes: 0 additions & 3 deletions receiver/otlpjsonfilereceiver/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ func TestFileProfilesReceiver(t *testing.T) {
assert.NoError(t, err)
time.Sleep(1 * time.Second)

// include_file_name is true by default
pd.ResourceProfiles().At(0).ScopeProfiles().At(0).Profiles().At(0).Attributes().PutStr("log.file.name", "profiles.json")

require.Len(t, sink.AllProfiles(), 1)
assert.EqualValues(t, pd, sink.AllProfiles()[0])
err = receiver.Shutdown(context.Background())
Expand Down

0 comments on commit eb36d63

Please sign in to comment.