0

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.

enter image description here

My Elastic Cloud has these three applications running.

enter image description here

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)

enter image description here

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.

enter image description here

Jin Lee
  • 3,194
  • 12
  • 46
  • 86

2 Answers2

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.

  • thank you for your answer. My grafana is hosted on a regular server. Elasticsearch is on AWS cloud. In that case, Do I put url of my Elasticsearch and server mode(access) as above? I think I don't need to type my grafana url there. (I am accessing grafana from web browser.) I'm a bit confused. – Jin Lee Apr 19 '19 at 05:42
  • Using the endpoint url is a common way to access services in Cloud? – Jin Lee Apr 19 '19 at 06:32
  • 1
    yes @JinLee . AWS provide only Endpoint. If you are using Grafana in network where ES endpoint is accessible then using browser as datasource is good option. but if you are planning to expose grafana to internet then you should use ES endpoint as server and make sure on machine where grafana is running it can access ES endpoint ( You may try using curl to check ) and if you are able to access via curl on grafana server you should be able to access ES in server mode. – Gaurav Wadhone Apr 19 '19 at 06:45
1

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'

enter image description here

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.

enter image description here

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.

enter image description here

enter image description here

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!!

enter image description here

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

Jin Lee
  • 3,194
  • 12
  • 46
  • 86