Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring 使用弹簧套和千分尺在Dynatrace中创建度量时出错_Spring_Spring Boot_Spring Micrometer_Dynatrace - Fatal编程技术网

Spring 使用弹簧套和千分尺在Dynatrace中创建度量时出错

Spring 使用弹簧套和千分尺在Dynatrace中创建度量时出错,spring,spring-boot,spring-micrometer,dynatrace,Spring,Spring Boot,Spring Micrometer,Dynatrace,我想将我的Spring Boot应用程序的指标发送到Dynatrace。该应用程序使用弹簧靴2.2.3,测微计版本为1.3.2。在application.yaml文件中,设置了动态跟踪URL、API令牌和设备Id的属性。启动应用程序时,日志显示以下错误: 2020-01-24 17:34:03.099 DEBUG 6 --- [trics-publisher] s.n.www.protocol.http.HttpURLConnection : sun.net.www.MessageHeader

我想将我的Spring Boot应用程序的指标发送到Dynatrace。该应用程序使用弹簧靴2.2.3,测微计版本为1.3.2。在application.yaml文件中,设置了动态跟踪URL、API令牌和设备Id的属性。启动应用程序时,日志显示以下错误:

2020-01-24 17:34:03.099 DEBUG 6 --- [trics-publisher] s.n.www.protocol.http.HttpURLConnection  : sun.net.www.MessageHeader@53ddc3e27 pairs: {PUT /e/b63c9b27-de7e-498b-8466-1987a7f6af7d/api/api/v1/timeseries/custom:tomcat.sessions.alive.max?api-token=xxx HTTP/1.1: null}{Content-Type: application/json}{User-Agent: Java/13.0.1}{Host: apm.cf.eu10.hana.ondemand.com}{Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2}{Connection: keep-alive}{Content-Length: 116}
2020-01-24 17:34:03.137 DEBUG 6 --- [trics-publisher] s.n.www.protocol.http.HttpURLConnection  : sun.net.www.MessageHeader@1e1eb5659 pairs: {null: HTTP/1.1 405 Method Not Allowed}{Content-Security-Policy: default-src 'self' 'nonce-p+oZSPTiRzS6ULGJdzTL1g==' data: ;script-src 'self' 'unsafe-eval' localhost:9876 127.0.0.1:9876 localhost:4200 127.0.0.1:4200 https://static.woopra.com https://www.woopra.com/ https://app.intercom.io https://widget.intercom.io https://js.intercomcdn.com https://js-cdn.dynatracelabs.com 'unsafe-inline';object-src 'self' 'nonce-p+oZSPTiRzS6ULGJdzTL1g==' ;style-src 'self' 'unsafe-inline' localhost:9876 127.0.0.1:9876 localhost:4200 127.0.0.1:4200;font-src 'self' 'nonce-p+oZSPTiRzS6ULGJdzTL1g==' localhost:9876 127.0.0.1:9876 localhost:4200 127.0.0.1:4200 https://js.intercomcdn.com;img-src 'self' 'nonce-p+oZSPTiRzS6ULGJdzTL1g==' data: localhost:9876 127.0.0.1:9876 localhost:4200 127.0.0.1:4200 https://ruxit-synth-screencap-dev.s3.amazonaws.com https://ruxit-synth-screencap-sprint.s3.amazonaws.com https://ruxit-synth-screencap.s3.amazonaws.com https://js.intercomcdn.com data: https://static.intercomassets.com https://downloads.intercomcdn.com https://uploads.intercomusercontent.com https://gifs.intercomcdn.com https://dt-cdn.net https://dynatrace.asknice.ly;media-src 'self' 'nonce-p+oZSPTiRzS6ULGJdzTL1g==' https://js.intercomcdn.com;frame-src 'self' 'nonce-p+oZSPTiRzS6ULGJdzTL1g=='  localhost:9876 127.0.0.1:9876 https://www.youtube.com https://fast.wistia.net https://share.intercom.io https://intercom-sheets.com https://player.vimeo.com;connect-src 'self' 'nonce-p+oZSPTiRzS6ULGJdzTL1g==' localhost:9876 127.0.0.1:9876 localhost:4200 127.0.0.1:4200 wss://localhost:4200 wss://127.0.0.1:4200 https://api.segment.io https://trello.com/1/ https://api.intercom.io https://api-iam.intercom.io https://api-ping.intercom.io https://nexus-websocket-a.intercom.io https://nexus-websocket-b.intercom.io https://nexus-long-poller-a.intercom.io https://nexus-long-poller-b.intercom.io wss://nexus-websocket-a.intercom.io wss://nexus-websocket-b.intercom.io https://uploads.intercomcdn.com https://uploads.intercomusercontent.com https://js.intercomcdn.com;child-src 'self' blob:;worker-src 'self' blob:;frame-ancestors 'self' ;base-uri 'self' ;form-action 'self' https://dynatrace.asknice.ly https://api-iam.intercom.io https://accounts.sap.com; report-uri /reportCPSViolations}{Date: Fri, 24 Jan 2020 17:34:03 GMT}{Frame-Options: SAMEORIGIN}{Set-Cookie: apmroute=6c416ea40448a6d5e825253d116a9479; Path=/; Secure; HttpOnly}{Set-Cookie: apmsessionid=node035abqwwf0bk41tgs7gg4yic5l897270.node0;Path=/;Secure;HttpOnly}{X-Vcap-Request-Id: 31a4aa2b-38ca-44c5-5da3-fa60830be4da}{Content-Length: 0}{Strict-Transport-Security: max-age=31536000; includeSubDomains; preload;}
2020-01-24 17:34:03.137 ERROR 6 --- [trics-publisher] i.m.dynatrace.DynatraceMeterRegistry     : failed to create custom metric custom:tomcat.sessions.alive.max in dynatrace: <no response body>
2020-01-24 17:34:03.099调试6---[trics publisher]s.n.www.protocol.http.HttpURLConnection:sun.net.www。MessageHeader@53ddc3e27成对:{PUT/e/b63c9b27-de7e-498b-8466-1987a7f6af7d/api/api/v1/timeseries/custom:tomcat.sessions.alive.max?api-token=xxx HTTP/1.1:null}{Content-Type:application/json}{User-Agent:Java/13.0.1}{Host:apm.cf.eu10.hana.ondemand.com}{Accept:text/html、image/gif、image/jpeg、*;q=.2、*/*;q=.2}{Connection:keep alive}{Content Length:116}
2020-01-24 17:34:03.137调试6---[trics publisher]s.n.www.protocol.http.HttpURLConnection:sun.net.www。MessageHeader@1e1eb5659对:{null:HTTP/1.1 405方法不允许}{内容安全策略:默认src'self''nonce-p+oZSPTiRzS6ULGJdzTL1g=='数据:;脚本src'self''unsafe eval'localhost:9876 127.0.0.1:9876 localhost:4200 127.0.0.1:4200https://static.woopra.com https://www.woopra.com/ https://app.intercom.io https://widget.intercom.io https://js.intercomcdn.com https://js-cdn.dynatracelabs.com “不安全的inline';对象src'self'nonce-p+oZSPTiRzS6ULGJdzTL1g==';样式src'self'unsafe inline'localhost:9876 127.0.0.1:9876 localhost:4200 127.0.0.1:4200;字体src'self'nonce-p+oZSPTiRzS6ULGJdzTL1g='localhost:9876 127.0.0.1:9876 localhost:4200 127.0.0.1:4200https://js.intercomcdn.com;img src“self”nonce-p+oZSPTiRzS6ULGJdzTL1g==”数据:localhost:9876 127.0.0.1:9876本地主机:4200 127.0.0.1:4200https://ruxit-synth-screencap-dev.s3.amazonaws.com https://ruxit-synth-screencap-sprint.s3.amazonaws.com https://ruxit-synth-screencap.s3.amazonaws.com https://js.intercomcdn.com 数据:https://static.intercomassets.com https://downloads.intercomcdn.com https://uploads.intercomusercontent.com https://gifs.intercommcdn.comhttps://dt-cdn.net https://dynatrace.asknice.ly;媒体src“self”nonce-p+oZSPTiRzS6ULGJdzTL1g=='https://js.intercomcdn.com;帧src“self”nonce-p+oZSPTiRzS6ULGJdzTL1g==“localhost:9876127.0.0.1:9876https://www.youtube.com https://fast.wistia.net https://share.intercom.io https://intercom-sheets.com https://player.vimeo.com;connect src'self''nonce-p+oZSPTiRzS6ULGJdzTL1g=='localhost:9876 127.0.0.1:9876 localhost:4200 127.0.0.1:4200wss://localhost:4200 wss://127.0.0.1:4200 https://api.segment.io https://trello.com/1/ https://api.intercom.io https://api-iam.intercom.io https://api-ping.intercom.io https://nexus-websocket-a.intercom.io https://nexus-websocket-b、 对讲机https://nexus-long-poller-a.intercom.io https://nexus-long-poller-b.intercom.io wss://nexus-websocket-a.intercom.io wss://nexus-websocket-b.intercom.io https://uploads.intercomcdn.com https://uploads.intercomusercontent.com https://js.intercomcdn.com;子src'self'blob:;工作者src'self'blob:;框架祖先'self';基uri'self';形成动作“自我”https://dynatrace.asknice.ly https://api-iam.intercom.io https://accounts.sap.com;report uri/reportCPSViolations}{Date:Fri,2020年1月24日17:34:03 GMT}{Frame Options:SAMEORIGIN}{Set Cookie:apmroute=6c416ea40448a6d5e825253d116a9479;Path=/;Secure;HttpOnly}{Set Cookie:apmsessionid=node035abqwwwf0bk41tgs7gg4yic5l897270.node0;Path=/;Secure;HttpOnly}{X-Vcap-Request-Id:31a4aa2b-38ca-44c5-5da3-fa60830be4da}{内容长度:0}{严格的传输安全性:最大年龄=31536000;包含子域;预加载;}
2020-01-24 17:34:03.137错误6---[trics publisher]i.m.dynatrace.DynatraceMeterRegistry:无法在dynatrace中创建自定义度量custom:tomcat.sessions.alive.max:
PUT请求返回错误:

405方法不允许

原则上,请求符合API文档 我看到的唯一区别是,API令牌是作为请求参数发送的,而不是按照文档的要求作为授权头发送的。
这是Dynatrace的MicroCenter适配器中的错误吗?

您的URL包含“/api/api/”,这可能是错误的,请尝试在URL中仅使用一个“api”。

谢谢!如果我删除其中一个“api”,度量的注册将通过。我从Cloud Foundry中的用户定义服务获取基本URL。此基本URL以“api”结尾。很明显,测微计适配器添加了另一个“api”。很难说哪一个是正确的,哪一个不是……这不是一个用户定义的服务,而是Cloud Foundry提供的服务,只是为了澄清一下