Skip to content

Conversation

@elilevine
Copy link
Contributor

This PR adds custom annotations to log lines generated in Phoenix's client-side code. It builds on PR #13 and uses the same mechanism to pass custom annotations to connections. These custom annotations are only added to client-side code logging that is within the context of a user operation (meaning a PhoenixConnection is available). No new log lines are added here. Only existing log lines are changed.

Usage:

  1. Add custom annotation properties when creating a Phoenix Connection. e.g. phoenix.trace.custom.annotation.a1=v1
  2. Log lines in (some of) Phoenix's client-side code would look like this: {a1=v1} something logged

Ignore the following files here, since they are covered in PR #13: BaseTracingTestIT.java, PhoenixTracingEndToEndIT.java, TraceReader.java, Tracing.java, JDBCUtilTest.java

@jtaylor-sfdc

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding a custom annotation for known properties like TENANT_ID and CURRENT_SCN?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Will add.

@jyates
Copy link

jyates commented Sep 16, 2014

This would be a lot nicer if you didn't mix the logging changes with the tracing changes - the changelist would be much more succinct and to the point. Otherwise, seems like the right approach, though it could use some cleanup (docs, readability, etc)

@JamesRTaylor
Copy link
Contributor

Had an offline conversation with Jesse and he had a good idea. Can we change the property name by dropping the "trace" part of it and have this instead? I don't think having "custom" in there adds anything either. How about just phoenix.annotation? Then you can use these for tracing and logging both.

@elilevine
Copy link
Contributor Author

I like it. Good call.

@elilevine
Copy link
Contributor Author

Merged now.

@elilevine elilevine closed this Sep 25, 2014
richardantal pushed a commit to richardantal/phoenix-1 that referenced this pull request Jul 16, 2020
Signed-off-by: Josh Elser <elserj@apache.org>

Closes apache#15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants