As you correctly pointed out, the hono.connections.authenticated gauge also tells you how many devices are currently connected to any of Hono's protocol adapters which have successfully authenticated. Because edge devices that connect via a gateway do not themselves get authenticated by adapters (only the gateway is being authenticated and is then trusted to act on behalf of the edge devices), this gauge does not include such edge devices.
I currently do not see how these edge devices could be included in that gauge, simply because the protocol adapters only get to see them once they start sending data or the gateway subscribes to commands on their behalf.
What you could do is evaluate the hono.messages.received timer in order to determine the number of distinct devices that have sent/received data during a particular period of time, e.g. the last 2 minutes. Assuming that the data is being collected by a Prometheus server, the corresponding meter to query would be hono_messages_received_seconds_count.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…