rework bstats to use metrics base#6882
Conversation
93f8fc5 to
1940342
Compare
{
"playerAmount": 0,
"onlineMode": 1,
"bukkitVersion": "git-Paper-\"93f8fc5\" (MC: 1.17.1)",
"bukkitName": "Paper",
"javaVersion": "16",
"osName": "Windows 10",
"osArch": "amd64",
"osVersion": "10.0",
"coreCount": 24,
"service": {
"id": 580,
"customCharts": [
{
"chartId": "minecraft_version",
"data": {
"value": "1.17.1"
}
},
{
"chartId": "legacy_plugins",
"data": {
"values": {
"0 ?": {
"0": 1
}
}
}
},
{
"chartId": "online_mode",
"data": {
"value": "online"
}
},
{
"chartId": "paper_version",
"data": {
"value": "git-Paper-\"93f8fc5\""
}
},
{
"chartId": "java_version",
"data": {
"values": {
"Java 16": {
"16": 1
}
}
}
}
]
},
"serverUUID": "c6aa11bc-2f20-46de-8808-4cb98dce6518",
"metricsVersion": "2.2.1"
} |
"chartId": "legacy_plugins",
"data": {
"values": {
"0 ?": {
"0": 1
}
}
}is 😎 being properly encoded here, since it's showing up as a question mark? |
1940342 to
dc3b8be
Compare
|
mmh, idk, I wanna blame the logging (edit: yeah, internally its fine) also gotta relocate stuff, idk why I did to choose to ignore the relocate check, lmao |
dc3b8be to
0026e52
Compare
|
ok, should be good to go now, ideally @Bastian can take a look, that would be very much appreciated, especially if this is right, because we didn't do that before https://github.com/PaperMC/Paper/blob/rework-bstats/patches/server/0008-Paper-Metrics.patch#L190-L193 |
|
Sending this extra data has zero effect and are just ignored by bStats. |
| + public Metrics() { | ||
| + File bStatsFolder = new File((File) MinecraftServer.getServer().options.valueOf("plugins"), "bStats"); | ||
| + File configFile = new File(bStatsFolder, "config.yml"); | ||
| + MetricsConfig config; |
There was a problem hiding this comment.
Unfortunately, you cannot use the MetricsConfig. You still have to create and parse the config file yourself.
The MetricsConfig is not a YAML file but uses its own format that looks like this and is not compatible with the existing config files:
# bStats (https://bStats.org) collects some basic information for plugin authors, like
# how many people use their plugin and their total player count. It's recommended to keep
# bStats enabled, but if you're not comfortable with this, you can turn this setting off.
# There is no performance penalty associated with having metrics enabled, and data sent to
# bStats is fully anonymous.");
enabled=true
server-uuid=<UUID>
log-errors=false
log-sent-data=false
log-response-status-text=false
(see source: MetricsConfig.java)
This config is only intended for new platforms and cannot be used by Paper for legacy reasons.
For the config, you should use the Bukkit Metrics class as a reference: Metrics.java#L39-L64
There was a problem hiding this comment.
ahh, seeing that bukkit didn't use it confused me, that makes sense.
alternatively we could migrate existing files? ah no, cause other plugins, meh. ok, will fix later
|
Wait you guys keep bstats and metrics enabled? |
bStats is opt-out on any platform except Sponge. |
bstats always has been and always will be enabled by default on paper, but you can easily disable it before it first sends data. This PR will even make it send a headsup message on first start metrics on bstats are extremly valuable to us, it's how we decide which java/mc versions to support for example, or see how quickly new (paper/mc/java) versions are addapted. It's also valuable to get an estimate on market share. They are also fully anonymous, don't disclose any personal data, and will not create any lag (obviously, lol), so there is no reason to disable them, ever, altho we do respect that choice if you wanna make that (altho we wouldn't understand it). (side-note, if you are concerned about this, go audit all your plugins, the plugins that don't use bstats for usage stats often collect intrusive information like server name, server IP, plugin names etc, those we would never allow happening to our users) |
0026e52 to
47c40c7
Compare
Bastian
left a comment
There was a problem hiding this comment.
Looks good to me.
If you didn't already, I would recommend you to build it once and enable the logSentData and logResponseStatusText just to be sure that the correct data is sent and the bStats backend accepts it.
thanks for taking a look! |
47c40c7 to
fa64402
Compare
|
somebody with more knowledge about bundler and stuff needs to figure out relocation and shadow here please |
| relocate("org.bukkit.craftbukkit" to "org.bukkit.craftbukkit.v$packageVersion") { | ||
| exclude("org.bukkit.craftbukkit.Main*") | ||
| } | ||
| + relocate("org.bstats:bstats-base" to "org.bstats") // Paper |
There was a problem hiding this comment.
we don't relocate libs anymore right?
There was a problem hiding this comment.
Uh oh!
There was an error while loading. Please reload this page.