From eb36d6387998da92d235db675e5fcf4239a4bc42 Mon Sep 17 00:00:00 2001 From: khushijain21 Date: Tue, 31 Dec 2024 14:53:15 +0530 Subject: [PATCH] file --- receiver/otlpjsonfilereceiver/file.go | 12 +----------- receiver/otlpjsonfilereceiver/file_test.go | 3 --- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/receiver/otlpjsonfilereceiver/file.go b/receiver/otlpjsonfilereceiver/file.go index b443a1b44f16..ed4c8d3bc4fd 100644 --- a/receiver/otlpjsonfilereceiver/file.go +++ b/receiver/otlpjsonfilereceiver/file.go @@ -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) } diff --git a/receiver/otlpjsonfilereceiver/file_test.go b/receiver/otlpjsonfilereceiver/file_test.go index bd624d2ee1aa..dbb04dfdcc0c 100644 --- a/receiver/otlpjsonfilereceiver/file_test.go +++ b/receiver/otlpjsonfilereceiver/file_test.go @@ -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())