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 CloudwatchRunner ¶
type CloudwatchRunner interface {
Run(ctx context.Context) ([]*model.CloudwatchData, error)
}
type Error ¶
type Error struct { JobContext ErrorType ErrorType Err error }
func (Error) ToLoggerKeyVals ¶
func (e Error) ToLoggerKeyVals() []interface{}
type JobContext ¶
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
func (Scraper) Scrape ¶
func (s Scraper) Scrape(ctx context.Context) ([]model.TaggedResourceResult, []model.CloudwatchMetricResult, []Error)