File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,3 +118,12 @@ setAttributeOptions _ = GleanGlassLogger
118118
119119setDynamicAttributeStats :: [Text ] -> GleanGlassLogger
120120setDynamicAttributeStats _ = GleanGlassLogger
121+
122+ setClientUnixname :: Text -> GleanGlassLogger
123+ setClientUnixname _ = GleanGlassLogger
124+
125+ setClientApplication :: Text -> GleanGlassLogger
126+ setClientApplication _ = GleanGlassLogger
127+
128+ setClientName :: Text -> GleanGlassLogger
129+ setClientName _ = GleanGlassLogger
Original file line number Diff line number Diff line change @@ -67,12 +67,21 @@ instance LogRequest RequestOptions where
6767 Logger. setExactRevision requestOptions_exact_revision <>
6868 Logger. setMatchingRevision requestOptions_matching_revision <>
6969 Logger. setContentCheck requestOptions_content_check <>
70+ logRequest requestOptions_client_info <>
7071 logRequest requestOptions_feature_flags <>
7172 logRequest requestOptions_attribute_opts
7273
74+ instance LogRequest ClientInfo where
75+ logRequest ClientInfo {.. } = mconcat
76+ [ maybe mempty Logger. setClientUnixname clientInfo_unixname
77+ , maybe mempty Logger. setClientApplication clientInfo_application
78+ , maybe mempty Logger. setClientName clientInfo_name
79+ ]
80+
7381instance LogRequest AttributeOptions where
7482 logRequest AttributeOptions {.. } =
75- Logger. setAttributeOptions $ textShow $ Thrift. serializeJSON AttributeOptions {.. }
83+ Logger. setAttributeOptions $ textShow $
84+ Thrift. serializeJSON AttributeOptions {.. }
7685
7786instance LogRequest FeatureFlags where
7887 logRequest FeatureFlags {} = mempty
Original file line number Diff line number Diff line change @@ -121,6 +121,16 @@ typedef string BinaryName (hs.newtype)
121121
122122typedef string PackageName (hs.newtype)
123123
124+ // Client information for logging and debugging
125+ struct ClientInfo {
126+ // Client name (e.g. api-python3, api-haskell, vscode)
127+ 1: optional string name ;
128+ // Unix username of the user making the request
129+ 2: optional string unixname ;
130+ // Application identifier (e.g. build rule)
131+ 3: optional string application ;
132+ }
133+
124134// Generic request options, supported by most calls
125135struct RequestOptions {
126136 // repo-global preferred revision identifier
@@ -167,6 +177,9 @@ struct RequestOptions {
167177 6: bool matching_revision = false ;
168178
169179 8: AttributeOptions attribute_opts ;
180+
181+ // Information about who is making the call
182+ 9: optional ClientInfo client_info ;
170183}
171184
172185struct FeatureFlags {
You can’t perform that action at this time.
0 commit comments