How to specify a URL in Grafana for DB applications(Elasticsearch) on Cloud

坚强是说给别人听的谎言 提交于 2019-12-25 01:53:52

问题


I'm trying to use Elastic Cloud(Elasticsearch) as data source in Grafana. In the below, I'm trying to type a url for that Elastic server(service) in the cloud.

My Elastic Cloud has these three applications running.

I tried copying endpoint URL in Grafana. And It doesn't seem to work. so I'm trying to figure out the reason. If my way of putting url is correct, I can move on to suspect other reasons. When I I copy the endpoint and test it on the browser, I get the following result. (seems to work fine on the browser)

Could anyone give me tips on what to put in the URL section of Grafana? Or how to access services in Cloud by url?

additional information: My grafana is not on Cloud. Grafana server is on a regular server. I'm accessing Grafana using below url.


回答1:


While running data source as browser mode all request from browser directly goes to data source

But while choosing server mode request goes from browser to grafana backend (Server node where grafana is installed ) and from there it redirect to data source.

If you are using server mode then make sure if you are able to access AWS ES url from machine where Grafana is hosted.




回答2:


I had to do so many tests to figure this out.

The reason why I got so confused and stuck was because of this message. 'No date field named timestamp found'

I thought it was because I didn't put the right url at first. I changed access mode to browser, too. I opened my dev cosole, and found 'blocked by CORS policy' error. I thought that was the problem, so I spent another hour trying to figure this out. ( setting up Chrome extension for Cors, tried using proxy site, etc) However, you don't need to solve CORS policy problem because you don't need 'browser' mode in this case.

'No date filed _______ found' message is a bug. Just ignore it. It works fine.

I'll post how I did it here just in case.

I have a field called 'timestamp', so just used it. No need to do @timestamp.

If your grafana server is local. ( I mean if you are accessing like `localhost:3000' ) you don't need Basic Auth! I tested it myself. ( I tested with local elasticsearch server and local grafana server) (I tested with local grafana server with cloud elasticsearch server) ( I finally tested with cloud elasticsearch server and grafana server remote) In all cases, I got the 'No data field named ____ found' messeges. It's a bug~!!!! So don't worry.

Back to my original question, 'How to specify a url for applications on Cloud'

Copy the endpoint URL of your application (elasticsearch, in this case) on your Cloud, and just paste it!!

I will not accept my answer, but leave this here so this can help other people.



来源:https://stackoverflow.com/questions/55755609/how-to-specify-a-url-in-grafana-for-db-applicationselasticsearch-on-cloud

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!