在初次使用promtail收集日志时,使用了大量labels

#- job_name: nginx_test
#  static_configs:
#  - targets:
#      - localhost
#    labels:
#      app: nginx
#      env: prod
#      host: nginx1
#      __path__: /var/log/nginx/access.log
#  pipeline_stages:
#  - match:
#      selector: '{app="nginx"}'
#      stages:
#      - regex:
#          expression: '^(?P<host>[\w\.]+) - (?P<user>[^ ]*) \[(?P<timestamp>.*)\] "(?P<method>[^ ]*) (?P<request_url>[^ ]*) (?P<request_http_protocol>[^ ]*)" (?P<status>[\d]+) (?P<bytes_out>[\d]+) "(?P<http_referer>[^"]*)" "(?P<user_agent>[^"]*)" "(?P<upstream_addr>[^"]*)" "(?P<upstream_response_time>[^"]*)" "(?P<request_time>[^"]*)"?'
#      - labels:
#          status:
#          request_time:
#          host:
#          user:
#          method:
#          request_url:
#          upstream_addr:

启动后报错

Maximum active stream limit exceeded, reduce the number of active streams

其中labels等字段不应存储为标签,而应使用正则表达式或更优选的模式解析器在查询时将它们提取到标签中。

更改后如下:

#- job_name: nginx_test
#  static_configs:
#  - targets:
#      - localhost
#    labels:
#      app: nginx
#      env: prod
#      host: nginx1
#      __path__: /var/log/nginx/access.log
#  pipeline_stages:
#  - match:
#      selector: '{app="nginx"}'
#      stages:
#      - regex:
#          expression: '^(?P<host>[\w\.]+) - (?P<user>[^ ]*) \[(?P<timestamp>.*)\] "(?P<method>[^ ]*) (?P<request_url>[^ ]*) (?P<request_http_protocol>[^ ]*)" (?P<status>[\d]+) (?P<bytes_out>[\d]+) "(?P<http_referer>[^"]*)" "(?P<user_agent>[^"]*)" "(?P<upstream_addr>[^"]*)" "(?P<upstream_response_time>[^"]*)" "(?P<request_time>[^"]*)"?'
#      - timestamp:
#          format: RFC3339Nano
#          source: timestamp

重新启动,报错解决

Promtail报错处理相关推荐

  1. 继承WebMvcConfigurer 和 WebMvcConfigurerAdapter类依然CORS报错? springboot 两种方式稳定解决跨域问题

    继承WebMvcConfigurer 和 WebMvcConfigurerAdapter类依然CORS报错???springboot 两种方式稳定解决跨域问题! 之前我写了一篇文章,来解决CORS报错 ...

  2. Access to XMLHttpRequest at file from origin ‘null‘ has been blocked by CORS policy谷歌浏览器本地打开项目js文件报错

    Access to XMLHttpRequest at 'file:///xxxxx/PQ.BaseInfo.proto' from origin 'null' has been blocked by ...

  3. go build 编译报错 missing go.sum entry for module providing package

    go build 编译报错 missing go.sum entry for module providing package 解决方法 // 移除未使用的依赖 go mod tidy 再次编译,就可 ...

  4. docker报错:driver failed programming external connectivity on endpoint, iptables:No chain by that name

    docker 报错: Error response from daemon: Cannot restart container hello: driver failed programming ext ...

  5. mybatis查询报错:com.mysql.cj.exceptions.DataConversionException: Cannot determine value type from string

    mybatis查询报错: com.mysql.cj.exceptions.DataConversionException: Cannot determine value type from strin ...

  6. mongo报错:not authorized on bb to execute command { create: \“xxx\“...}

    mongo报错: {"ok" : 0,"errmsg" : "not authorized on bb to execute command { cr ...

  7. restTemplate http请求报错:no suitable HttpMessageConverter found for response type and content type

    报错信息: org.springframework.web.client.UnknownContentTypeException: Could not extract response: no sui ...

  8. 解决gitte提交报错 error: GE007: Your push would publish a private email address.

    错误情况: gitte提交报错,无法提交上去,报错如下: remote: Powered by GITEE.COM [GNK-6.0] remote: error: GE007: Your push ...

  9. JS Uncaught SyntaxError:Unexpected identifier异常报错原因及其解决方法

    最近在写ajax的时候,调用js方法,遇到了Uncaught SyntaxError:Unexpected identifier异常报错,开始搞不清原因,很苦恼. 以为是js方法参数个数和长度的问题, ...

最新文章

  1. LabVIEW色彩分类识别(基础篇—15)
  2. Android异步消息机制
  3. HDU 1412 {A} + {B}
  4. linux send与recv函数详解
  5. 聚焦场景落地, 看“云+AI”如何激发5G的“隐藏技能”
  6. 《PHP求职宝典》--Web设计页面笔记
  7. RHEL5.3下MRTG+SNMP的搭建
  8. 如何理解android的函数,通过Android源码理解回调函数
  9. 转载:JAVA日期处理
  10. 《vue2.0基础系列》目录大全,你要的都在这里
  11. iOS webview自适应实际内容高度的4种方法
  12. JPA-update方法使用踩坑记
  13. 微信小程序input详解
  14. PartialDependencePlots
  15. java 中文分词转拼音_Java实现将汉字转化为汉语拼音的方法
  16. OpenWrt固件实现路由器定时重启方法
  17. ardunio mega2560+esp01实现物联网的数据上行和数据下行
  18. 阿里巴巴面试java研发工程师实录
  19. 计算机网络第七版3-2
  20. 17-kubernetes集群中ceph集群使用

热门文章

  1. 关于Java中抽象类和接口的一点思索
  2. Rasterino 2.3.0版for AI 2020 (Illustrator裁切图片一键PS修图插件)
  3. 解读,产业链和价值链的联系和区别
  4. 一分钟详解「手眼标定」基本原理
  5. C++四种类型转换总结
  6. 前端面试题_2022-02
  7. 一个图层隶属下一个图层
  8. 计算机领域资讯(一)
  9. 计算机工程学院文艺例会,信息快讯 | 喜迎学代会-信息与计算机工程学院学生会组织召开第二次全体工作例会...
  10. 如何解除win10和Git的最大文件路径限制