Skip to content

[DOCS] Connect via endpoint URL (fix Cloud ID mismatch) - #8901

Merged
charlotte-hoblik merged 5 commits into
mainfrom
charlotte-fix-cloudid-2431
May 8, 2026
Merged

charlotte-hoblik merged 5 commits into
mainfrom
charlotte-fix-cloudid-2431

Conversation

@charlotte-hoblik

Copy link
Copy Markdown
Contributor

Same direction as elastic/docs-content#5414: prefer the Elasticsearch endpoint URL in connection examples so steps match the Cloud UI, curl, and other client docs.

This addresses elastic/docs-content#2431 :

  • text pointed at the endpoint while the sample still used CLOUD_ID.
  • Connecting page now treats endpoint + API key as default and documents Cloud ID only as an optional path for hosted Elastic Cloud.

@github-actions

github-actions Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

✅ Vale Linting Results

No issues found on modified lines!


The Vale linter checks documentation changes against the Elastic Docs style guide.

To use Vale locally or report issues, refer to Elastic style guide for Vale.

@github-actions

github-actions Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

🔍 Preview links for changed docs

@swallez swallez left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment.

And a question that is probably more for @flobernd: there no mention of node sniffing in the node pool section. Should we add it, or is it documented elsewhere (and then should be linked here)?

Comment thread docs/reference/connecting.md Outdated

### Using a Cloud ID (Elastic Cloud hosted only) [cloud-id]

On hosted Elastic Cloud deployments you can alternatively pass the **Cloud ID** string from the deployment overview together with credentials. The client resolves the Cloud ID to cluster nodes and applies defaults suited to Elastic Cloud (including HTTPS and HTTP compression).

@swallez swallez Apr 29, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to cluster nodes should be to the deployment URL as all nodes are hidden behind Elastic Cloud's proxy.

We can also remove HTTP since it's HTTPS only. I would actually remove the entire (including ... compression) snippet as the goal of defaults is to simplify the user's life and not have them care about it!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The client resolves the Cloud ID to cluster nodes and applies defaults suited to Elastic Cloud (including HTTPS and HTTP compression)

This is actually not true 😅 These optimizations only get applied when using the Cloud ID (CloudNodePool in the client).

The above ElasticsearchClientSettings constructor overload using an url will resolve to the SingleNodePool - which does not apply any cloud specific parameters.

The urls are not a reliable inidicator (since custom domains are often used) and therefore not used to change the behavior. The .NET client requires the user to express explicit intent:

var pool = new CloudNodePool(new Uri("<ELASTICSEARCH_ENDPOINT>"), new ApiKey("<API_KEY>"));
var settings = new ElasticsearchClientSettings(pool);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The node sniffing implementations live in Elastic.Transport (elastic/elastic-transport-net) and I'm afraid this is only documented in code, since we still did not release a documentation for the transport library (which technicall is still in alpha (0.x version)).

The user has to express explicit intent here as well by using either SniffingNodePool or StickySniffingNodePool.

  ┌───────────────────────────────────────────┬─────┬───────────────────────────────────────────────────────────┬────────────┬───────────────────────────────────────────┐
  │ Pool                                      │ Pin │ Sniff (reseed)                                            │ MaxRetries │ Selection                                 │
  │                                           │ gs  │                                                           │            │                                           │
  ├───────────────────────────────────────────┼─────┼───────────────────────────────────────────────────────────┼────────────┼───────────────────────────────────────────┤
  │ SingleNodePool                            │ off │ off (Reseed no-op)                                        │ 0          │ the single node                           │
  │ CloudNodePool (extends SingleNodePool)    │ off │ off (Reseed no-op)                                        │ 0          │ the cloud endpoint                        │
  │ StaticNodePool                            │ on  │ off (Reseed no-op)                                        │ nodes.Coun │ round-robin via global cursor (with       │
  │                                           │     │                                                           │ t          │ dead/alive tracking)                      │
  │                                           │     │                                                           │ - 1        │                                           │
  │ SniffingNodePool (extends StaticNodePool) │ on  │ on (writes new node list under a ReaderWriterLockSlim)    │ nodes.Coun │ round-robin via global cursor over the    │
  │                                           │     │                                                           │ t          │ sniffed list                              │
  │                                           │     │                                                           │ - 1        │                                           │
  │ StickyNodePool (extends StaticNodePool,   │ on  │ off (Reseed overridden as no-op)                          │ nodes.Coun │ always starts at cursor 0, sticks to the  │
  │ sealed)                                   │     │                                                           │ t          │ first alive node                          │
  │                                           │     │                                                           │ - 1        │                                           │
  │ StickySniffingNodePool (extends           │ on  │ on (with optional Func<Node, float> nodeScorer; default   │ nodes.Coun │ always starts at cursor 0, sticks to the  │
  │ SniffingNodePool, sealed)                 │     │ scorer returns 0f)                                        │ t          │ first alive node                          │
  │                                           │     │                                                           │ - 1        │                                           │
  └───────────────────────────────────────────┴─────┴───────────────────────────────────────────────────────────┴────────────┴───────────────────────────────────────────┘

@flobernd flobernd added skip-backport This pull request should not be backported. and removed backport-9.2 backport-9.4 labels May 5, 2026
@flobernd

flobernd commented May 6, 2026

Copy link
Copy Markdown
Member

@charlotte-hoblik Hey 👋 are you going to iterate on this? Feel free to contact me, if anything needs clarification.

@charlotte-hoblik

charlotte-hoblik commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @swallez and @flobernd for the review and sorry for the slow follow-up on my side.

@flobernd especially: I really appreciate how much time you put into this. The pool behavior explanation and the sniffing context were a huge help. That kind of research makes the docs and the author better. Thank you.

I’ve updated connecting.md to reflect your feedback without turning the page into a transport deep-dive:

  • Cloud ID: copy now talks about the deployment endpoint behind Elastic Cloud’s proxy
  • Main cloud example: still endpoint URL + API key as the default path, aligned with the console and other clients.
  • Sniffing: a short pointer to Elastic.Transport / the elastic-transport-net repo so we answer @swallez’s question without dropping the whole pool matrix in.

If you’d rather keep CloudNodePool called out explicitly for advanced readers, I’m happy to add a single sentence.

Thanks again—please take another look when you can.

@charlotte-hoblik
charlotte-hoblik requested a review from flobernd May 7, 2026 10:59

@flobernd flobernd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Just one /nit 🙂

Comment thread docs/reference/connecting.md Outdated
Co-authored-by: Florian Bernd <git@flobernd.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

9.x Relates to a 9.x client version skip-backport This pull request should not be backported.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Website]: elasticsearch/clients/dotnet/getting-started

3 participants