operator

package
v0.0.0-...-1d44d98 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2020 License: Apache-2.0 Imports: 73 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIV1ReportGetEndpoint         = "/api/v1/reports/get"
	APIV2ReportEndpointPrefix      = "/api/v2/reports"
	APIV2ReportQueryEndpointPrefix = "/api/v2/reportqueries"
)
View Source
const (
	DefaultPrometheusQueryInterval                       = time.Minute * 5  // Query Prometheus every 5 minutes
	DefaultPrometheusQueryStepSize                       = time.Minute      // Query data from Prometheus at a 60 second resolution (one data point per minute max)
	DefaultPrometheusQueryChunkSize                      = 5 * time.Minute  // the default value for how much data we will insert into Presto per Prometheus query.
	DefaultPrometheusDataSourceMaxQueryRangeDuration     = 10 * time.Minute // how much data we will query from Prometheus at once
	DefaultPrometheusDataSourceMaxBackfillImportDuration = 2 * time.Hour    // how far we will query for backlogged data.
)
View Source
const (
	// AWSUsageHiveRowFormat is the Hadoop serialization/deserialization implementation used with AWS billing data.
	AWSUsageHiveRowFormat = `` /* 291-byte string literal not displayed */

)

Variables

View Source
var (
	AWSUsageHivePartitions = []hive.Column{
		{Name: billingPeriodStartPartitionColumnName, Type: "string"},
		{Name: billingPeriodEndPartitionColumnName, Type: "string"},
	}
)
View Source
var ErrReportIsRunning = errors.New("the report is still running")

Functions

func AWSColumnToHiveColumnType

func AWSColumnToHiveColumnType(c aws.Column) string

AWSColumnToHiveColumnType is the data type a column is created as in Hive.

func GetReportQueryForReport

func GetReportQueryForReport(report *metering.Report, queryGetter reporting.ReportQueryGetter) (*metering.ReportQuery, error)

GetReportQueryForReport returns the ReportQuery that was used in the Report parameter

func SanetizeAWSColumnForHive

func SanetizeAWSColumnForHive(col aws.Column) string

SanetizeAWSColumnForHive removes and replaces invalid characters in AWS billing columns with characters allowed in hive SQL

Types

type CollectPrometheusMetricsDataRequest

type CollectPrometheusMetricsDataRequest struct {
	StartTime time.Time `json:"startTime"`
	EndTime   time.Time `json:"endTime"`
}

type CollectPrometheusMetricsDataResponse

type CollectPrometheusMetricsDataResponse struct {
	Results []*prometheusImportResults `json:"results"`
}

type Config

type Config struct {
	Hostname     string
	OwnNamespace string

	AllNamespaces    bool
	TargetNamespaces []string

	Kubeconfig string

	APIListen     string
	MetricsListen string
	PprofListen   string

	HiveHost                  string
	HiveUseTLS                bool
	HiveCAFile                string
	HiveTLSInsecureSkipVerify bool

	HiveUseClientCertAuth bool
	HiveClientCertFile    string
	HiveClientKeyFile     string

	PrestoHost                  string
	PrestoUseTLS                bool
	PrestoCAFile                string
	PrestoTLSInsecureSkipVerify bool

	PrestoUseClientCertAuth bool
	PrestoClientCertFile    string
	PrestoClientKeyFile     string

	PrestoMaxQueryLength int

	DisablePrometheusMetricsImporter bool
	EnableFinalizers                 bool

	LogDMLQueries bool
	LogDDLQueries bool

	PrometheusQueryConfig                         metering.PrometheusQueryConfig
	PrometheusDataSourceMaxQueryRangeDuration     time.Duration
	PrometheusDataSourceMaxBackfillImportDuration time.Duration
	PrometheusDataSourceGlobalImportFromTime      *time.Time

	LeaderLeaseDuration time.Duration

	APITLSConfig     TLSConfig
	MetricsTLSConfig TLSConfig
	PrometheusConfig PrometheusConfig
}

type DependencyResolver

type DependencyResolver interface {
	ResolveDependencies(namespace string, inputDefs []metering.ReportQueryInputDefinition, inputVals []metering.ReportQueryInputValue) (*reporting.DependencyResolutionResult, error)
}

type GetReportResults

type GetReportResults struct {
	Results []ReportResultEntry `json:"results"`
}

type PrometheusConfig

type PrometheusConfig struct {
	Address         string
	SkipTLSVerify   bool
	BearerToken     string
	BearerTokenFile string
	CAFile          string
}

type RenderReportQueryRequest

type RenderReportQueryRequest struct {
	Inputs metering.ReportQueryInputValues `json:"inputs,omitempty"`
	Start  time.Time                       `json:"start,omitempty"`
	End    time.Time                       `json:"end,omitempty"`
}

type ReportResultEntry

type ReportResultEntry struct {
	Values []ReportResultValues `json:"values"`
}

type ReportResultValues

type ReportResultValues struct {
	Name        string      `json:"name"`
	Value       interface{} `json:"value"`
	TableHidden bool        `json:"tableHidden"`
	Unit        string      `json:"unit,omitempty"`
}

type Reporting

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

func New

func New(logger log.FieldLogger, cfg Config) (*Reporting, error)

func (*Reporting) Run

func (op *Reporting) Run(ctx context.Context) error

type StorePrometheusMetricsDataRequest

type StorePrometheusMetricsDataRequest []*prestostore.PrometheusMetric

type TLSConfig

type TLSConfig struct {
	UseTLS  bool
	TLSCert string
	TLSKey  string
}

func (*TLSConfig) Valid

func (cfg *TLSConfig) Valid() error

Directories

Path Synopsis
mock
Package mockprestostore is a generated GoMock package.
Package mockprestostore is a generated GoMock package.

Jump to

Keyboard shortcuts

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