Pass OpenTelemetry to SystemAccessControl#18899
Conversation
There was a problem hiding this comment.
Why do you need an instance of OpenTelemetry? Generally, all you need is a properly configured Tracer.
There was a problem hiding this comment.
I didn't see how access control needs would be different than those of a connector. I followed ConnectorContext where @electrum added both
There was a problem hiding this comment.
I couldn't find any authoritative docs or code comments, thus may be drawing wrong conclusions, but both are expected here
https://github.com/airlift/airlift/blob/c55517863fe246f8921b0a03034b0e2f0d7a31c9/http-client/src/main/java/io/airlift/http/client/HttpClientModule.java#L121-L131
and both are later used, if provided.
This is necessary for SystemAccessControl implementation to participate in tracing. Useful when the implementation does e.g. network communication when performing access control.
332e0bc to
23d59aa
Compare
| { | ||
| return new SystemAccessControlContext() | ||
| { | ||
| private final Tracer tracer = openTelemetry.getTracer("trino.system-access-control." + systemAccessControlName); |
There was a problem hiding this comment.
nit: verify that systemAccessControlName is not empty or null
There was a problem hiding this comment.
this is verified by the caller within the class and the method is private
also, empty string is currently valid factory name :)
This is necessary for SystemAccessControl implementation to participate in tracing. Useful when the implementation does e.g. network communication when performing access control.