internal

package
v1.5.0-jsonlog-preview Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProdAddr is the production address.
	ProdAddr = "logging.googleapis.com:443"

	// TraceHeader is the HTTP header trace information is stored in.
	TraceHeader = "X-Cloud-Trace-Context"
)

Variables

This section is empty.

Functions

func DeconstructXCloudTraceContext

func DeconstructXCloudTraceContext(s string) (traceID, spanID string, traceSampled bool)

DeconstructXCloudTraceContext extracts trace information from the trace header.

As per the format described at https://cloud.google.com/trace/docs/setup#force-trace

"X-Cloud-Trace-Context: TRACE_ID/SPAN_ID;o=TRACE_TRUE"

for example:

"X-Cloud-Trace-Context: 105445aa7843bc8bf206b120001000/1;o=1"

We expect:

  • traceID (optional): "105445aa7843bc8bf206b120001000"
  • spanID (optional): "1"
  • traceSampled (optional): true

func FixUTF8

func FixUTF8(s string) string

FixUTF8 is a helper that fixes an invalid UTF-8 string by replacing invalid UTF-8 runes with the Unicode replacement character (U+FFFD). See Issue https://github.com/googleapis/google-cloud-go/issues/1383.

func LogIDFromPath

func LogIDFromPath(parent, path string) string

LogIDFromPath parses and returns the ID from a log path.

func LogPath

func LogPath(parent, logID string) string

LogPath creates a formatted path from a parent and a logID.

func ToProtoStruct

func ToProtoStruct(v interface{}) (*structpb.Struct, error)

ToProtoStruct converts v, which must marshal into a JSON object, into a Google Struct proto.

Types

This section is empty.

Directories

Path Synopsis
Package testing provides support for testing the logging client.
Package testing provides support for testing the logging client.

Jump to

Keyboard shortcuts

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