@@ -19,6 +19,9 @@ import (
19
19
)
20
20
21
21
// ObsReport is a helper to add observability to an exporter.
22
+ //
23
+ // Deprecated: [v0.105.0] Not expected to be used directly.
24
+ // If needed, report your use case in https://github.com/open-telemetry/opentelemetry-collector/issues/10592.
22
25
type ObsReport struct {
23
26
level configtelemetry.Level
24
27
spanNamePrefix string
@@ -29,12 +32,18 @@ type ObsReport struct {
29
32
}
30
33
31
34
// ObsReportSettings are settings for creating an ObsReport.
35
+ //
36
+ // Deprecated: [v0.105.0] Not expected to be used directly.
37
+ // If needed, report your use case in https://github.com/open-telemetry/opentelemetry-collector/issues/10592.
32
38
type ObsReportSettings struct {
33
39
ExporterID component.ID
34
40
ExporterCreateSettings exporter.Settings
35
41
}
36
42
37
43
// NewObsReport creates a new Exporter.
44
+ //
45
+ // Deprecated: [v0.105.0] Not expected to be used directly.
46
+ // If needed, report your use case in https://github.com/open-telemetry/opentelemetry-collector/issues/10592.
38
47
func NewObsReport (cfg ObsReportSettings ) (* ObsReport , error ) {
39
48
return newExporter (cfg )
40
49
}
@@ -62,11 +71,17 @@ func newExporter(cfg ObsReportSettings) (*ObsReport, error) {
62
71
// StartTracesOp is called at the start of an Export operation.
63
72
// The returned context should be used in other calls to the Exporter functions
64
73
// dealing with the same export operation.
74
+ //
75
+ // Deprecated: [v0.105.0] Not expected to be used directly.
76
+ // If needed, report your use case in https://github.com/open-telemetry/opentelemetry-collector/issues/10592.
65
77
func (or * ObsReport ) StartTracesOp (ctx context.Context ) context.Context {
66
78
return or .startOp (ctx , obsmetrics .ExportTraceDataOperationSuffix )
67
79
}
68
80
69
81
// EndTracesOp completes the export operation that was started with StartTracesOp.
82
+ //
83
+ // Deprecated: [v0.105.0] Not expected to be used directly.
84
+ // If needed, report your use case in https://github.com/open-telemetry/opentelemetry-collector/issues/10592.
70
85
func (or * ObsReport ) EndTracesOp (ctx context.Context , numSpans int , err error ) {
71
86
numSent , numFailedToSend := toNumItems (numSpans , err )
72
87
or .recordMetrics (context .WithoutCancel (ctx ), component .DataTypeTraces , numSent , numFailedToSend )
@@ -76,12 +91,18 @@ func (or *ObsReport) EndTracesOp(ctx context.Context, numSpans int, err error) {
76
91
// StartMetricsOp is called at the start of an Export operation.
77
92
// The returned context should be used in other calls to the Exporter functions
78
93
// dealing with the same export operation.
94
+ //
95
+ // Deprecated: [v0.105.0] Not expected to be used directly.
96
+ // If needed, report your use case in https://github.com/open-telemetry/opentelemetry-collector/issues/10592.
79
97
func (or * ObsReport ) StartMetricsOp (ctx context.Context ) context.Context {
80
98
return or .startOp (ctx , obsmetrics .ExportMetricsOperationSuffix )
81
99
}
82
100
83
101
// EndMetricsOp completes the export operation that was started with
84
102
// StartMetricsOp.
103
+ //
104
+ // Deprecated: [v0.105.0] Not expected to be used directly.
105
+ // If needed, report your use case in https://github.com/open-telemetry/opentelemetry-collector/issues/10592.
85
106
func (or * ObsReport ) EndMetricsOp (ctx context.Context , numMetricPoints int , err error ) {
86
107
numSent , numFailedToSend := toNumItems (numMetricPoints , err )
87
108
or .recordMetrics (context .WithoutCancel (ctx ), component .DataTypeMetrics , numSent , numFailedToSend )
@@ -91,11 +112,17 @@ func (or *ObsReport) EndMetricsOp(ctx context.Context, numMetricPoints int, err
91
112
// StartLogsOp is called at the start of an Export operation.
92
113
// The returned context should be used in other calls to the Exporter functions
93
114
// dealing with the same export operation.
115
+ //
116
+ // Deprecated: [v0.105.0] Not expected to be used directly.
117
+ // If needed, report your use case in https://github.com/open-telemetry/opentelemetry-collector/issues/10592.
94
118
func (or * ObsReport ) StartLogsOp (ctx context.Context ) context.Context {
95
119
return or .startOp (ctx , obsmetrics .ExportLogsOperationSuffix )
96
120
}
97
121
98
122
// EndLogsOp completes the export operation that was started with StartLogsOp.
123
+ //
124
+ // Deprecated: [v0.105.0] Not expected to be used directly.
125
+ // If needed, report your use case in https://github.com/open-telemetry/opentelemetry-collector/issues/10592.
99
126
func (or * ObsReport ) EndLogsOp (ctx context.Context , numLogRecords int , err error ) {
100
127
numSent , numFailedToSend := toNumItems (numLogRecords , err )
101
128
or .recordMetrics (context .WithoutCancel (ctx ), component .DataTypeLogs , numSent , numFailedToSend )
0 commit comments