tempo

package
v0.0.0-...-b8a1a0e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

README

protobuf

  • Response of tempo api:
{
    // The resource for the spans in this message.
    // If this field is not set then no resource info is known.
    "resource":{
        "attributes":[
            {
                "key":"service.name",
                "value":{
                    "stringValue":"xxx"
                }
            },
            {
                "key":"xxx",
                "value":{
                    "stringValue":"xxx"
                }
            }
            ...
        ]
    },
    // The instrumentation library information for the spans in this message.
    // Semantically when InstrumentationLibrary isn't set, it is equivalent with
    // an empty instrumentation library name (unknown).
    "instrumentationLibrarySpans":{
        "instrumentationLibrary":{
            "name":"xxx",
            "version":"xxx"
        },
        "spans":[
            {
                // A unique identifier for a trace. All spans from the same trace share
                // the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes
                // is considered invalid.
                //
                // This field is semantically required. Receiver should generate new
                // random trace_id if empty or invalid trace_id was received.
                //
                // This field is required.
                "traceId":"WTqtr7BlQGzwAyzVaQhnqA=                
                // A unique identifier for a span within a trace, assigned when the span
                // is created. The ID is an 8-byte array. An ID with all zeroes is considered
                // invalid.
                //
                // This field is semantically required. Receiver should generate new
                // random span_id if empty or invalid span_id was received.
                //
                // This field is required.
                "spanId":"thJE5jAyatg                
                // The `span_id` of this span's parent span. If this is a root span, then this
                // field must be empty. The ID is an 8-byte array.
                "parentSpanId":"AdJrrVtdU9g                
                // A description of the span's operation.
                //
                // For example, the name can be a qualified method name or a file name
                // and a line number where the operation is called. A best practice is to use
                // the same display name at the same call point in an application.
                // This makes it easier to correlate spans in different traces.
                //
                // This field is semantically required to be set to non-empty string.
                // Empty value is equivalent to an unknown span name.
                //
                // This field is required.
                "name":"proxy0.getStoc                
                // Distinguishes between spans generated in a particular context. For example,
                // two spans with the same name may be distinguished using `CLIENT` (caller)
                // and `SERVER` (callee) to identify queueing latency associated with the span.
                "kind":"SPAN_KIND_INTERNA                
                "startTimeUnixNano":"1668391014669291592",
                "endTimeUnixNano":"166839101466938600                
                // attributes is a collection of key/value pairs. Note, global attributes
                // like server name can be set using the resource API. Examples of attributes:
                //
                //     "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
                //     "/http/server_latency": 300
                //     "abc.com/myattribute": true
                //     "abc.com/score": 10.239
                //
                // The OpenTelemetry API specification further restricts the allowed value types:
                // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/common.md#attributes
                // Attribute keys MUST be unique (it is not allowed to have more than one
                // attribute with the same key).
                "attributes":[
                    {
                        "key":"xxx",
                        "value":{
                            "stringValue":"xxx"
                        }
                    },
                    ...
                ],
                "status":{
                }
            }
        ]
    }
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var L7_FLOW_LOG_SERVICE_NAME = "app_service"
View Source
var L7_TRACING_ENDPOINT = "endpoint"
View Source
var L7_TRACING_OTEL_SDK_NAME = "telemetry.sdk.name"
View Source
var L7_TRACING_OTEL_SDK_VERSION = "telemetry.sdk.version"
View Source
var L7_TRACING_SERVICE_UID = "service_uid"
View Source
var L7_TRACING_SERVICE_UNAME = "service_uname"
View Source
var RESOURCE_KEY_MAP = map[string]string{
	"service.id":   L7_TRACING_SERVICE_UID,
	"service.name": L7_TRACING_SERVICE_UNAME,
}
View Source
var SEARCH_FIELDS = []string{
	"trace_id as traceID", "app_service as rootServiceName", "endpoint as rootTraceName", "toUnixTimestamp64Micro(start_time) as startTimeUnixNano", "response_duration/1000 as durationMs",
}
View Source
var SPAN_ATTRS_MAP = map[string]string{
	"service.name": L7_FLOW_LOG_SERVICE_NAME,
	"name":         L7_TRACING_ENDPOINT,
}
View Source
var SPAN_KEY_MAP = map[string]string{
	"tap_side":                    "Enum(tap_side)",
	"observatrace_span_id":        "observatrace_span_id",
	"observatrace_parent_span_id": "observatrace_parent_span_id",
}
View Source
var TABLE_NAME_L7_FLOW_LOG = "l7_flow_log"

Functions

func ConvertL7TracingRespToProto

func ConvertL7TracingRespToProto(data map[string]interface{}, argTraceId string) (req *tempopb.Trace)

func FindTraceByTraceID

func FindTraceByTraceID(args *common.TempoParams) (req *tempopb.Trace, err error)

func L7TracingRequest

func L7TracingRequest(args *common.TempoParams) (map[string]interface{}, error)

func ParseResponse

func ParseResponse(response *http.Response) (map[string]interface{}, error)

func ShowTagValues

func ShowTagValues(args *common.TempoParams) (resp map[string][]interface{}, debug map[string]interface{}, err error)

func ShowTags

func ShowTags(args *common.TempoParams) (resp map[string][]interface{}, debug map[string]interface{}, err error)

func TraceSearch

func TraceSearch(args *common.TempoParams) (resp map[string]interface{}, debug map[string]interface{}, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL