Wrong endpoint configured for MonitoringClient.postMetricData()
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 243
- Forks
- 171
- Avg merge
- 30m
- Merged PRs (30d)
- 4
Description
In the OCI Java SDK (and also in the oci CLI tool), the incorrect endpoint for the Monitoring operation PostMetricData is configured. Therefore, I always get a 404 Not Found error when I call MonitoringClient.postMetricData().
I am using latest OCI Java SDK version com.oracle.oci.sdk:oci-java-sdk-monitoring:3.38.0.
Error returned by PostMetricData operation in Monitoring service.(404, NotAuthorizedOrNotFound, false) Authorization failed or requested resource not found. (opc-request-id: 06418A9859954B53BBCE490EC4CBF06A/30AFF4B43339BA03E6480142EEDEA340/E68006EF501653D8D58A0529E9F18718)
Timestamp: 2024-03-29T20:52:13.602Z
Client version: Oracle-JavaSDK/3.38.0
Request Endpoint: https://telemetry.eu-frankfurt-1.oraclecloud.com/20180401/metrics
Troubleshooting Tips: See https://docs.oracle.com/en-us/iaas/Content/API/References/apierrors.htm#apierrors_404__404_notauthorizedornotfound for more information about resolving this error
Also see https://docs.oracle.com/iaas/api/#/en/monitoring/20180401/MetricData/PostMetricData for details on this operation's requirements.
As described in the PostMetricData API docs, a different endpoint must be used for this specific operation.
Incorrect endpoint: https://telemetry.eu-frankfurt-1.oraclecloud.com
Correct endpoint: https://telemetry-ingestion.eu-frankfurt-1.oraclecloud.com
When I manually override the endpoint using MonitoringClient.setEndpoint(), it works without any issues.
I think the endpoint should be fixed both in the Java SDK and the oci CLI tool.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at MonitoringClient.postMetricData() and the endpoint configuration used for the Monitoring service; compare it with the PostMetricData API documentation and the working endpoint set through MonitoringClient.setEndpoint(). The issue is done when postMetricData() uses the telemetry-ingestion endpoint for the relevant region instead of the telemetry endpoint, with corresponding coverage if the repository provides it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100