Skip to content

Expose shard keys in telemetry - #5522

Merged
timvisee merged 4 commits into
devfrom
telemetry-shard-keys
Nov 27, 2024
Merged

timvisee merged 4 commits into
devfrom
telemetry-shard-keys

Conversation

@timvisee

@timvisee timvisee commented Nov 26, 2024 •

Copy link
Copy Markdown
Member

Expose shard keys for each shard in telemetry. This is necessary for resharding.

Rather than listing the key mapping, this lists the assigned key in each shard instead. I think that is a better interface to work with. Because of it I've copied the shard key into the replica set struct.

See "key": "test":

{
  "collections": {
    "number_of_collections": 1,
    "collections": [
      {
        "id": "benchmark",
        "init_time_ms": 800,
        "config": { ... },
        "shards": [
          {
            "id": 1,
            "key": "test",
            "local": { ... },
            "remote": [],
            "replicate_states": {
              "6469369128247073": "Active"
            }
          }
        ],
        "transfers": [],
        "resharding": []
      }
    ]
  }
}

All Submissions:

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you formatted your code locally using cargo +nightly fmt --all command prior to submission?
  3. Have you checked your code using cargo clippy --all --all-features command?

@timvisee
timvisee requested review from ffuugoo and generall November 26, 2024 10:47
@agourlay

Copy link
Copy Markdown
Member

This is necessary for resharding.

Does it mean the resharding process queries the telemetry endpoint?
What if telemetry is disabled?

@generall

Copy link
Copy Markdown
Member

What if telemetry is disabled?

we can't disable endpoint, only the data collection

@timvisee

Copy link
Copy Markdown
Member Author

This is necessary for resharding.

Does it mean the resharding process queries the telemetry endpoint? What if telemetry is disabled?

We discussed it in our daily, but for formality: CM already depends on telemetry as it fetches all the details about the peer/cluster state from it. It therefore makes sense the resharding key is exposed there as well. The alternative would be to make a separate request to cluster info along side it.

@timvisee
timvisee merged commit fe0a576 into dev Nov 27, 2024
@timvisee
timvisee deleted the telemetry-shard-keys branch November 27, 2024 13:57
coszio pushed a commit that referenced this pull request Dec 2, 2024
* Add shard key to replica set

* Expose shard key in replica set telemetry

* Update OpenAPI specification

* Fix two spelling errors
timvisee added a commit that referenced this pull request Dec 9, 2024
* Add shard key to replica set

* Expose shard key in replica set telemetry

* Update OpenAPI specification

* Fix two spelling errors
@timvisee timvisee mentioned this pull request Dec 9, 2024
@timvisee timvisee added this to the Resharding milestone Jan 14, 2025
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

Successfully merging this pull request may close these issues.

4 participants