mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 04:04:00 -06:00
52121b7165
* add grafana-apiserver * remove watchset & move provisioning and http server to background services * remove scheme * otel fixes (#70874) * remove module ProvideRegistry test * use certgenerator from apiserver package * Control collector/pdata from going to v1.0.0-rc8 (as Tempo 1.5.1 would have it)
64 lines
2.3 KiB
Go
64 lines
2.3 KiB
Go
// Copyright The OpenTelemetry Authors
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
package tempo
|
|
|
|
import (
|
|
"go.opentelemetry.io/collector/pdata/ptrace"
|
|
)
|
|
|
|
// Some of the keys used to represent OTLP constructs as tags or annotations in other formats.
|
|
const (
|
|
TagMessage = "message"
|
|
|
|
TagSpanKind = "span.kind"
|
|
|
|
TagStatusCode = "status.code"
|
|
TagStatusMsg = "status.message"
|
|
TagError = "error"
|
|
TagHTTPStatusMsg = "http.status_message"
|
|
|
|
TagW3CTraceState = "w3c.tracestate"
|
|
)
|
|
|
|
// Constants used for signifying batch-level attribute values where not supplied by OTLP data but required
|
|
// by other protocols.
|
|
const (
|
|
ResourceNoServiceName = "OTLPResourceNoServiceName"
|
|
)
|
|
|
|
// OpenTracingSpanKind are possible values for TagSpanKind and match the OpenTracing
|
|
// conventions: https://github.com/opentracing/specification/blob/main/semantic_conventions.md
|
|
// These values are used for representing span kinds that have no
|
|
// equivalents in OpenCensus format. They are stored as values of TagSpanKind
|
|
type OpenTracingSpanKind string
|
|
|
|
const (
|
|
OpenTracingSpanKindUnspecified OpenTracingSpanKind = ""
|
|
OpenTracingSpanKindClient OpenTracingSpanKind = "client"
|
|
OpenTracingSpanKindServer OpenTracingSpanKind = "server"
|
|
OpenTracingSpanKindConsumer OpenTracingSpanKind = "consumer"
|
|
OpenTracingSpanKindProducer OpenTracingSpanKind = "producer"
|
|
OpenTracingSpanKindInternal OpenTracingSpanKind = "internal"
|
|
)
|
|
|
|
// StatusCodeFromHTTP takes an HTTP status code and return the appropriate OpenTelemetry status code
|
|
// See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md#status
|
|
func StatusCodeFromHTTP(httpStatusCode int) ptrace.StatusCode {
|
|
if httpStatusCode >= 100 && httpStatusCode < 399 {
|
|
return ptrace.StatusCodeUnset
|
|
}
|
|
return ptrace.StatusCodeError
|
|
}
|