prometheus

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Licensed to Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Apache Software Foundation (ASF) licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Apache Software Foundation (ASF) licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Apache Software Foundation (ASF) licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	Name     = "prometheus-metrics-fetcher"
	ShowName = "Prometheus Metrics Fetcher"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetcher

type Fetcher struct {
	config.CommonFields
	// config is the top level configuratScrapeConfigsMapion of prometheus
	ScrapeConfigsMap []*scrapeConfig `mapstructure:"scrape_configs" yaml:"scrape_configs"`

	ScrapeConfigs []*promConfig.ScrapeConfig
	// events
	OutputEvents event.BatchEvents
	// outputChannel
	OutputChannel chan *v1.SniffData
}

Fetcher is the struct for Prometheus fetcher

func (*Fetcher) Channel

func (f *Fetcher) Channel() <-chan *v1.SniffData

func (*Fetcher) DefaultConfig

func (f *Fetcher) DefaultConfig() string

func (*Fetcher) Description

func (f *Fetcher) Description() string

func (*Fetcher) Fetch

func (f *Fetcher) Fetch(ctx context.Context)

func (*Fetcher) Name

func (f *Fetcher) Name() string

func (*Fetcher) Prepare

func (f *Fetcher) Prepare()

func (*Fetcher) ScrapeConfig

func (f *Fetcher) ScrapeConfig(ctx context.Context)

func (*Fetcher) ShowName added in v0.4.0

func (f *Fetcher) ShowName() string

func (*Fetcher) Shutdown

func (f *Fetcher) Shutdown(ctx context.Context) error

func (*Fetcher) SupportForwarders

func (f *Fetcher) SupportForwarders() []forwarder.Forwarder

type MetadataCache

type MetadataCache interface {
	Metadata(metricName string) (scrape.MetricMetadata, bool)
	SharedLabels() labels.Labels
}

MetadataCache is an adapter to prometheus' scrape.Target and provide only the functionality which is needed

type MetricFamily

type MetricFamily interface {
	Add(metricName string, ls labels.Labels, t int64, v float64) error
	IsSameFamily(metricName string) bool
	// to OTLP metrics
	// will return 1. metricspb.Metric with timeseries 2. counter all of timeseries 3. count dropped timeseries
	ToMetric() []*v3.MeterData
}

type QueueAppender

type QueueAppender struct {
	Ctx context.Context
	Ms  *metadataService

	OutputChannel chan *v1.SniffData
	// contains filtered or unexported fields
}

QueueAppender appender with queue

func NewQueueAppender

func NewQueueAppender(ctx context.Context, ms *metadataService, oc chan *v1.SniffData, useStartTimeMetric bool) *QueueAppender

NewQueueAppender construct QueueAppender

func (*QueueAppender) Add

func (qa *QueueAppender) Add(ls labels.Labels, t int64, v float64) (uint64, error)

Add always returns 0 to disable label caching

func (*QueueAppender) AddFast

func (qa *QueueAppender) AddFast(_ uint64, _ int64, _ float64) error

AddFast always returns error since we do not cache

func (*QueueAppender) Commit

func (qa *QueueAppender) Commit() error

Commit submit metrics data to consumers

func (*QueueAppender) Rollback

func (qa *QueueAppender) Rollback() error

type QueueStore

type QueueStore struct {
	OutputChannel chan *v1.SniffData
	// contains filtered or unexported fields
}

func NewQueueStore

func NewQueueStore(ctx context.Context, useStartTimeMetric bool, receiverName string, oc chan *v1.SniffData) *QueueStore

NewQueueStore construct QueueStore

func (*QueueStore) Appender

func (qs *QueueStore) Appender(ctx context.Context) storage.Appender

func (*QueueStore) Close

func (qs *QueueStore) Close() error

func (*QueueStore) SetScrapeManager

func (qs *QueueStore) SetScrapeManager(scrapeManager *scrape.Manager)

type ScrapeManager

type ScrapeManager interface {
	TargetsAll() map[string][]*scrape.Target
}

Jump to

Keyboard shortcuts

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