traction icon indicating copy to clipboard operation
traction copied to clipboard

Enhancements to tenant logging

Open esune opened this issue 1 year ago • 10 comments

Currently, each log statement generated by a tenant in a multi-tenant instance of ACA-Py is prefixed with the tenant's wallet_id - see here and here.

For Traction, however, we would like to use the tenant_id rather than the wallet_id to identify a tenant: this is because of the desire to move towards not exposing a tenant's root credentials for managed wallets.

We need a custom log handler class that will allow to use tenant_id as log statement identifier.

esune avatar Mar 04 '24 18:03 esune

Is this for traction or aca-py? It sounds like the issue is with log messages that are logged by aca-py, but does aca-py know the tennant_id?

ianco avatar Mar 04 '24 20:03 ianco

Is this for traction or aca-py? It sounds like the issue is with log messages that are logged by aca-py, but does aca-py know the tennant_id?

This is for Traction, ACA-Py has no knowledge of the tenant_id as it is used internally by the innkeeper plugin.

esune avatar Mar 04 '24 20:03 esune

I’m wondering if this needs to be in the logs. I assume we’ll need a splitter for the logs and that could handle the walletId to tenant_id correspondence. The walletId could be removed from the logs as part of the splitting.

swcurran avatar Mar 04 '24 21:03 swcurran

It would be easier to have ACA-Py log the tenant id rather than having to maintain a service with the mapping to reconcile the logs - if I understand correctly what you mean. If the tenant id is already in the logs, we only need a filter to remove any non-relevant information.

My idea would be to make it possible for a service to serve the "sanitized" logs to each tenant (similar to what OpenShift does with pods) rather than have the operations team fish them out, sanitize them and send them back to each tenant who requested it.

esune avatar Mar 04 '24 22:03 esune

Could the logging in ACA-Py be extended to allow a plugin, like traction's innkeeper plugin, to specify (inject) the identifier it wants to use for a tenant's logs rather than hard coding the wallet id as the identifier? Wallet id could be used as the default if nothing else is supplied.

WadeBarnes avatar Mar 05 '24 13:03 WadeBarnes

My idea would be to make it possible for a service to serve the "sanitized" logs to each tenant (similar to what OpenShift does with pods) rather than have the operations team fish them out, sanitize them and send them back to each tenant who requested it.

My point is that regardless of what identifier is used, the tenants only ever see their own logs — not anyone other tenant. What was explained the other day was that the log is produced combined and so something needs to split it, and if that is already needed, stripping off the identifier in the same process shouldn’t be an issue. What am I missing? Or worse case, the tenant sees only its own log.

I’m certainly not suggesting we need any manual intervention.

swcurran avatar Mar 05 '24 14:03 swcurran

Could the logging in ACA-Py be extended to allow a plugin, like traction's innkeeper plugin, to specify (inject) the identifier it wants to use for a tenant's logs rather than hard coding the wallet id as the identifier? Wallet id could be used as the default if nothing else is supplied.

That's what we need to figure out. If the innkeeper plugin can inject its own log handler implementation then we should be good. I guess this issue needs some investigation to understand what is/isn't possible before choosing a direction.

esune avatar Mar 05 '24 17:03 esune

I’m certainly not suggesting we need any manual intervention.

I misread the comment then, I thought you meant we keep "status-quo" for logs to be served by the ops team when requested.

esune avatar Mar 05 '24 17:03 esune

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Apr 18 '24 02:04 github-actions[bot]

Resolved by: #1065

amanji avatar Apr 22 '24 15:04 amanji