Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elastic: snapshots (slm_stats) not working with OpenSearch #17935

Open
plumdog opened this issue Jun 26, 2024 · 0 comments
Open

Elastic: snapshots (slm_stats) not working with OpenSearch #17935

plumdog opened this issue Jun 26, 2024 · 0 comments

Comments

@plumdog
Copy link

plumdog commented Jun 26, 2024

When targeting OpenSearch and setting slm_stats: true, get an error like:

401 Client Error: Unauthorized for url: https://[myopensearch].es.amazonaws.com:443/_slm/policy"
Traceback (most recent call last):
  File "/opt/datadog-agent/embedded/lib/python3.11/site-packages/datadog_checks/base/checks/base.py", line 1224, in run
    self.check(instance)
  File "/opt/datadog-agent/embedded/lib/python3.11/site-packages/datadog_checks/elastic/elastic.py", line 175, in check
    policy_data = self._get_data(slm_url)
                  ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/datadog-agent/embedded/lib/python3.11/site-packages/datadog_checks/elastic/elastic.py", line 338, in _get_data
    resp.raise_for_status()
  File "/opt/datadog-agent/embedded/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://[myopensearch].es.amazonaws.com:443/_slm/policy

It looks like OpenSearch doesn't have the the _slm/policy API https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-policy.html but rather a _plugins/sm/policies API https://opensearch.org/docs/latest/tuning-your-cluster/availability-and-recovery/snapshots/sm-api/. It looks to me like these are logically similar, but OpenSearch doesn't provide the same stats values as Elasticsearch to provide the slm metrics.

However, there is the _snapshot/ API that both support (see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-snapshot-api.html and https://opensearch.org/docs/latest/api-reference/snapshots/get-snapshot/) that could be used to provide useful metrics, eg the number of snapshots for each index, the oldest and most recent snapshots for each index.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant