我遵循了https://aws.amazon.com/blogs/containers/introducing-amazon-cloudwatch-container-insights-for-amazon-eks-fargate-using-aws-distro-for-opentelemetry/中的指令,我只想向CloudWatch发送一些度量。我不知道如何访问豆荚的名称/标签,所以我使用了PodName。我搞错了。以下是过滤器部分:
filter:
metrics:
include:
match_type: expr
expressions:
- MetricName startsWith "pod_cpu"
exclude:
match_type: expr
expressions:
- not (PodName startsWith "abcd")部署之后,我检查了日志:
github.com/prometheus/prometheus@v1.8.2-0.20210621150501-ff58416a0b02/scrape/scrape.go:1148
2022-06-16T22:20:35.131Z error filterprocessor@v0.39.0/filter_processor.go:127 shouldKeepMetric failed {"kind": "processor", "name": "filter", "error": "cannot fetch PodName from *filterexpr.env (1:6)\n | not (PodName startsWith \"abcd\")\n | .....^"}
github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor.(*filterMetricProcessor).processMetrics.func1.1.1
github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor@v0.39.0/filter_processor.go:127
go.opentelemetry.io/collector/model/pdata.MetricSlice.RemoveIf
go.opentelemetry.io/collector/model@v0.39.0/pdata/generated_metrics.go:538谢谢你提前帮忙,朱莉
发布于 2022-06-17 06:57:18
Podname是标签,所以它应该是:
exclude:
match_type: expr
expressions:
- not (Label("PodName") startsWith "abcd")https://stackoverflow.com/questions/72652768
复制相似问题