ddapi

package
v0.0.0-...-70b770e Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TranslateDDCheckRunJSON

func TranslateDDCheckRunJSON(doc []byte) ([]prompb.TimeSeries, error)

func TranslateDDSeriesJSON

func TranslateDDSeriesJSON(doc []byte) ([]prompb.TimeSeries, error)

Expected input JSON document structure: a set of time series fragments that the DD agent POSTs to /api/v1/series. Example:

{
  "series": [
    {
      "metric": "datadog.trace_agent.trace_writer.traces",
      "points": [
        [
          1610032230,
          0
        ],
        ...
      ],
      "tags": [
        "version:7.24.1"
      ],
      "host": "x1carb6",
      "type": "rate",
      "interval": 10
    },
    {
      "metric": "datadog.dogstatsd.client.metrics",
      "points": [
    ...
    }
  ]
}

Note that each object in the `series` array is a time series fragment for a specific metric. Each metric is defined by its name and other meta data (think: labels). The time series fragment is comprised of one or multiple data points / samples.

func ZlibDecode

func ZlibDecode(src []byte) ([]byte, error)

func ZlibEncode

func ZlibEncode(src []byte) ([]byte, error)

Types

type DDCortexProxy

type DDCortexProxy struct {
	// contains filtered or unexported fields
}

func NewDDCortexProxy

func NewDDCortexProxy(
	tenantName string,
	remoteWriteURL string,
	disableAPIAuthentication bool) *DDCortexProxy

func (*DDCortexProxy) HandlerCheckPost

func (ddcp *DDCortexProxy) HandlerCheckPost(w http.ResponseWriter, r *http.Request)

func (*DDCortexProxy) HandlerCommonAfterJSONTranslate

func (ddcp *DDCortexProxy) HandlerCommonAfterJSONTranslate(
	w http.ResponseWriter,
	r *http.Request,
	ptsf []prompb.TimeSeries,
)

func (*DDCortexProxy) HandlerSeriesPost

func (ddcp *DDCortexProxy) HandlerSeriesPost(w http.ResponseWriter, r *http.Request)

func (*DDCortexProxy) ReadAndValidateRequest

func (ddcp *DDCortexProxy) ReadAndValidateRequest(w http.ResponseWriter, r *http.Request) ([]byte, error)

Common request validation and processing for the URL handlers below.

type DDTSFragment

type DDTSFragment struct {
	// contains filtered or unexported fields
}

A struct with parameters representing a DD time series fragment. Most of these can be left "undefined" (zero) and will be filled with simple default values, see `toJSON()` below.

Jump to

Keyboard shortcuts

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