From 94d097aa4aaf378ef912c6ad5a33368e51dbdaaf Mon Sep 17 00:00:00 2001 From: xu0o0 Date: Mon, 9 Dec 2024 19:28:37 +0800 Subject: [PATCH] [exporter/fileexporter] Add support for profiles signal (#36007) #### Description Add support for profiles signal to fileexporter #### Link to tracking issue Fixes #35978 --- .chloggen/f-profiles-fileexporter.yaml | 27 ++++ exporter/fileexporter/README.md | 4 +- exporter/fileexporter/encoding_test.go | 19 +++ exporter/fileexporter/factory.go | 30 +++- exporter/fileexporter/factory_test.go | 27 ++++ exporter/fileexporter/file_exporter.go | 9 ++ exporter/fileexporter/file_exporter_test.go | 152 +++++++++++++++++- exporter/fileexporter/go.mod | 7 +- exporter/fileexporter/go.sum | 6 + .../fileexporter/grouping_file_exporter.go | 39 +++++ .../grouping_file_exporter_test.go | 51 +++--- .../internal/metadata/generated_status.go | 7 +- exporter/fileexporter/marshaller.go | 52 ++++-- exporter/fileexporter/metadata.yaml | 3 +- internal/coreinternal/go.mod | 2 +- internal/coreinternal/testdata/profile.go | 71 ++++++++ internal/filter/go.mod | 1 + internal/filter/go.sum | 2 + pkg/resourcetotelemetry/go.mod | 1 + pkg/translator/jaeger/go.mod | 1 + pkg/translator/jaeger/go.sum | 2 + pkg/translator/opencensus/go.mod | 1 + pkg/translator/opencensus/go.sum | 2 + pkg/translator/prometheusremotewrite/go.mod | 1 + pkg/translator/prometheusremotewrite/go.sum | 2 + pkg/translator/zipkin/go.mod | 1 + pkg/translator/zipkin/go.sum | 2 + 27 files changed, 474 insertions(+), 48 deletions(-) create mode 100644 .chloggen/f-profiles-fileexporter.yaml create mode 100644 internal/coreinternal/testdata/profile.go diff --git a/.chloggen/f-profiles-fileexporter.yaml b/.chloggen/f-profiles-fileexporter.yaml new file mode 100644 index 000000000000..d6c9422fd1a9 --- /dev/null +++ b/.chloggen/f-profiles-fileexporter.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: fileexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add support for profiles signal. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [35978] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [] diff --git a/exporter/fileexporter/README.md b/exporter/fileexporter/README.md index 1c7ab992f1af..16a250af45ab 100644 --- a/exporter/fileexporter/README.md +++ b/exporter/fileexporter/README.md @@ -3,11 +3,13 @@ | Status | | | ------------- |-----------| -| Stability | [alpha]: traces, metrics, logs | +| Stability | [development]: profiles | +| | [alpha]: traces, metrics, logs | | Distributions | [core], [contrib], [k8s] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aexporter%2Ffile%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aexporter%2Ffile) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aexporter%2Ffile%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aexporter%2Ffile) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@atingchen](https://www.github.com/atingchen) | +[development]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md#development [alpha]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md#alpha [core]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib diff --git a/exporter/fileexporter/encoding_test.go b/exporter/fileexporter/encoding_test.go index e8729e0077fd..4d99e1205587 100644 --- a/exporter/fileexporter/encoding_test.go +++ b/exporter/fileexporter/encoding_test.go @@ -13,11 +13,13 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/exporter/exporterprofiles" "go.opentelemetry.io/collector/exporter/exportertest" "go.opentelemetry.io/collector/extension/extensiontest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/pprofile" "go.opentelemetry.io/collector/pdata/ptrace" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension" @@ -51,28 +53,34 @@ func TestEncoding(t *testing.T) { require.NoError(t, err) le, err := f.CreateLogs(context.Background(), exportertest.NewNopSettings(), cfg) require.NoError(t, err) + pe, err := f.(exporterprofiles.Factory).CreateProfiles(context.Background(), exportertest.NewNopSettings(), cfg) + require.NoError(t, err) host := hostWithEncoding{ map[component.ID]component.Component{id: ext}, } require.NoError(t, me.Start(context.Background(), host)) require.NoError(t, te.Start(context.Background(), host)) require.NoError(t, le.Start(context.Background(), host)) + require.NoError(t, pe.Start(context.Background(), host)) t.Cleanup(func() { }) require.NoError(t, me.ConsumeMetrics(context.Background(), generateMetrics())) require.NoError(t, te.ConsumeTraces(context.Background(), generateTraces())) require.NoError(t, le.ConsumeLogs(context.Background(), generateLogs())) + require.NoError(t, pe.ConsumeProfiles(context.Background(), generateProfiles())) require.NoError(t, me.Shutdown(context.Background())) require.NoError(t, te.Shutdown(context.Background())) require.NoError(t, le.Shutdown(context.Background())) + require.NoError(t, pe.Shutdown(context.Background())) b, err := os.ReadFile(cfg.Path) require.NoError(t, err) require.Contains(t, string(b), `{"resourceMetrics":`) require.Contains(t, string(b), `{"resourceSpans":`) require.Contains(t, string(b), `{"resourceLogs":`) + require.Contains(t, string(b), `{"resourceProfiles":`) } func generateLogs() plog.Logs { @@ -85,6 +93,17 @@ func generateLogs() plog.Logs { return logs } +func generateProfiles() pprofile.Profiles { + proflies := pprofile.NewProfiles() + rp := proflies.ResourceProfiles().AppendEmpty() + rp.Resource().Attributes().PutStr("resource", "R1") + p := rp.ScopeProfiles().AppendEmpty().Profiles().AppendEmpty() + p.SetProfileID(pprofile.NewProfileIDEmpty()) + p.SetStartTime(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + p.SetDuration(pcommon.Timestamp(1 * time.Second / time.Nanosecond)) + return proflies +} + func generateMetrics() pmetric.Metrics { metrics := pmetric.NewMetrics() rm := metrics.ResourceMetrics().AppendEmpty() diff --git a/exporter/fileexporter/factory.go b/exporter/fileexporter/factory.go index e59b54d7319f..d3ac5303452d 100644 --- a/exporter/fileexporter/factory.go +++ b/exporter/fileexporter/factory.go @@ -13,8 +13,11 @@ import ( "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exporterhelper" + "go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles" + "go.opentelemetry.io/collector/exporter/exporterprofiles" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/pprofile" "go.opentelemetry.io/collector/pdata/ptrace" "go.uber.org/zap" "gopkg.in/natefinch/lumberjack.v2" @@ -44,16 +47,18 @@ type FileExporter interface { consumeTraces(_ context.Context, td ptrace.Traces) error consumeMetrics(_ context.Context, md pmetric.Metrics) error consumeLogs(_ context.Context, ld plog.Logs) error + consumeProfiles(_ context.Context, pd pprofile.Profiles) error } // NewFactory creates a factory for OTLP exporter. func NewFactory() exporter.Factory { - return exporter.NewFactory( + return exporterprofiles.NewFactory( metadata.Type, createDefaultConfig, - exporter.WithTraces(createTracesExporter, metadata.TracesStability), - exporter.WithMetrics(createMetricsExporter, metadata.MetricsStability), - exporter.WithLogs(createLogsExporter, metadata.LogsStability)) + exporterprofiles.WithTraces(createTracesExporter, metadata.TracesStability), + exporterprofiles.WithMetrics(createMetricsExporter, metadata.MetricsStability), + exporterprofiles.WithLogs(createLogsExporter, metadata.LogsStability), + exporterprofiles.WithProfiles(createProfilesExporter, metadata.ProfilesStability)) } func createDefaultConfig() component.Config { @@ -118,6 +123,23 @@ func createLogsExporter( ) } +func createProfilesExporter( + ctx context.Context, + set exporter.Settings, + cfg component.Config, +) (exporterprofiles.Profiles, error) { + fe := getOrCreateFileExporter(cfg, set.Logger) + return exporterhelperprofiles.NewProfilesExporter( + ctx, + set, + cfg, + fe.consumeProfiles, + exporterhelper.WithStart(fe.Start), + exporterhelper.WithShutdown(fe.Shutdown), + exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), + ) +} + // getOrCreateFileExporter creates a FileExporter and caches it for a particular configuration, // or returns the already cached one. Caching is required because the factory is asked trace and // metric receivers separately when it gets CreateTraces() and CreateMetrics() diff --git a/exporter/fileexporter/factory_test.go b/exporter/fileexporter/factory_test.go index 254210bb345b..10af98194e93 100644 --- a/exporter/fileexporter/factory_test.go +++ b/exporter/fileexporter/factory_test.go @@ -103,6 +103,33 @@ func TestCreateLogsError(t *testing.T) { assert.Error(t, err) } +func TestCreateProfiles(t *testing.T) { + cfg := &Config{ + FormatType: formatTypeJSON, + Path: tempFileName(t), + } + exp, err := createProfilesExporter( + context.Background(), + exportertest.NewNopSettings(), + cfg) + assert.NoError(t, err) + require.NotNil(t, exp) + assert.NoError(t, exp.Shutdown(context.Background())) +} + +func TestCreateProfilesError(t *testing.T) { + cfg := &Config{ + FormatType: formatTypeJSON, + } + e, err := createProfilesExporter( + context.Background(), + exportertest.NewNopSettings(), + cfg) + require.NoError(t, err) + err = e.Start(context.Background(), componenttest.NewNopHost()) + assert.Error(t, err) +} + func TestNewFileWriter(t *testing.T) { type args struct { cfg *Config diff --git a/exporter/fileexporter/file_exporter.go b/exporter/fileexporter/file_exporter.go index c7a090f28c6c..8545773070f0 100644 --- a/exporter/fileexporter/file_exporter.go +++ b/exporter/fileexporter/file_exporter.go @@ -9,6 +9,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/pprofile" "go.opentelemetry.io/collector/pdata/ptrace" ) @@ -43,6 +44,14 @@ func (e *fileExporter) consumeLogs(_ context.Context, ld plog.Logs) error { return e.writer.export(buf) } +func (e *fileExporter) consumeProfiles(_ context.Context, pd pprofile.Profiles) error { + buf, err := e.marshaller.marshalProfiles(pd) + if err != nil { + return err + } + return e.writer.export(buf) +} + // Start starts the flush timer if set. func (e *fileExporter) Start(_ context.Context, host component.Host) error { var err error diff --git a/exporter/fileexporter/file_exporter_test.go b/exporter/fileexporter/file_exporter_test.go index 87cecf02ed94..9639eec9264c 100644 --- a/exporter/fileexporter/file_exporter_test.go +++ b/exporter/fileexporter/file_exporter_test.go @@ -22,6 +22,7 @@ import ( "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/pprofile" "go.opentelemetry.io/collector/pdata/ptrace" "go.uber.org/zap" "gopkg.in/natefinch/lumberjack.v2" @@ -452,6 +453,138 @@ func TestFileLogsExporterErrors(t *testing.T) { assert.NoError(t, fe.Shutdown(context.Background())) } +func TestFileProfilesExporter(t *testing.T) { + type args struct { + conf *Config + unmarshaler pprofile.Unmarshaler + } + tests := []struct { + name string + args args + }{ + { + name: "json: default configuration", + args: args{ + conf: &Config{ + Path: tempFileName(t), + FormatType: "json", + }, + unmarshaler: &pprofile.JSONUnmarshaler{}, + }, + }, + { + name: "json: compression configuration", + args: args{ + conf: &Config{ + Path: tempFileName(t), + FormatType: "json", + Compression: compressionZSTD, + }, + unmarshaler: &pprofile.JSONUnmarshaler{}, + }, + }, + { + name: "Proto: default configuration", + args: args{ + conf: &Config{ + Path: tempFileName(t), + FormatType: "proto", + }, + unmarshaler: &pprofile.ProtoUnmarshaler{}, + }, + }, + { + name: "Proto: compression configuration", + args: args{ + conf: &Config{ + Path: tempFileName(t), + FormatType: "proto", + Compression: compressionZSTD, + }, + unmarshaler: &pprofile.ProtoUnmarshaler{}, + }, + }, + { + name: "Proto: compression configuration--rotation", + args: args{ + conf: &Config{ + Path: tempFileName(t), + FormatType: "proto", + Compression: compressionZSTD, + Rotation: &Rotation{ + MaxMegabytes: 3, + MaxDays: 0, + MaxBackups: defaultMaxBackups, + LocalTime: false, + }, + }, + unmarshaler: &pprofile.ProtoUnmarshaler{}, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + conf := tt.args.conf + fe := &fileExporter{ + conf: conf, + } + require.NotNil(t, fe) + + pd := testdata.GenerateProfilesTwoProfilesSameResource() + assert.NoError(t, fe.Start(context.Background(), componenttest.NewNopHost())) + assert.NoError(t, fe.consumeProfiles(context.Background(), pd)) + assert.NoError(t, fe.consumeProfiles(context.Background(), pd)) + defer func() { + assert.NoError(t, fe.Shutdown(context.Background())) + }() + + fi, err := os.Open(fe.writer.path) + assert.NoError(t, err) + defer fi.Close() + br := bufio.NewReader(fi) + for { + buf, isEnd, err := func() ([]byte, bool, error) { + if fe.marshaller.formatType == formatTypeJSON && fe.marshaller.compression == "" { + return readJSONMessage(br) + } + return readMessageFromStream(br) + }() + assert.NoError(t, err) + if isEnd { + break + } + decoder := buildUnCompressor(fe.marshaller.compression) + buf, err = decoder(buf) + assert.NoError(t, err) + got, err := tt.args.unmarshaler.UnmarshalProfiles(buf) + assert.NoError(t, err) + assert.EqualValues(t, pd, got) + } + }) + } +} + +func TestFileProfilesExporterErrors(t *testing.T) { + pf := &errorWriter{} + fe := &fileExporter{ + marshaller: &marshaller{ + formatType: formatTypeJSON, + profilesMarshaler: profilesMarshalers[formatTypeJSON], + compressor: noneCompress, + }, + writer: &fileWriter{ + file: pf, + exporter: exportMessageAsLine, + }, + } + require.NotNil(t, fe) + + pd := testdata.GenerateProfilesTwoProfilesSameResource() + // Cannot call Start since we inject directly the WriterCloser. + assert.Error(t, fe.consumeProfiles(context.Background(), pd)) + assert.NoError(t, fe.Shutdown(context.Background())) +} + func TestExportMessageAsBuffer(t *testing.T) { path := tempFileName(t) fe := &fileExporter{ @@ -534,15 +667,17 @@ func decompress(src []byte) ([]byte, error) { func TestConcurrentlyCompress(t *testing.T) { wg := sync.WaitGroup{} - wg.Add(3) + wg.Add(4) var ( ctd []byte cmd []byte cld []byte + cpd []byte ) td := testdata.GenerateTracesTwoSpansSameResource() md := testdata.GenerateMetricsTwoMetrics() ld := testdata.GenerateLogsTwoLogRecordsSameResource() + pd := testdata.GenerateProfilesTwoProfilesSameResource() go func() { defer wg.Done() buf, err := tracesMarshalers[formatTypeJSON].MarshalTraces(td) @@ -567,6 +702,14 @@ func TestConcurrentlyCompress(t *testing.T) { } cld = zstdCompress(buf) }() + go func() { + defer wg.Done() + buf, err := profilesMarshalers[formatTypeJSON].MarshalProfiles(pd) + if err != nil { + return + } + cpd = zstdCompress(buf) + }() wg.Wait() buf, err := decompress(ctd) assert.NoError(t, err) @@ -588,6 +731,13 @@ func TestConcurrentlyCompress(t *testing.T) { gotLd, err := logsUnmarshaler.UnmarshalLogs(buf) assert.NoError(t, err) assert.EqualValues(t, ld, gotLd) + + buf, err = decompress(cpd) + assert.NoError(t, err) + profilesUnmarshaler := &pprofile.JSONUnmarshaler{} + gotPd, err := profilesUnmarshaler.UnmarshalProfiles(buf) + assert.NoError(t, err) + assert.EqualValues(t, pd, gotPd) } // tsBuffer is a thread safe buffer to prevent race conditions in the CI/CD. diff --git a/exporter/fileexporter/go.mod b/exporter/fileexporter/go.mod index f3622be43b00..de216ad1e5c4 100644 --- a/exporter/fileexporter/go.mod +++ b/exporter/fileexporter/go.mod @@ -15,9 +15,12 @@ require ( go.opentelemetry.io/collector/consumer v1.21.0 go.opentelemetry.io/collector/consumer/consumererror v0.115.0 go.opentelemetry.io/collector/exporter v0.115.0 + go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.115.0 + go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 go.opentelemetry.io/collector/exporter/exportertest v0.115.0 go.opentelemetry.io/collector/extension/extensiontest v0.115.0 go.opentelemetry.io/collector/pdata v1.21.0 + go.opentelemetry.io/collector/pdata/pprofile v0.115.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 @@ -45,14 +48,14 @@ require ( github.com/rogpeppe/go-internal v1.12.0 // indirect go.opentelemetry.io/collector/config/configretry v1.21.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.115.0 // indirect go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect go.opentelemetry.io/collector/consumer/consumertest v0.115.0 // indirect - go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 // indirect go.opentelemetry.io/collector/extension v0.115.0 // indirect go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 // indirect go.opentelemetry.io/collector/featuregate v1.21.0 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect go.opentelemetry.io/collector/pipeline v0.115.0 // indirect + go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.115.0 // indirect go.opentelemetry.io/collector/receiver v0.115.0 // indirect go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 // indirect go.opentelemetry.io/collector/receiver/receivertest v0.115.0 // indirect diff --git a/exporter/fileexporter/go.sum b/exporter/fileexporter/go.sum index f475bcef73ec..db860c7d84d8 100644 --- a/exporter/fileexporter/go.sum +++ b/exporter/fileexporter/go.sum @@ -72,12 +72,16 @@ go.opentelemetry.io/collector/consumer v1.21.0 h1:THKZ2Vbi6GkamjTBI2hFq5Dc4kINZT go.opentelemetry.io/collector/consumer v1.21.0/go.mod h1:FQcC4ThMtRYY41dv+IPNK8POLLhAFY3r1YR5fuP7iiY= go.opentelemetry.io/collector/consumer/consumererror v0.115.0 h1:yli//xBCQMPZKXNgNlXemo4dvqhnFrAmCZ11DvQgmcY= go.opentelemetry.io/collector/consumer/consumererror v0.115.0/go.mod h1:LwVzAvQ6ZVNG7mbOvurbAo+W/rKws0IcjOwriuZXqPE= +go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.115.0 h1:gaIhzpaGFWauiyznrQ3f++TbcdXxA5rpsX3L9uGjMM8= +go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.115.0/go.mod h1:7oXvuGBSawS5bc413lh1KEMcXkqBcrCqZQahOdnE24U= go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 h1:H3fDuyQW1t2HWHkz96WMBQJKUevypOCjBqnqtaAWyoA= go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0/go.mod h1:IzEmZ91Tp7TBxVDq8Cc9xvLsmO7H08njr6Pu9P5d9ns= go.opentelemetry.io/collector/consumer/consumertest v0.115.0 h1:hru0I2447y0TluCdwlKYFFtgcpyCnlM+LiOK1JZyA70= go.opentelemetry.io/collector/consumer/consumertest v0.115.0/go.mod h1:ybjALRJWR6aKNOzEMy1T1ruCULVDEjj4omtOJMrH/kU= go.opentelemetry.io/collector/exporter v0.115.0 h1:JnxfpOnsuqhTPKJXVKJLS1Cv3BiVrVLzpHOjJEQw+xw= go.opentelemetry.io/collector/exporter v0.115.0/go.mod h1:xof3fHQK8wADhaKLIJcQ7ChZaFLNC+haRdPN0wgl6kY= +go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.115.0 h1:fetbc740pODH6JW+H49SW0hiAJwQE+/B0SbuIlaY2rg= +go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.115.0/go.mod h1:oEKZ/d5BeaCK6Made9iwaeqmlT4lRbJSlW9nhIn/TwM= go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 h1:lSQEleCn/q9eFufcuK61NdFKU70ZlgI9dBjPCO/4CrE= go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0/go.mod h1:7l5K2AecimX2kx+nZC1gKG3QkP247CO1+SodmJ4fFkQ= go.opentelemetry.io/collector/exporter/exportertest v0.115.0 h1:P9SMTUXQOtcaq40bGtnnAe14zRmR4/yUgj/Tb2BEf/k= @@ -98,6 +102,8 @@ go.opentelemetry.io/collector/pdata/testdata v0.115.0 h1:Rblz+AKXdo3fG626jS+KSd0 go.opentelemetry.io/collector/pdata/testdata v0.115.0/go.mod h1:inNnRt6S2Nn260EfCBEcjesjlKOSsr0jPwkPqpBkt4s= go.opentelemetry.io/collector/pipeline v0.115.0 h1:bmACBqb0e8U9ag+vGGHUP7kCfAO7HHROdtzIEg8ulus= go.opentelemetry.io/collector/pipeline v0.115.0/go.mod h1:qE3DmoB05AW0C3lmPvdxZqd/H4po84NPzd5MrqgtL74= +go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.115.0 h1:3l9ruCAOrssTUDnyChKNzHWOdTtfThnYaoPZ1/+5sD0= +go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.115.0/go.mod h1:2Myg+law/5lcezo9PhhZ0wjCaLYdGK24s1jDWbSW9VY= go.opentelemetry.io/collector/receiver v0.115.0 h1:55Q3Jvj6zHCIA1psKqi/3kEMJO4OqUF5tNAEYNdB1U8= go.opentelemetry.io/collector/receiver v0.115.0/go.mod h1:nBSCh2O/WUcfgpJ+Jpz+B0z0Hn5jHeRvF2WmLij5EIY= go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 h1:R9JLaj2Al93smIPUkbJshAkb/cY0H5JBOxIx+Zu0NG4= diff --git a/exporter/fileexporter/grouping_file_exporter.go b/exporter/fileexporter/grouping_file_exporter.go index 322fef47e00b..3276f027c110 100644 --- a/exporter/fileexporter/grouping_file_exporter.go +++ b/exporter/fileexporter/grouping_file_exporter.go @@ -18,6 +18,7 @@ import ( "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/pprofile" "go.opentelemetry.io/collector/pdata/ptrace" "go.uber.org/zap" ) @@ -150,6 +151,44 @@ func (e *groupingFileExporter) consumeLogs(ctx context.Context, ld plog.Logs) er return nil } +func (e *groupingFileExporter) consumeProfiles(ctx context.Context, pd pprofile.Profiles) error { + if pd.ResourceProfiles().Len() == 0 { + return nil + } + + groups := make(map[string][]pprofile.ResourceProfiles) + + for i := 0; i < pd.ResourceProfiles().Len(); i++ { + rProfiles := pd.ResourceProfiles().At(i) + group(e, groups, rProfiles.Resource(), rProfiles) + } + + var errs error + for pathSegment, rProfilesSlice := range groups { + profiles := pprofile.NewProfiles() + for _, rProfiles := range rProfilesSlice { + rProfiles.CopyTo(profiles.ResourceProfiles().AppendEmpty()) + } + + buf, err := e.marshaller.marshalProfiles(profiles) + if err != nil { + errs = errors.Join(errs, err) + continue + } + + err = e.write(ctx, pathSegment, buf) + if err != nil { + errs = errors.Join(errs, err) + } + } + + if errs != nil { + return consumererror.NewPermanent(errs) + } + + return nil +} + func (e *groupingFileExporter) write(_ context.Context, pathSegment string, buf []byte) error { writer, err := e.getWriter(pathSegment) if err != nil { diff --git a/exporter/fileexporter/grouping_file_exporter_test.go b/exporter/fileexporter/grouping_file_exporter_test.go index 53f1b06a7382..a5b479303af5 100644 --- a/exporter/fileexporter/grouping_file_exporter_test.go +++ b/exporter/fileexporter/grouping_file_exporter_test.go @@ -15,6 +15,7 @@ import ( "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/pprofile" "go.opentelemetry.io/collector/pdata/ptrace" "go.uber.org/zap" "go.uber.org/zap/zaptest/observer" @@ -38,12 +39,17 @@ func (m *testMarshaller) MarshalMetrics(pmetric.Metrics) ([]byte, error) { return m.content, nil } +func (m *testMarshaller) MarshalProfiles(pprofile.Profiles) ([]byte, error) { + return m.content, nil +} + type groupingExporterTestCase struct { - name string - conf *Config - traceUnmarshaler ptrace.Unmarshaler - logUnmarshaler plog.Unmarshaler - metricUnmarshaler pmetric.Unmarshaler + name string + conf *Config + traceUnmarshaler ptrace.Unmarshaler + logUnmarshaler plog.Unmarshaler + metricUnmarshaler pmetric.Unmarshaler + profileUnmarshaler pprofile.Unmarshaler } func groupingExporterTestCases() []groupingExporterTestCase { @@ -60,9 +66,10 @@ func groupingExporterTestCases() []groupingExporterTestCase { MaxOpenFiles: defaultMaxOpenFiles, }, }, - traceUnmarshaler: &ptrace.JSONUnmarshaler{}, - logUnmarshaler: &plog.JSONUnmarshaler{}, - metricUnmarshaler: &pmetric.JSONUnmarshaler{}, + traceUnmarshaler: &ptrace.JSONUnmarshaler{}, + logUnmarshaler: &plog.JSONUnmarshaler{}, + metricUnmarshaler: &pmetric.JSONUnmarshaler{}, + profileUnmarshaler: &pprofile.JSONUnmarshaler{}, }, { name: "json: compression configuration", @@ -77,9 +84,10 @@ func groupingExporterTestCases() []groupingExporterTestCase { MaxOpenFiles: defaultMaxOpenFiles, }, }, - traceUnmarshaler: &ptrace.JSONUnmarshaler{}, - logUnmarshaler: &plog.JSONUnmarshaler{}, - metricUnmarshaler: &pmetric.JSONUnmarshaler{}, + traceUnmarshaler: &ptrace.JSONUnmarshaler{}, + logUnmarshaler: &plog.JSONUnmarshaler{}, + metricUnmarshaler: &pmetric.JSONUnmarshaler{}, + profileUnmarshaler: &pprofile.JSONUnmarshaler{}, }, { name: "Proto: default configuration", @@ -92,9 +100,10 @@ func groupingExporterTestCases() []groupingExporterTestCase { MaxOpenFiles: defaultMaxOpenFiles, }, }, - traceUnmarshaler: &ptrace.ProtoUnmarshaler{}, - logUnmarshaler: &plog.ProtoUnmarshaler{}, - metricUnmarshaler: &pmetric.ProtoUnmarshaler{}, + traceUnmarshaler: &ptrace.ProtoUnmarshaler{}, + logUnmarshaler: &plog.ProtoUnmarshaler{}, + metricUnmarshaler: &pmetric.ProtoUnmarshaler{}, + profileUnmarshaler: &pprofile.JSONUnmarshaler{}, }, { name: "Proto: compression configuration", @@ -109,9 +118,10 @@ func groupingExporterTestCases() []groupingExporterTestCase { MaxOpenFiles: defaultMaxOpenFiles, }, }, - traceUnmarshaler: &ptrace.ProtoUnmarshaler{}, - logUnmarshaler: &plog.ProtoUnmarshaler{}, - metricUnmarshaler: &pmetric.ProtoUnmarshaler{}, + traceUnmarshaler: &ptrace.ProtoUnmarshaler{}, + logUnmarshaler: &plog.ProtoUnmarshaler{}, + metricUnmarshaler: &pmetric.ProtoUnmarshaler{}, + profileUnmarshaler: &pprofile.JSONUnmarshaler{}, }, { name: "json: max_open_files=1", @@ -125,9 +135,10 @@ func groupingExporterTestCases() []groupingExporterTestCase { ResourceAttribute: defaultResourceAttribute, }, }, - traceUnmarshaler: &ptrace.JSONUnmarshaler{}, - logUnmarshaler: &plog.JSONUnmarshaler{}, - metricUnmarshaler: &pmetric.JSONUnmarshaler{}, + traceUnmarshaler: &ptrace.JSONUnmarshaler{}, + logUnmarshaler: &plog.JSONUnmarshaler{}, + metricUnmarshaler: &pmetric.JSONUnmarshaler{}, + profileUnmarshaler: &pprofile.JSONUnmarshaler{}, }, } } diff --git a/exporter/fileexporter/internal/metadata/generated_status.go b/exporter/fileexporter/internal/metadata/generated_status.go index bc731cac3d23..688175e24706 100644 --- a/exporter/fileexporter/internal/metadata/generated_status.go +++ b/exporter/fileexporter/internal/metadata/generated_status.go @@ -12,7 +12,8 @@ var ( ) const ( - TracesStability = component.StabilityLevelAlpha - MetricsStability = component.StabilityLevelAlpha - LogsStability = component.StabilityLevelAlpha + ProfilesStability = component.StabilityLevelDevelopment + TracesStability = component.StabilityLevelAlpha + MetricsStability = component.StabilityLevelAlpha + LogsStability = component.StabilityLevelAlpha ) diff --git a/exporter/fileexporter/marshaller.go b/exporter/fileexporter/marshaller.go index d80325d735a0..166d42c4ce0d 100644 --- a/exporter/fileexporter/marshaller.go +++ b/exporter/fileexporter/marshaller.go @@ -10,6 +10,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/pprofile" "go.opentelemetry.io/collector/pdata/ptrace" ) @@ -29,10 +30,16 @@ var logsMarshalers = map[string]plog.Marshaler{ formatTypeProto: &plog.ProtoMarshaler{}, } +var profilesMarshalers = map[string]pprofile.Marshaler{ + formatTypeJSON: &pprofile.JSONMarshaler{}, + formatTypeProto: &pprofile.ProtoMarshaler{}, +} + type marshaller struct { - tracesMarshaler ptrace.Marshaler - metricsMarshaler pmetric.Marshaler - logsMarshaler plog.Marshaler + tracesMarshaler ptrace.Marshaler + metricsMarshaler pmetric.Marshaler + logsMarshaler plog.Marshaler + profilesMarshaler pprofile.Marshaler compression string compressor compressFunc @@ -48,23 +55,26 @@ func newMarshaller(conf *Config, host component.Host) (*marshaller, error) { } // cast with ok to avoid panics. tm, _ := encoding.(ptrace.Marshaler) - pm, _ := encoding.(pmetric.Marshaler) + mm, _ := encoding.(pmetric.Marshaler) lm, _ := encoding.(plog.Marshaler) + pm, _ := encoding.(pprofile.Marshaler) return &marshaller{ - tracesMarshaler: tm, - metricsMarshaler: pm, - logsMarshaler: lm, - compression: conf.Compression, - compressor: buildCompressor(conf.Compression), + tracesMarshaler: tm, + metricsMarshaler: mm, + logsMarshaler: lm, + profilesMarshaler: pm, + compression: conf.Compression, + compressor: buildCompressor(conf.Compression), }, nil } return &marshaller{ - formatType: conf.FormatType, - tracesMarshaler: tracesMarshalers[conf.FormatType], - metricsMarshaler: metricsMarshalers[conf.FormatType], - logsMarshaler: logsMarshalers[conf.FormatType], - compression: conf.Compression, - compressor: buildCompressor(conf.Compression), + formatType: conf.FormatType, + tracesMarshaler: tracesMarshalers[conf.FormatType], + metricsMarshaler: metricsMarshalers[conf.FormatType], + logsMarshaler: logsMarshalers[conf.FormatType], + profilesMarshaler: profilesMarshalers[conf.FormatType], + compression: conf.Compression, + compressor: buildCompressor(conf.Compression), }, nil } @@ -103,3 +113,15 @@ func (m *marshaller) marshalLogs(ld plog.Logs) ([]byte, error) { buf = m.compressor(buf) return buf, nil } + +func (m *marshaller) marshalProfiles(pd pprofile.Profiles) ([]byte, error) { + if m.profilesMarshaler == nil { + return nil, errors.New("profiles are not supported by encoding") + } + buf, err := m.profilesMarshaler.MarshalProfiles(pd) + if err != nil { + return nil, err + } + buf = m.compressor(buf) + return buf, nil +} diff --git a/exporter/fileexporter/metadata.yaml b/exporter/fileexporter/metadata.yaml index 8a8b86f9a266..75c12d292001 100644 --- a/exporter/fileexporter/metadata.yaml +++ b/exporter/fileexporter/metadata.yaml @@ -4,6 +4,7 @@ status: class: exporter stability: alpha: [traces, metrics, logs] + development: [profiles] distributions: [core, contrib, k8s] codeowners: active: [atingchen] @@ -16,4 +17,4 @@ tests: ignore: top: # Existing issue for leak: https://github.com/natefinch/lumberjack/issues/56 - - "gopkg.in/natefinch/lumberjack%2ev2.(*Logger).millRun" \ No newline at end of file + - "gopkg.in/natefinch/lumberjack%2ev2.(*Logger).millRun" diff --git a/internal/coreinternal/go.mod b/internal/coreinternal/go.mod index 078b2abca52c..7639c6440aa7 100644 --- a/internal/coreinternal/go.mod +++ b/internal/coreinternal/go.mod @@ -17,6 +17,7 @@ require ( go.opentelemetry.io/collector/consumer/consumererror v0.115.0 go.opentelemetry.io/collector/consumer/consumertest v0.115.0 go.opentelemetry.io/collector/pdata v1.21.0 + go.opentelemetry.io/collector/pdata/pprofile v0.115.0 go.opentelemetry.io/collector/receiver v0.115.0 go.opentelemetry.io/collector/receiver/receivertest v0.115.0 go.opentelemetry.io/collector/semconv v0.115.0 @@ -76,7 +77,6 @@ require ( github.com/yusufpapurcu/wmi v1.2.4 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect go.opentelemetry.io/collector/pipeline v0.115.0 // indirect go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect diff --git a/internal/coreinternal/testdata/profile.go b/internal/coreinternal/testdata/profile.go new file mode 100644 index 000000000000..3816fdd581f6 --- /dev/null +++ b/internal/coreinternal/testdata/profile.go @@ -0,0 +1,71 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package testdata + +import ( + "time" + + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/pprofile" +) + +var ( + TestProfileStartTime = time.Date(2020, 2, 11, 20, 26, 13, 789, time.UTC) + TestProfileEndTime = time.Date(2020, 2, 11, 20, 28, 13, 789, time.UTC) + TestProfileStartTimestamp = pcommon.NewTimestampFromTime(TestProfileStartTime) + TestProfileEndTimestamp = pcommon.NewTimestampFromTime(TestProfileEndTime) +) + +func GenerateProfilesOneEmptyResourceProfiles() pprofile.Profiles { + pd := pprofile.NewProfiles() + pd.ResourceProfiles().AppendEmpty() + return pd +} + +func GenerateProfilesNoProfiles() pprofile.Profiles { + pd := GenerateProfilesOneEmptyResourceProfiles() + initResource1(pd.ResourceProfiles().At(0).Resource()) + return pd +} + +func GenerateProfilesOneEmptyProfile() pprofile.Profiles { + pd := GenerateProfilesNoProfiles() + rs0 := pd.ResourceProfiles().At(0) + rs0.ScopeProfiles().AppendEmpty().Profiles().AppendEmpty() + return pd +} + +func GenerateProfilesOneProfile() pprofile.Profiles { + pd := GenerateProfilesOneEmptyProfile() + fillProfileOne(pd.ResourceProfiles().At(0).ScopeProfiles().At(0).Profiles().At(0)) + return pd +} + +func GenerateProfilesTwoProfilesSameResource() pprofile.Profiles { + pd := GenerateProfilesOneEmptyProfile() + profiles := pd.ResourceProfiles().At(0).ScopeProfiles().At(0).Profiles() + fillProfileOne(profiles.At(0)) + fillProfileTwo(profiles.AppendEmpty()) + return pd +} + +func fillProfileOne(profile pprofile.Profile) { + profile.SetStartTime(TestProfileStartTimestamp) + profile.SetEndTime(TestProfileEndTimestamp) + profile.SetProfileID([16]byte{0x01, 0x02, 0x03, 0x04}) + + attrs := profile.Attributes() + attrs.PutStr("app", "server") + attrs.PutInt("instance_num", 1) +} + +func fillProfileTwo(profile pprofile.Profile) { + profile.SetStartTime(TestProfileStartTimestamp) + profile.SetEndTime(TestProfileEndTimestamp) + profile.SetProfileID([16]byte{0x05, 0x06, 0x07, 0x08}) + + attrs := profile.Attributes() + attrs.PutStr("customer", "acme") + attrs.PutStr("env", "dev") +} diff --git a/internal/filter/go.mod b/internal/filter/go.mod index 123d671c16cb..d4e1880e75ff 100644 --- a/internal/filter/go.mod +++ b/internal/filter/go.mod @@ -50,6 +50,7 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/ua-parser/uap-go v0.0.0-20240611065828-3a4781585db6 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect go.opentelemetry.io/otel v1.32.0 // indirect go.opentelemetry.io/otel/metric v1.32.0 // indirect go.opentelemetry.io/otel/sdk v1.32.0 // indirect diff --git a/internal/filter/go.sum b/internal/filter/go.sum index 67bfd0ba3bce..95841ce7d89d 100644 --- a/internal/filter/go.sum +++ b/internal/filter/go.sum @@ -99,6 +99,8 @@ go.opentelemetry.io/collector/featuregate v1.21.0 h1:+EULHPJDLMipcwAGZVp9Nm8NriR go.opentelemetry.io/collector/featuregate v1.21.0/go.mod h1:3GaXqflNDVwWndNGBJ1+XJFy3Fv/XrFgjMN60N3z7yg= go.opentelemetry.io/collector/pdata v1.21.0 h1:PG+UbiFMJ35X/WcAR7Rf/PWmWtRdW0aHlOidsR6c5MA= go.opentelemetry.io/collector/pdata v1.21.0/go.mod h1:GKb1/zocKJMvxKbS+sl0W85lxhYBTFJ6h6I1tphVyDU= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0 h1:NI89hy13vNDw7EOnQf7Jtitks4HJFO0SUWznTssmP94= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0/go.mod h1:jGzdNfO0XTtfLjXCL/uCC1livg1LlfR+ix2WE/z3RpQ= go.opentelemetry.io/collector/semconv v0.115.0 h1:SoqMvg4ZEB3mz2EdAb6XYa+TuMo5Mir5FRBr3nVFUDY= go.opentelemetry.io/collector/semconv v0.115.0/go.mod h1:N6XE8Q0JKgBN2fAhkUQtqK9LT7rEGR6+Wu/Rtbal1iI= go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= diff --git a/pkg/resourcetotelemetry/go.mod b/pkg/resourcetotelemetry/go.mod index 53e13dca3efe..a5c484969f43 100644 --- a/pkg/resourcetotelemetry/go.mod +++ b/pkg/resourcetotelemetry/go.mod @@ -20,6 +20,7 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect go.opentelemetry.io/collector/component v0.115.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect go.opentelemetry.io/collector/pipeline v0.115.0 // indirect go.opentelemetry.io/otel v1.32.0 // indirect go.opentelemetry.io/otel/metric v1.32.0 // indirect diff --git a/pkg/translator/jaeger/go.mod b/pkg/translator/jaeger/go.mod index c1a0156d3b83..15e9fb4f2b45 100644 --- a/pkg/translator/jaeger/go.mod +++ b/pkg/translator/jaeger/go.mod @@ -19,6 +19,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect go.opentelemetry.io/otel v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect diff --git a/pkg/translator/jaeger/go.sum b/pkg/translator/jaeger/go.sum index 33f90c2f1626..e9bab3b08469 100644 --- a/pkg/translator/jaeger/go.sum +++ b/pkg/translator/jaeger/go.sum @@ -37,6 +37,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/collector/pdata v1.21.0 h1:PG+UbiFMJ35X/WcAR7Rf/PWmWtRdW0aHlOidsR6c5MA= go.opentelemetry.io/collector/pdata v1.21.0/go.mod h1:GKb1/zocKJMvxKbS+sl0W85lxhYBTFJ6h6I1tphVyDU= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0 h1:NI89hy13vNDw7EOnQf7Jtitks4HJFO0SUWznTssmP94= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0/go.mod h1:jGzdNfO0XTtfLjXCL/uCC1livg1LlfR+ix2WE/z3RpQ= go.opentelemetry.io/collector/semconv v0.115.0 h1:SoqMvg4ZEB3mz2EdAb6XYa+TuMo5Mir5FRBr3nVFUDY= go.opentelemetry.io/collector/semconv v0.115.0/go.mod h1:N6XE8Q0JKgBN2fAhkUQtqK9LT7rEGR6+Wu/Rtbal1iI= go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= diff --git a/pkg/translator/opencensus/go.mod b/pkg/translator/opencensus/go.mod index efe0a8b125c6..6e1ec73f636f 100644 --- a/pkg/translator/opencensus/go.mod +++ b/pkg/translator/opencensus/go.mod @@ -27,6 +27,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.115.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.28.0 // indirect golang.org/x/sys v0.27.0 // indirect diff --git a/pkg/translator/opencensus/go.sum b/pkg/translator/opencensus/go.sum index 667c6e0db9f4..69ae6db89265 100644 --- a/pkg/translator/opencensus/go.sum +++ b/pkg/translator/opencensus/go.sum @@ -77,6 +77,8 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/collector/pdata v1.21.0 h1:PG+UbiFMJ35X/WcAR7Rf/PWmWtRdW0aHlOidsR6c5MA= go.opentelemetry.io/collector/pdata v1.21.0/go.mod h1:GKb1/zocKJMvxKbS+sl0W85lxhYBTFJ6h6I1tphVyDU= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0 h1:NI89hy13vNDw7EOnQf7Jtitks4HJFO0SUWznTssmP94= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0/go.mod h1:jGzdNfO0XTtfLjXCL/uCC1livg1LlfR+ix2WE/z3RpQ= go.opentelemetry.io/collector/semconv v0.115.0 h1:SoqMvg4ZEB3mz2EdAb6XYa+TuMo5Mir5FRBr3nVFUDY= go.opentelemetry.io/collector/semconv v0.115.0/go.mod h1:N6XE8Q0JKgBN2fAhkUQtqK9LT7rEGR6+Wu/Rtbal1iI= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= diff --git a/pkg/translator/prometheusremotewrite/go.mod b/pkg/translator/prometheusremotewrite/go.mod index c974a5e1ca64..79c823940bc3 100644 --- a/pkg/translator/prometheusremotewrite/go.mod +++ b/pkg/translator/prometheusremotewrite/go.mod @@ -28,6 +28,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_model v0.6.1 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect golang.org/x/net v0.29.0 // indirect golang.org/x/sys v0.27.0 // indirect golang.org/x/text v0.20.0 // indirect diff --git a/pkg/translator/prometheusremotewrite/go.sum b/pkg/translator/prometheusremotewrite/go.sum index 81a078d3506a..62542770eb11 100644 --- a/pkg/translator/prometheusremotewrite/go.sum +++ b/pkg/translator/prometheusremotewrite/go.sum @@ -47,6 +47,8 @@ go.opentelemetry.io/collector/featuregate v1.21.0 h1:+EULHPJDLMipcwAGZVp9Nm8NriR go.opentelemetry.io/collector/featuregate v1.21.0/go.mod h1:3GaXqflNDVwWndNGBJ1+XJFy3Fv/XrFgjMN60N3z7yg= go.opentelemetry.io/collector/pdata v1.21.0 h1:PG+UbiFMJ35X/WcAR7Rf/PWmWtRdW0aHlOidsR6c5MA= go.opentelemetry.io/collector/pdata v1.21.0/go.mod h1:GKb1/zocKJMvxKbS+sl0W85lxhYBTFJ6h6I1tphVyDU= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0 h1:NI89hy13vNDw7EOnQf7Jtitks4HJFO0SUWznTssmP94= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0/go.mod h1:jGzdNfO0XTtfLjXCL/uCC1livg1LlfR+ix2WE/z3RpQ= go.opentelemetry.io/collector/semconv v0.115.0 h1:SoqMvg4ZEB3mz2EdAb6XYa+TuMo5Mir5FRBr3nVFUDY= go.opentelemetry.io/collector/semconv v0.115.0/go.mod h1:N6XE8Q0JKgBN2fAhkUQtqK9LT7rEGR6+Wu/Rtbal1iI= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= diff --git a/pkg/translator/zipkin/go.mod b/pkg/translator/zipkin/go.mod index 5cde104365a6..8b853b0fee5a 100644 --- a/pkg/translator/zipkin/go.mod +++ b/pkg/translator/zipkin/go.mod @@ -20,6 +20,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect go.opentelemetry.io/otel v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect diff --git a/pkg/translator/zipkin/go.sum b/pkg/translator/zipkin/go.sum index 540cfb7d7c7e..073cdb4ea39f 100644 --- a/pkg/translator/zipkin/go.sum +++ b/pkg/translator/zipkin/go.sum @@ -39,6 +39,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/collector/pdata v1.21.0 h1:PG+UbiFMJ35X/WcAR7Rf/PWmWtRdW0aHlOidsR6c5MA= go.opentelemetry.io/collector/pdata v1.21.0/go.mod h1:GKb1/zocKJMvxKbS+sl0W85lxhYBTFJ6h6I1tphVyDU= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0 h1:NI89hy13vNDw7EOnQf7Jtitks4HJFO0SUWznTssmP94= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0/go.mod h1:jGzdNfO0XTtfLjXCL/uCC1livg1LlfR+ix2WE/z3RpQ= go.opentelemetry.io/collector/semconv v0.115.0 h1:SoqMvg4ZEB3mz2EdAb6XYa+TuMo5Mir5FRBr3nVFUDY= go.opentelemetry.io/collector/semconv v0.115.0/go.mod h1:N6XE8Q0JKgBN2fAhkUQtqK9LT7rEGR6+Wu/Rtbal1iI= go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U=