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

MSC2063: Add "server information" public API proposal #2063

Open
wants to merge 7 commits into
base: old_master
Choose a base branch
from

Conversation

grinapo
Copy link
Contributor

@grinapo grinapo commented May 31, 2019

@grinapo grinapo changed the title Add "server information" public API proposal MSC2063: Add "server information" public API proposal May 31, 2019
@turt2live turt2live added proposal A matrix spec change proposal proposal-in-review labels May 31, 2019
@grinapo
Copy link
Contributor Author

grinapo commented May 31, 2019

Mentioned in the text is #1929 .

@grinapo
Copy link
Contributor Author

grinapo commented May 31, 2019

Signed-off-by: Peter Gervai [email protected]

@Atreatis
Copy link

I support this change because we need it!

Copy link
Member

@KitsuneRal KitsuneRal left a comment

Choose a reason for hiding this comment

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

That's a good idea; but to become a real proposal it needs elaboration. At the very least, please address comments below.

proposals/2063-serverinfo.md Show resolved Hide resolved
proposals/2063-serverinfo.md Outdated Show resolved Hide resolved
proposals/2063-serverinfo.md Outdated Show resolved Hide resolved
proposals/2063-serverinfo.md Show resolved Hide resolved
grinapo and others added 2 commits June 3, 2019 11:45
Mention its existence but remove from the main body, these all shall be covered by pull#1929.

Also remove specifics from *server connectivity checking* which shall be covered by a separate proposal (as federation pin, traceroute, or else).
Copy link
Member

@KitsuneRal KitsuneRal left a comment

Choose a reason for hiding this comment

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

Nitpicking on one remaining thing, but otherwise this looks pretty good to me.

"server_data": {
"m.open_registrations": true,
"m.uptime": 63072000,
"m.registered_users": 4,
Copy link
Member

Choose a reason for hiding this comment

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

This is almost perfect; but it'd be probably better to further distinguish between statistics/status information (uptime and the number of users) and configuration/settings information (open registrations). I don't know if it's worth it to introduce a separate /server_config endpoint just for a single boolean value - probably overengineering here. It would be great to have other opinions on this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about

{
 "server_data": {
  "settings": {
    "m.open_registrations": true
  },
  "statistics" : {
    "m.uptime": 63072000,
    "m.registered_users": 4
  }
 }
}

Processing a json and ignoring unnecessary fields is probably painless enough that it doesn't justify creating any more complexity.

I guess someone shall come up with a real justification to separate them even this way though, or maybe it's good for "visibility" or "mental separation"?

Copy link
Member

Choose a reason for hiding this comment

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

I'd rather use two separate endpoints. The reason is that open registrations may (I can imagine that in theory at least) be configurable using some administration API. What I mean to say is that generally configuration is, at least in theory, read/write depending on your access credentials, while statistics are produced by the servers and cannot be tweaked even in theory. But probably let's validate it in the Matrix room.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should be pointed out that open_registrations is not something federation should care about. It should be reported by a client API.

Copy link
Member

Choose a reason for hiding this comment

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

tbh I think it's fine to expose health/metadata/metrics at the federation level for this, mostly because there's a discovery function that server lists can use to query the data.

@jaywink
Copy link
Member

jaywink commented Jul 20, 2019

Syncing here comment on MSC1929 regarding this, that MSC and ServerInfo.

{
"server_data": {
"m.open_registrations": true,
"m.uptime": 63072000,
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering what usefulness the uptime actually has? If it is small, it could be "they updated recently == good" or "they're in a crash loop doing constant OOM == bad". If it is big it could be either "it's stable" or "it's not being maintained". I don't know what would be better though, just wondering whether it is good to include numbers that don't really have any particular purpose. This feels more something that should live in the /metrics endpoint for prometheus.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

include numbers that don't really have any particular purpose.

If you do not need it doesn't mean nobody else does. I could describe how it's useful but really, I believe that "it is useful for some people" should be enough to justify.

This feels more something that should live in the /metrics endpoint for prometheus.

This is a public endpoint, in contrast to prometheus. The primary point is to provide data for automated public server lists.

Copy link
Member

Choose a reason for hiding this comment

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

tbh the first thing I'd disable is uptime: there's no metric that can be pulled from it which helps users with anything. How does uptime apply to a worker or multi-process homeserver for instance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How does uptime apply to a worker or multi-process homeserver for instance?

From the users viewpoint a service is "UP" when it's working. :-)
(As a user I would not pick a server with a constant less than a few days uptime, since it's either keep restarting or crashing, but that's me.)

But maybe you're right that it should be externally measured [icmp/api calls] instead of relying on the server.

@grinapo
Copy link
Contributor Author

grinapo commented Nov 13, 2019

The fediverse Aggregator site for example expects to display the following stats for nodes:

  • users at node (that is in the proposal)
  • active users in timeframe (last month and 6 months are in the stats)
  • local posts / comments (this is probably irrelevant for an e.consistent network, and may leak unwanted data about local-only rooms - or maybe the opposite: would show which homeservers have a very active local community)

@turt2live turt2live added the kind:feature MSC for not-core and not-maintenance stuff label Apr 20, 2020
@turt2live turt2live added the needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. label Jun 8, 2021
@richvdh
Copy link
Member

richvdh commented Feb 14, 2022

@grinapo it looks like you've accidentally merged the wrong branch:

image

See also #3367

@turt2live
Copy link
Member

@grinapo you'll need to hard reset to before the merge - a revert isn't going to work.

If you need help, visit #matrix-spec:matrix.org and we can figure it out there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:feature MSC for not-core and not-maintenance stuff needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. proposal A matrix spec change proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants