internaltelemetry

package
v0.0.0-...-eb3d71d Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

README

  • The internaltelemetry package

This package is a temporary location for the implementation of being able to log internal telemetry to the DataDog back end for internal consumption. The long-term mechanisms for this are currently being worked out. In the short term, this is a temporary package for a limited number of consumers who need to be able to log internal data.

Documentation

Overview

Package internaltelemetry full description in README.md

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	ServiceName     string `json:"service_name"`
	ServiceVersion  string `json:"service_version"`
	LanguageName    string `json:"language_name"`
	LanguageVersion string `json:"language_version"`
	TracerVersion   string `json:"tracer_version"`
}

Application defines the application object

type Client

type Client interface {
	SendLog(level string, message string)
	SendTraces(traces pb.Traces)
}

Client defines the interface for a telemetry client

func NewClient

func NewClient(httpClient httpClient, endpoints []*config.Endpoint, service string, debug bool) Client

NewClient creates a new telemetry client

type Event

type Event struct {
	APIVersion  string      `json:"api_version"`
	RequestType RequestType `json:"request_type"`
	TracerTime  int64       `json:"tracer_time"` // unix timestamp (in seconds)
	RuntimeID   string      `json:"runtime_id"`
	SequenceID  uint64      `json:"seq_id"`
	DebugFlag   bool        `json:"debug"`
	Origin      string      `json:"origin"`
	Host        Host        `json:"host"`
	Application Application `json:"application"`
	Payload     interface{} `json:"payload"`
}

Event defines the event object

type Host

type Host struct {
	Hostname      string `json:"hostname"`
	OS            string `json:"os"`
	Arch          string `json:"architecture"`
	KernelName    string `json:"kernel_name"`
	KernelRelease string `json:"kernel_release"`
	KernelVersion string `json:"kernel_version"`
}

Host defines the host object

type LogMessage

type LogMessage struct {
	Message string `json:"message"`
	Level   string `json:"level"`
}

LogMessage defines the log message object

type LogPayload

type LogPayload struct {
	Logs []LogMessage `json:"logs"`
}

LogPayload defines the log payload object

type RequestType

type RequestType string

RequestType defines the request type

const (
	// RequestTypeLogs defines the logs request type
	RequestTypeLogs RequestType = "logs"
	// RequestTypeTraces defines the traces request type
	RequestTypeTraces RequestType = "traces"
)

type TracePayload

type TracePayload struct {
	Traces []pb.Trace `json:"traces"`
}

TracePayload defines the trace payload object

Jump to

Keyboard shortcuts

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