diff --git a/consumer/pdata/common.go b/consumer/pdata/common.go index 953eeceac9d..4bbaaac1a68 100644 --- a/consumer/pdata/common.go +++ b/consumer/pdata/common.go @@ -24,7 +24,7 @@ import ( ) // AttributeValueType specifies the type of AttributeValue. -type AttributeValueType int +type AttributeValueType int32 const ( AttributeValueNULL AttributeValueType = iota diff --git a/consumer/pdata/log.go b/consumer/pdata/log.go index d97f612d127..613da4b3dd8 100644 --- a/consumer/pdata/log.go +++ b/consumer/pdata/log.go @@ -104,7 +104,7 @@ func (ld Logs) ResourceLogs() ResourceLogsSlice { } // SeverityNumber is the public alias of otlplogs.SeverityNumber from internal package. -type SeverityNumber otlplogs.SeverityNumber +type SeverityNumber int32 const ( SeverityNumberUNDEFINED = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_UNSPECIFIED) @@ -133,3 +133,5 @@ const ( SeverityNumberFATAL3 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_FATAL3) SeverityNumberFATAL4 = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_FATAL4) ) + +func (sn SeverityNumber) String() string { return otlplogs.SeverityNumber(sn).String() } diff --git a/consumer/pdata/metric.go b/consumer/pdata/metric.go index 1bcdb7e3181..8775e321707 100644 --- a/consumer/pdata/metric.go +++ b/consumer/pdata/metric.go @@ -20,7 +20,7 @@ import ( otlpmetrics "go.opentelemetry.io/collector/internal/data/protogen/metrics/v1" ) -type AggregationTemporality otlpmetrics.AggregationTemporality +type AggregationTemporality int32 const ( AggregationTemporalityUnspecified = AggregationTemporality(otlpmetrics.AggregationTemporality_AGGREGATION_TEMPORALITY_UNSPECIFIED) @@ -146,7 +146,7 @@ func (md Metrics) MetricAndDataPointCount() (metricCount int, dataPointCount int } // MetricDataType specifies the type of data in a Metric. -type MetricDataType int +type MetricDataType int32 const ( MetricDataTypeNone MetricDataType = iota diff --git a/consumer/pdata/trace.go b/consumer/pdata/trace.go index 0d66ea32d84..d2be1c0b1c7 100644 --- a/consumer/pdata/trace.go +++ b/consumer/pdata/trace.go @@ -98,14 +98,14 @@ func (td Traces) ResourceSpans() ResourceSpansSlice { // TraceState in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header type TraceState string -type SpanKind otlptrace.Span_SpanKind - -func (sk SpanKind) String() string { return otlptrace.Span_SpanKind(sk).String() } - const ( TraceStateEmpty TraceState = "" ) +type SpanKind int32 + +func (sk SpanKind) String() string { return otlptrace.Span_SpanKind(sk).String() } + const ( SpanKindUNSPECIFIED = SpanKind(0) SpanKindINTERNAL = SpanKind(otlptrace.Span_SPAN_KIND_INTERNAL) @@ -117,7 +117,7 @@ const ( // StatusCode mirrors the codes defined at // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#set-status -type StatusCode otlptrace.Status_StatusCode +type StatusCode int32 const ( StatusCodeUnset = StatusCode(otlptrace.Status_STATUS_CODE_UNSET)