当前位置: 首页 > 知识库问答 >
问题:

错误-“invalid”不是有效的开始标记

颛孙越
2023-03-14
    null

以下是详细信息-

普罗米修斯日志:

level=warn ts=2019-09-06t11:42:42.187z caller=Scrape.go:937 component=“Scrape Manager”Scrape_pool=WebLogic1 target=http://****************:7001/wls-exporter msg=“append failed”err=“\”invalid\“不是有效的启动令牌”

curl output1 :-
-bash-4.2$ curl http://**********.***.****.***:7001/wls-exporter | promtool check metrics
-bash: promtool: command not found
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1783  100  1783    0     0   323k      0 --:--:-- --:--:-- --:--:--  348k
(23) Failed writing body
-bash-4.2$

curl output2 :-
-bash-4.2$ curl -v --noproxy '*' 'http://**********.***.****.***:7001/wls-exporter'
* About to connect() to **********.***.****.*** port 7001 (#0)
*   Trying **.**.***.***...
* Connected to **********.***.****.*** (**.**.***.***) port 7001 (#0)
> GET /wls-exporter HTTP/1.1
> User-Agent: curl/7.29.0
> Host: **********.***.****.***:7001
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Fri, 06 Sep 2019 11:27:23 GMT
< Content-Length: 1783
<
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Weblogic Monitoring Exporter</title>
</head>
<body>
<h2>This is the WebLogic Monitoring Exporter.</h2>
<p>The metrics are found at <a href="/wls-exporter/metrics">
metrics</a> relative to this location.
</p>
<h2>Configuration</h2>
<p>To change the configuration:</p>
<form action="/wls-exporter/configure" method="post" enctype="multipart/form-data">
    <input type="radio" name="effect" value="append">Append
    <input type="radio" name="effect" value="replace" checked="checked">Replace
    <br><input type="file" name="configuration">
    <br><input type="submit">
</form>
<p>Current Configuration</p>
<p><code><pre>
host: **********.***.****.***
port: 7001
query_sync:
  url: http://coordinator:8999/
  refreshInterval: 5
metricsNameSnakeCase: true
domainQualifier: true
restPort: 7001
queries:
- key: name
  keyName: server
  applicationRuntimes:
    key: name
    keyName: app
    componentRuntimes:
      type: WebAppComponentRuntime
      prefix: webapp_config_
      key: name
      values: [deploymentState, contextRoot, sourceInfo, openSessionsHighCount, openSessionsCurrentCount, sessionsOpenedTotalCount, sessionCookieMaxAgeSecs, sessionInvalidationIntervalSecs, sessionTimeoutSecs, singleThreadedServletPoolSize, sessionIDLength, servletReloadCheckSecs, jSPPageCheckSecs]
      servlets:
        prefix: weblogic_servlet_
        key: servletName
        values: [invocationTotalCount, reloadTotal, executionTimeAverage, poolMaxCapacity, executionTimeTotal, reloadTotalCount, executionTimeHigh, executionTimeLow]
- JVMRuntime:
    prefix: jvm_
    key: name
    values: [heapFreeCurrent, heapFreePercent, heapSizeCurrent, heapSizeMax, uptime, processCpuLoad]
</pre></code></p>
* Connection #0 to host **********.***.****.*** left intact
-bash-4.2$

共有1个答案

子车英达
2023-03-14

当Prometheus期望OpenMetric格式但得到其他格式时,通常会遇到“invalid”不是有效的开始标记“错误。在这种情况下,如果您省略了URL的en处的/metrics,或者如果导出器报告了一个错误页面(401-需要身份验证),则导出器登陆页面。

查看相关的源代码,似乎Prometheus发送给导出器的身份验证令牌被转发到Weblogic API。普罗米修斯配置应该如下所示:

- job_name: 'weblogic'
  ...
  basic_auth:
    username: weblogic
    password: friend

您可以使用curl和相关参数测试它:

curl -u 'weblogic:friend' http://**********.***.****.***:7001/wls-exporter/metrics | promtool check metrics
 类似资料:
  • 我正在websphere 7.0版本上运行一个应用程序,该应用程序是在我的QA环境中新设置的,并且低于oracle错误

  • 我对ansible相当陌生,我写了一个剧本,用于检查和安装多台机器的内核升级,但我一直遇到下面的问题。 ...

  • 问题内容: 我有一个从朋友那里收到的Django小项目。该代码可以在他的系统上完美运行。但是,在我的系统上,运行服务器时收到以下错误消息: /的TemplateSyntaxError ‘current_tags’不是有效的标签库:找不到模板库current_tags,尝试过django.templatetags.current_tags 问题出在html文件中的一行: 此完全相同的代码可在他的系统

  • 我正在尝试将我的实时数据库内容复制到fiRecovery。但是当我使用set函数时,我遇到了这个错误。 错误日志 错误:参数“options”不是有效的SetOptions。输入不是对象。在出口方面。(匿名函数)(/user_code/node_modules/firebase admin/node_modules/@google cloud/firestore/src/validate.js:8

  • 我正在尝试为rest api定义一个简单的swagger定义。我在所有参数部分都收到错误。 我在招摇编辑器中得到了以下招摇定义错误,我不知道我错了什么。请告知。 昂首阔步的定义: 昂首阔步错误:

  • 我试着在我的第一个ruby项目中捆绑安装,做了一个教程,所以我对所有这些编码内容都很陌生。我遵循了教程的一部分,一切都很顺利,直到我遇到以下问题: Gem::RemoteFetcher::FetchError:SSL\u connect返回=1 errno=0 state=SSLv3读取服务器证书B:证书验证失败https://rubygems.org/gems/rake-10.4.2安装rake