oracle / oracle/oci-java-sdk

Wrong endpoint configured for MonitoringClient.postMetricData()

Open
#585 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Monitoring
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.