Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-basinov committed Nov 8, 2023
1 parent e4c73c2 commit 0189e6d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions confgenerator/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ func (r PrometheusMetrics) Type() string {
}

func (r PrometheusMetrics) Pipelines(ctx context.Context) []otel.ReceiverPipeline {
// Get the resource metadata for the instance we're running on.
if MetadataResource != nil {
resourceMetadataMap := MetadataResource.PrometheusStyleMetadata()
if p := platform.FromContext(ctx).ResourceOverride; p != nil {
resourceMetadataMap = p.PrometheusStyleMetadata()
}

// Add the GCE metadata to the prometheus config.
resource := MetadataResource
if p := platform.FromContext(ctx).ResourceOverride; p != nil {
resource = p
}
if resource != nil {
// Get the resource metadata for the instance we're running on.
resourceMetadataMap := resource.PrometheusStyleMetadata()
// Add the resource metadata to the prometheus config.
for i := range r.PromConfig.ScrapeConfigs {
// Iterate over the static configs.
for j := range r.PromConfig.ScrapeConfigs[i].ServiceDiscoveryConfigs {
Expand Down

0 comments on commit 0189e6d

Please sign in to comment.