weblogic-monitoring-exporter
weblogic-monitoring-exporter copied to clipboard
/wls-exporter/metrics returns 404 'search' was not found
Hi,
I am using get2.0.sh and a sample config file for creating wls-exporter.war file. Weblogic version is 14.1.1.0.0 deployed in azure kubernetes cluster with amazonlinux:2.0.20211223.0 as base container. The exporter is deployed on the admin server with port 8000.
I can see the initial page /wls-exporter correctly , but when I try to access /wls-exporter/metrics from the initial landing page I get following error in browser:
Received status 404 - { "status": 404, "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1", "title": "FAILURE", "detail": "'search' was not found." }
Let me know if you need further details.
I would appriciate any help in this regard.
Regards, Swapnil
There are a few possibilities.
- You could be using a service mesh that is restricting access to the WLS REST API
- You could be using a DNS name that is known to your client by inaccessible to your WLS instance
Try this: open a shell in the pod that is running your WLS instance and try the following
curl --user <username>:<password> --insecure -d '{"links":[], "fields":[]}' \
-H "Content-Type: application/json" \
-H "X-Requested-By: exporter" \
-X POST http://<host>:<wls-port>/management/weblogic/latest/serverRuntime/search
specifying your actual values for <username>, <password>, <host> and <wls-port>. If that works, you're able to get to the WLS API and we could look for other possibilities.
Hi,
We are not using service mesh in our cluster.
I ran above curl command from inside my pod, but same result '404 search was not found'.
Interestingly I get result from /management/weblogic/latest/serverRuntime. So result is the JSON something like below { "links": [ { "rel": "parent", "href": "http://host:port/management/weblogic/latest" }, { "rel": "self", "href": "http://host:port/management/weblogic/latest/serverRuntime" },
And there are bunch of other results, but it doesn't contain any search endpoint.
OK, the problem is clearly not the exporter, then, if you cannot access the search endpoint.
How are your WLS ports configured? plain, SSL or admin? Only one of those will have the search endpoint, and that is where you need to deploy.
I can see both listen port amd ssl listen port enabled from console. But I can't access anything from ssl port.
When you say that you cannot access anything from the SSL port, what did you try to access? Which is port 8000?
The general rule AFAIK is that the query API is only accessible from the most privileged port enabled. If the SSL port is enabled, you cannot access it from the plaintext port, and if the admin port is enabled, you cannot access it from the SSL port.
In my case, port 8000 is plain http port and 8002 is ssl port of our admin server. I can see both ports enabled. But whatever I access from 8000 port I can't access that from 8002, not even admin console.
But I was wondering if I am able to access /management/weblogic/latest/serverRuntime endpoint from 8000, why not 'search' then from same port?
This is a WLS behavior - the search functionality is considered to be part of administration functionality, and is only accessible on the port used for administration. If the cluster-wide administration port is enabled, that is the one you have to use. If not, the SSL port, if any, is used. The plain port can only access the search function if the other ports are not enabled. If you have the SSL port enabled, that is where you need to deploy the exporter.
My admin port is not enabled at all. Even if I disable ssl port from admin console, I can't access 'search' from plain port. If I disable ssl port, 'search' should have been available on plain port?
Yes, if SSL is disabled, search is supposed to be available on plain port. If it's not, do you have a WLS support contact that you can ask? They might be able to recognize some other configuration problem in your setup.
Thanks for your support so far. I will raise a ticket with WLS support