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

cephadm,servicemap: fix rbd-mirror, cephfs-mirror, rgw servicemap identification; adjust servicemap reporting #40220

Merged
merged 4 commits into from
Mar 20, 2021

Conversation

liewegas
Copy link
Member

@liewegas liewegas commented Mar 18, 2021

  • make cephfs-mirror and rgw do what rbd-mirror does: register under a gid, and include an id key with their auth id/name
  • fix rbd-mirror deployment
  • adjust cephadm to identify daemons registering under gid (look for their id key, if present)
  • change the ceph -s summary code to count total daemons and groupings (distinct hosts, zones)
  services:
    mon:           1 daemons, quorum a (age 15s)
    mgr:           x(active, since 92s)
    osd:           1 osds: 1 up (since 71s), 1 in (since 88s)
    cephfs-mirror: 1 daemon active (1 hosts)
    rbd-mirror:    2 daemons active (1 hosts)
    rgw:           2 daemons active (1 hosts, 1 zones)

@github-actions github-actions bot added the cephfs Ceph File System label Mar 18, 2021
@liewegas liewegas changed the title <!-- Thank you for opening a pull request! Here are some tips on creating a well formatted contribution. cephfs-mirror: register using auth name in service map Mar 18, 2021
@liewegas liewegas requested a review from vshankar March 18, 2021 16:57
src/tools/cephfs_mirror/ServiceDaemon.cc Outdated Show resolved Hide resolved
Broken by 8fa941b

Signed-off-by: Sage Weil <sage@newdream.net>
@liewegas liewegas requested a review from a team as a code owner March 18, 2021 21:27
@liewegas liewegas changed the title cephfs-mirror: register using auth name in service map cephadm: fix rbd-mirror, cephfs-mirror Mar 18, 2021
@vshankar
Copy link
Contributor

cephadm/module.py:30: note: In module imported here,
cephadm/__init__.py:1: note: ... from here:
cephadm/serve.py: note: In member "_check_for_strays" of class "CephadmServe":
cephadm/serve.py:414: error: Argument 1 to "get_metadata" of "MgrModule" has incompatible type "Optional[str]"; expected "str"
Found 1 error in 1 file (checked 27 source files)

Registering by gid allows multiple radosgw instances to share an auth
key/identity.  Including the id in the metadata allows them to still be
identified by name (even if not uniquely).

Signed-off-by: Sage Weil <sage@newdream.net>
@liewegas liewegas changed the title cephadm: fix rbd-mirror, cephfs-mirror cephadm,servicemap: fix rbd-mirror, cephfs-mirror, rgw servicemap identification; adjust servicemap reporting Mar 19, 2021
@liewegas liewegas requested a review from vshankar March 19, 2021 15:48
- Do not list individual daemon ids as this won't scale for larger
  clusters
- Do not contemplate multile daemons of the same type that register with
  different "daemon_type" -- not until we actually have any that do that.
- Present counts by various groupings: distinct hosts and rgw zones to
  start.

  services:
    mon:           1 daemons, quorum a (age 4m)
    mgr:           x(active, since 3m)
    osd:           1 osds: 1 up (since 3m), 1 in (since 3m)
    cephfs-mirror: 1 daemon active (1 hosts)
    rbd-mirror:    2 daemons active (1 hosts)
    rgw:           2 daemons active (1 hosts, 1 zones)

Signed-off-by: Sage Weil <sage@newdream.net>
Like rbd-mirror, cephfs-mirror and rgw daemons register under their gid.

Signed-off-by: Sage Weil <sage@newdream.net>
@liewegas
Copy link
Member Author

@lxbsz Is there a case where the same type of daemon will register with different daemon_type values and need to be grouped separately? The change you made for iscsi allowed for this, but I'm wondering if it's needed?

@liewegas liewegas dismissed vshankar’s stale review March 19, 2021 20:50

dropped the ceph-fsmirror change :)

@lxbsz
Copy link
Member

lxbsz commented Mar 20, 2021

@lxbsz Is there a case where the same type of daemon will register with different daemon_type values and need to be grouped separately? The change you made for iscsi allowed for this, but I'm wondering if it's needed?

No, iscsi won't allow it. Before I was thinking should we consider the case that with 3 iscsi gateways, one still using the old version ?

@liewegas liewegas deleted the cephfs-mirror-servicemap branch March 23, 2021 13:46
@liewegas
Copy link
Member Author

@liewegas I think cephfs was missed in the change. Was it intentional?

rbd-mirror and cephfs-mirror were already doing the right thing (registering using the gid as the key).

steveftaylor pushed a commit to steveftaylor/ceph that referenced this pull request Mar 23, 2021
…unning.

- Adapted code to changes introduced in: ceph#40220
- Improved error handling.
- Increased test coverage.
- Some refactoring.
- Simplified documentation about setting default daemon host and port.

Fixes: https://tracker.ceph.com/issues/49655
Signed-off-by: Alfonso Martínez <almartin@redhat.com>
BenoitKnecht added a commit to BenoitKnecht/ceph that referenced this pull request Oct 28, 2021
The `DaemonStateCollection` used to always contain the daemon name in its
`DaemonKey`, but since ceph#40220 (or more specifically
afc3375), the RadosGW registers with its
instance ID instead (`rados.get_instance_id()`).

As a result, the `ceph_rgw_*` metrics returned by `ceph-mgr` through the
`prometheus` module have their `ceph_daemon` label include that ID instead of
the daemon name, e.g.

```
ceph_rgw_req{ceph_daemon="rgw.127202"}
```

instead of

```
ceph_rgw_req{ceph_daemon="rgw.my-hostname.rgw0"}
```

This commit ensures that we get the daemon name from `state->metadata["id"]` if
available, and otherwise use `key.name` like before. It restores the correct
`ceph_daemon` label for RadosGW, and doesn't change anything for the other
daemons.

Fixes: https://tracker.ceph.com/issues/51120
Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
BenoitKnecht added a commit to BenoitKnecht/ceph that referenced this pull request Nov 12, 2021
The `DaemonStateCollection` used to always contain the daemon name in its
`DaemonKey`, but since ceph#40220 (or more specifically
afc3375), the RadosGW registers with its
instance ID instead (`rados.get_instance_id()`).

As a result, the `ceph_rgw_*` metrics returned by `ceph-mgr` through the
`prometheus` module have their `ceph_daemon` label include that ID instead of
the daemon name, e.g.

```
ceph_rgw_req{ceph_daemon="rgw.127202"}
```

instead of

```
ceph_rgw_req{ceph_daemon="rgw.my-hostname.rgw0"}
```

This commit adds the daemon name from `state->metadata["id"]` if available, as
`service.name` in the JSON document returned by `dump_server()`.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
BenoitKnecht added a commit to BenoitKnecht/ceph that referenced this pull request Nov 12, 2021
In order to get the `ceph_daemon` label for `rgw` metrics corresponding to the
value before ceph#40220, we need to add the `instance_id` label to the
`ceph_rgw_metadata` metric.

This way, the old `ceph_daemon` label can be added to any `ceph_rgw_*` metric
using the following PromQL query, for instance:

```
ceph_rgw_req * on (instance_id) group_left(ceph_daemon) ceph_rgw_metadata
```

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
BenoitKnecht added a commit to BenoitKnecht/ceph that referenced this pull request Nov 12, 2021
The `DaemonStateCollection` used to always contain the daemon name in its
`DaemonKey`, but since ceph#40220 (or more specifically
afc3375), the RadosGW registers with its
instance ID instead (`rados.get_instance_id()`).

As a result, the `ceph_rgw_*` metrics returned by `ceph-mgr` through the
`prometheus` module have their `ceph_daemon` label include that ID instead of
the daemon name, e.g.

```
ceph_rgw_req{ceph_daemon="rgw.127202"}
```

instead of

```
ceph_rgw_req{ceph_daemon="rgw.my-hostname.rgw0"}
```

This commit adds the daemon name from `state->metadata["id"]` if available, as
`service.name` in the JSON document returned by `dump_server()`.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
BenoitKnecht added a commit to BenoitKnecht/ceph that referenced this pull request Nov 12, 2021
In order to get the `ceph_daemon` label for `rgw` metrics corresponding to the
value before ceph#40220, we need to add the `instance_id` label to the
`ceph_rgw_metadata` metric.

This way, the old `ceph_daemon` label can be added to any `ceph_rgw_*` metric
using the following PromQL query, for instance:

```
ceph_rgw_req * on (instance_id) group_left(ceph_daemon) ceph_rgw_metadata
```

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
BenoitKnecht added a commit to BenoitKnecht/ceph that referenced this pull request Jan 3, 2022
The `DaemonStateCollection` used to always contain the daemon name in its
`DaemonKey`, but since ceph#40220 (or more specifically
afc3375), the RadosGW registers with its
instance ID instead (`rados.get_instance_id()`).

As a result, the `ceph_rgw_*` metrics returned by `ceph-mgr` through the
`prometheus` module have their `ceph_daemon` label include that ID instead of
the daemon name, e.g.

```
ceph_rgw_req{ceph_daemon="rgw.127202"}
```

instead of

```
ceph_rgw_req{ceph_daemon="rgw.my-hostname.rgw0"}
```

This commit adds the daemon name from `state->metadata["id"]` if available, as
`service.name` in the JSON document returned by `dump_server()`.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
BenoitKnecht added a commit to BenoitKnecht/ceph that referenced this pull request Jan 3, 2022
In order to get the `ceph_daemon` label for `rgw` metrics corresponding to the
value before ceph#40220, we need to add the `instance_id` label to the
`ceph_rgw_metadata` metric.

This way, the old `ceph_daemon` label can be added to any `ceph_rgw_*` metric
using the following PromQL query, for instance:

```
ceph_rgw_req * on (instance_id) group_left(ceph_daemon) ceph_rgw_metadata
```

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
BenoitKnecht added a commit to BenoitKnecht/ceph that referenced this pull request Jan 4, 2022
The `DaemonStateCollection` used to always contain the daemon name in its
`DaemonKey`, but since ceph#40220 (or more specifically
afc3375), the RadosGW registers with its
instance ID instead (`rados.get_instance_id()`).

As a result, the `ceph_rgw_*` metrics returned by `ceph-mgr` through the
`prometheus` module have their `ceph_daemon` label include that ID instead of
the daemon name, e.g.

```
ceph_rgw_req{ceph_daemon="rgw.127202"}
```

instead of

```
ceph_rgw_req{ceph_daemon="rgw.my-hostname.rgw0"}
```

This commit adds the daemon name from `state->metadata["id"]` if available, as
`service.name` in the JSON document returned by `dump_server()`.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
BenoitKnecht added a commit to BenoitKnecht/ceph that referenced this pull request Jan 4, 2022
In order to get the `ceph_daemon` label for `rgw` metrics corresponding to the
value before ceph#40220, we need to add the `instance_id` label to the
`ceph_rgw_metadata` metric.

This way, the old `ceph_daemon` label can be added to any `ceph_rgw_*` metric
using the following PromQL query, for instance:

```
ceph_rgw_req * on (instance_id) group_left(ceph_daemon) ceph_rgw_metadata
```

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
BenoitKnecht added a commit to BenoitKnecht/ceph that referenced this pull request Jan 11, 2022
The `DaemonStateCollection` used to always contain the daemon name in its
`DaemonKey`, but since ceph#40220 (or more specifically
afc3375), the RadosGW registers with its
instance ID instead (`rados.get_instance_id()`).

As a result, the `ceph_rgw_*` metrics returned by `ceph-mgr` through the
`prometheus` module have their `ceph_daemon` label include that ID instead of
the daemon name, e.g.

```
ceph_rgw_req{ceph_daemon="rgw.127202"}
```

instead of

```
ceph_rgw_req{ceph_daemon="rgw.my-hostname.rgw0"}
```

This commit adds the daemon name from `state->metadata["id"]` if available, as
`service.name` in the JSON document returned by `dump_server()`.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
BenoitKnecht added a commit to BenoitKnecht/ceph that referenced this pull request Jan 11, 2022
In order to get the `ceph_daemon` label for `rgw` metrics corresponding to the
value before ceph#40220, we need to add the `instance_id` label to the
`ceph_rgw_metadata` metric.

This way, the old `ceph_daemon` label can be added to any `ceph_rgw_*` metric
using the following PromQL query, for instance:

```
ceph_rgw_req * on (instance_id) group_left(ceph_daemon) ceph_rgw_metadata
```

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
epuertat pushed a commit to rhcs-dashboard/ceph that referenced this pull request Feb 4, 2022
The `DaemonStateCollection` used to always contain the daemon name in its
`DaemonKey`, but since ceph#40220 (or more specifically
afc3375), the RadosGW registers with its
instance ID instead (`rados.get_instance_id()`).

As a result, the `ceph_rgw_*` metrics returned by `ceph-mgr` through the
`prometheus` module have their `ceph_daemon` label include that ID instead of
the daemon name, e.g.

```
ceph_rgw_req{ceph_daemon="rgw.127202"}
```

instead of

```
ceph_rgw_req{ceph_daemon="rgw.my-hostname.rgw0"}
```

This commit adds the daemon name from `state->metadata["id"]` if available, as
`service.name` in the JSON document returned by `dump_server()`.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
(cherry picked from commit 2db1aaa)
epuertat pushed a commit to rhcs-dashboard/ceph that referenced this pull request Feb 4, 2022
In order to get the `ceph_daemon` label for `rgw` metrics corresponding to the
value before ceph#40220, we need to add the `instance_id` label to the
`ceph_rgw_metadata` metric.

This way, the old `ceph_daemon` label can be added to any `ceph_rgw_*` metric
using the following PromQL query, for instance:

```
ceph_rgw_req * on (instance_id) group_left(ceph_daemon) ceph_rgw_metadata
```

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
(cherry picked from commit 01b42c1)
epuertat pushed a commit to rhcs-dashboard/ceph that referenced this pull request Feb 9, 2022
The `DaemonStateCollection` used to always contain the daemon name in its
`DaemonKey`, but since ceph#40220 (or more specifically
afc3375), the RadosGW registers with its
instance ID instead (`rados.get_instance_id()`).

As a result, the `ceph_rgw_*` metrics returned by `ceph-mgr` through the
`prometheus` module have their `ceph_daemon` label include that ID instead of
the daemon name, e.g.

```
ceph_rgw_req{ceph_daemon="rgw.127202"}
```

instead of

```
ceph_rgw_req{ceph_daemon="rgw.my-hostname.rgw0"}
```

This commit adds the daemon name from `state->metadata["id"]` if available, as
`service.name` in the JSON document returned by `dump_server()`.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
(cherry picked from commit 2db1aaa)
epuertat pushed a commit to rhcs-dashboard/ceph that referenced this pull request Feb 9, 2022
In order to get the `ceph_daemon` label for `rgw` metrics corresponding to the
value before ceph#40220, we need to add the `instance_id` label to the
`ceph_rgw_metadata` metric.

This way, the old `ceph_daemon` label can be added to any `ceph_rgw_*` metric
using the following PromQL query, for instance:

```
ceph_rgw_req * on (instance_id) group_left(ceph_daemon) ceph_rgw_metadata
```

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
(cherry picked from commit 01b42c1)
epuertat pushed a commit that referenced this pull request Mar 22, 2022
The `DaemonStateCollection` used to always contain the daemon name in its
`DaemonKey`, but since #40220 (or more specifically
afc3375), the RadosGW registers with its
instance ID instead (`rados.get_instance_id()`).

As a result, the `ceph_rgw_*` metrics returned by `ceph-mgr` through the
`prometheus` module have their `ceph_daemon` label include that ID instead of
the daemon name, e.g.

```
ceph_rgw_req{ceph_daemon="rgw.127202"}
```

instead of

```
ceph_rgw_req{ceph_daemon="rgw.my-hostname.rgw0"}
```

This commit adds the daemon name from `state->metadata["id"]` if available, as
`service.name` in the JSON document returned by `dump_server()`.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
(cherry picked from commit 2db1aaa)
epuertat pushed a commit that referenced this pull request Mar 22, 2022
In order to get the `ceph_daemon` label for `rgw` metrics corresponding to the
value before #40220, we need to add the `instance_id` label to the
`ceph_rgw_metadata` metric.

This way, the old `ceph_daemon` label can be added to any `ceph_rgw_*` metric
using the following PromQL query, for instance:

```
ceph_rgw_req * on (instance_id) group_left(ceph_daemon) ceph_rgw_metadata
```

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
(cherry picked from commit 01b42c1)
zalsader pushed a commit to zalsader/ceph that referenced this pull request Apr 11, 2022
The `DaemonStateCollection` used to always contain the daemon name in its
`DaemonKey`, but since ceph#40220 (or more specifically
afc3375), the RadosGW registers with its
instance ID instead (`rados.get_instance_id()`).

As a result, the `ceph_rgw_*` metrics returned by `ceph-mgr` through the
`prometheus` module have their `ceph_daemon` label include that ID instead of
the daemon name, e.g.

```
ceph_rgw_req{ceph_daemon="rgw.127202"}
```

instead of

```
ceph_rgw_req{ceph_daemon="rgw.my-hostname.rgw0"}
```

This commit adds the daemon name from `state->metadata["id"]` if available, as
`service.name` in the JSON document returned by `dump_server()`.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
zalsader pushed a commit to zalsader/ceph that referenced this pull request Apr 11, 2022
In order to get the `ceph_daemon` label for `rgw` metrics corresponding to the
value before ceph#40220, we need to add the `instance_id` label to the
`ceph_rgw_metadata` metric.

This way, the old `ceph_daemon` label can be added to any `ceph_rgw_*` metric
using the following PromQL query, for instance:

```
ceph_rgw_req * on (instance_id) group_left(ceph_daemon) ceph_rgw_metadata
```

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
mchangir pushed a commit to mchangir/ceph that referenced this pull request Apr 13, 2022
The `DaemonStateCollection` used to always contain the daemon name in its
`DaemonKey`, but since ceph#40220 (or more specifically
afc3375), the RadosGW registers with its
instance ID instead (`rados.get_instance_id()`).

As a result, the `ceph_rgw_*` metrics returned by `ceph-mgr` through the
`prometheus` module have their `ceph_daemon` label include that ID instead of
the daemon name, e.g.

```
ceph_rgw_req{ceph_daemon="rgw.127202"}
```

instead of

```
ceph_rgw_req{ceph_daemon="rgw.my-hostname.rgw0"}
```

This commit adds the daemon name from `state->metadata["id"]` if available, as
`service.name` in the JSON document returned by `dump_server()`.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
(cherry picked from commit 2db1aaa)
mchangir pushed a commit to mchangir/ceph that referenced this pull request Apr 13, 2022
In order to get the `ceph_daemon` label for `rgw` metrics corresponding to the
value before ceph#40220, we need to add the `instance_id` label to the
`ceph_rgw_metadata` metric.

This way, the old `ceph_daemon` label can be added to any `ceph_rgw_*` metric
using the following PromQL query, for instance:

```
ceph_rgw_req * on (instance_id) group_left(ceph_daemon) ceph_rgw_metadata
```

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
(cherry picked from commit 01b42c1)
dpaganel pushed a commit to dpaganel/ceph that referenced this pull request May 17, 2022
The `DaemonStateCollection` used to always contain the daemon name in its
`DaemonKey`, but since ceph#40220 (or more specifically
afc3375), the RadosGW registers with its
instance ID instead (`rados.get_instance_id()`).

As a result, the `ceph_rgw_*` metrics returned by `ceph-mgr` through the
`prometheus` module have their `ceph_daemon` label include that ID instead of
the daemon name, e.g.

```
ceph_rgw_req{ceph_daemon="rgw.127202"}
```

instead of

```
ceph_rgw_req{ceph_daemon="rgw.my-hostname.rgw0"}
```

This commit adds the daemon name from `state->metadata["id"]` if available, as
`service.name` in the JSON document returned by `dump_server()`.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
dpaganel pushed a commit to dpaganel/ceph that referenced this pull request May 17, 2022
In order to get the `ceph_daemon` label for `rgw` metrics corresponding to the
value before ceph#40220, we need to add the `instance_id` label to the
`ceph_rgw_metadata` metric.

This way, the old `ceph_daemon` label can be added to any `ceph_rgw_*` metric
using the following PromQL query, for instance:

```
ceph_rgw_req * on (instance_id) group_left(ceph_daemon) ceph_rgw_metadata
```

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
NitzanMordhai pushed a commit to NitzanMordhai/ceph that referenced this pull request Nov 19, 2023
The `DaemonStateCollection` used to always contain the daemon name in its
`DaemonKey`, but since ceph#40220 (or more specifically
afc3375), the RadosGW registers with its
instance ID instead (`rados.get_instance_id()`).

As a result, the `ceph_rgw_*` metrics returned by `ceph-mgr` through the
`prometheus` module have their `ceph_daemon` label include that ID instead of
the daemon name, e.g.

```
ceph_rgw_req{ceph_daemon="rgw.127202"}
```

instead of

```
ceph_rgw_req{ceph_daemon="rgw.my-hostname.rgw0"}
```

This commit adds the daemon name from `state->metadata["id"]` if available, as
`service.name` in the JSON document returned by `dump_server()`.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
(cherry picked from commit 2db1aaa)
NitzanMordhai pushed a commit to NitzanMordhai/ceph that referenced this pull request Nov 19, 2023
In order to get the `ceph_daemon` label for `rgw` metrics corresponding to the
value before ceph#40220, we need to add the `instance_id` label to the
`ceph_rgw_metadata` metric.

This way, the old `ceph_daemon` label can be added to any `ceph_rgw_*` metric
using the following PromQL query, for instance:

```
ceph_rgw_req * on (instance_id) group_left(ceph_daemon) ceph_rgw_metadata
```

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
(cherry picked from commit 01b42c1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants