job

package
v0.62.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Copyright 2024 The Prometheus Authors Licensed 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.

Copyright 2024 The Prometheus Authors Licensed 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.

Copyright 2024 The Prometheus Authors Licensed 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.

Copyright 2024 The Prometheus Authors Licensed 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.

Copyright 2024 The Prometheus Authors Licensed 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

This section is empty.

Variables

This section is empty.

Functions

func ScrapeAwsData

func ScrapeAwsData(
	ctx context.Context,
	logger logging.Logger,
	jobsCfg model.JobsConfig,
	factory clients.Factory,
	metricsPerQuery int,
	cloudwatchConcurrency cloudwatch.ConcurrencyConfig,
	taggingAPIConcurrency int,
) ([]model.TaggedResourceResult, []model.CloudwatchMetricResult)

Types

type Account

type Account struct {
	ID    string
	Alias string
}

type CloudwatchRunner

type CloudwatchRunner interface {
	Run(ctx context.Context) ([]*model.CloudwatchData, error)
}

type Error

type Error struct {
	JobContext
	ErrorType ErrorType
	Err       error
}

func NewError

func NewError(context JobContext, errorType ErrorType, err error) Error

func (Error) ToLoggerKeyVals

func (e Error) ToLoggerKeyVals() []interface{}

type ErrorType

type ErrorType string
var (
	AccountErr              ErrorType = "Account for job was not found"
	ResourceMetadataErr     ErrorType = "Failed to run resource metadata for job"
	CloudWatchCollectionErr ErrorType = "Failed to gather cloudwatch metrics for job"
)

type JobContext

type JobContext struct {
	Account   Account
	Namespace string
	Region    string
	RoleARN   string
}

JobContext exists to track data we want for logging, errors, or other output context that's learned as the job runs This makes it easier to track the data additively and morph it to the final shape necessary be it a model.ScrapeContext or an Error. It's an exported type for tests but is not part of the public interface

func (JobContext) ToScrapeContext

func (jc JobContext) ToScrapeContext(customTags []model.Tag) *model.ScrapeContext

type ResourceMetadataRunner

type ResourceMetadataRunner interface {
	Run(ctx context.Context, region string, job model.DiscoveryJob) ([]*model.TaggedResource, error)
}

type Scraper

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

func NewScraper

func NewScraper(logger logging.Logger,
	jobsCfg model.JobsConfig,
	runnerFactory runnerFactory,
) *Scraper

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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