-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5889] Bmoric/add application name [2/3] #7267
[5889] Bmoric/add application name [2/3] #7267
Conversation
I have added 2 reviewers since it is a potentially impactful change. |
@@ -86,4 +86,7 @@ public void cancel() { | |||
WorkerUtils.cancelProcess(process); | |||
} | |||
|
|||
@Override public String getApplicationName() { | |||
return "airbyte-connection-checker"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return "airbyte-connection-checker"; | |
return "check-connection-worker"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -81,4 +81,7 @@ public void cancel() { | |||
WorkerUtils.cancelProcess(process); | |||
} | |||
|
|||
@Override public String getApplicationName() { | |||
return "airbyte-catalog-discovery"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return "airbyte-catalog-discovery"; | |
return "discover-worker"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -81,4 +81,7 @@ public void cancel() { | |||
WorkerUtils.cancelProcess(process); | |||
} | |||
|
|||
@Override public String getApplicationName() { | |||
return "airbyte-spec-getter"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return "airbyte-spec-getter"; | |
return "get-spec-worker"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -82,4 +82,7 @@ public void cancel() { | |||
} | |||
} | |||
|
|||
@Override public String getApplicationName() { | |||
return "airbyte-normalization"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return "airbyte-normalization"; | |
return "normalization-worker"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -77,4 +77,7 @@ public void cancel() { | |||
} | |||
} | |||
|
|||
@Override public String getApplicationName() { | |||
return "airbyte-dbt-transformation-worker"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return "airbyte-dbt-transformation-worker"; | |
return "dbt-worker"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -142,4 +142,7 @@ public boolean isFinished() { | |||
return Optional.ofNullable(messageIterator.hasNext() ? messageIterator.next() : null); | |||
} | |||
|
|||
@Override public String getApplicationName() { | |||
return "airbyte-destination"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even this level is a bit misleading. To a user in the UI, "destination" would likely make it seem like something running on the destination pod/container, not the destination class within the sync worker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I have removed it.
@@ -129,4 +128,7 @@ public void cancel() throws Exception { | |||
} | |||
} | |||
|
|||
@Override public String getApplicationName() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -89,4 +87,7 @@ private void internalLog(final AirbyteLogMessage logMessage) { | |||
} | |||
} | |||
|
|||
@Override public String getApplicationName() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -56,4 +55,7 @@ public void cancel() throws Exception { | |||
// no op. | |||
} | |||
|
|||
@Override public String getApplicationName() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -97,4 +96,7 @@ private static String transformStreamName(final String streamName, final String | |||
} | |||
} | |||
|
|||
@Override public String getApplicationName() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
…airbyte into bmoric/add-application-name
import java.util.Optional; | ||
import java.util.function.Consumer; | ||
|
||
public interface MessageTracker<T> extends Consumer<T> { | ||
public interface MessageTracker<T> extends Consumer<T>, Application { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't seem right. Message Tracker isn't an Application. I wonder if the way to track name is wrong or just the naming of this interface. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we need make sure that I properly understand how granular we want to log. My initial thought was that we have a different prefix within the same application (a different prefix per step). So if we want to go in this direction we will probably need to rename the interface. If not I should remove the Application interface and move this method to the worker interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree the iface name should change.
Will follow up offline, but I'm am not understanding the granularity we are going for right now. The issue is focused on distinguishing source, destination, and platform logs from each other. This PR is focused on distinguishing worker logs from each other, and I'm a little less clear on why that is valuable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I sync up offline with Michel on that. I will abandon the interface and this review for something more suited to what is needed.
…airbyte into bmoric/add-application-name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a couple questions on the scope of what we are doing here. going to follow up offline.
default String getApplicationName() { | ||
// This value should only be used in the U-Test, it is an empty string instead of airbyte-test in | ||
// order to avoid displaying airbyte-test in prod | ||
return ""; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By convention, we do not usually use a default
in an interface if the default implementation is for testing only. The reason for this is that with this default, it is easy for a developer to make a mistake using this interface because the compiler won't warn them that they need to override method. If they fail to do that, then test code will accidentally run in production. Instead we would usually structure it something like this, so that the compiler complains if the developer makes a mistake.
default String getApplicationName() { | |
// This value should only be used in the U-Test, it is an empty string instead of airbyte-test in | |
// order to avoid displaying airbyte-test in prod | |
return ""; | |
} | |
String getApplicationName(); | |
class TestApplication implements Application { | |
@Override | |
public String getApplicationName() { | |
// This value should only be used in the U-Test, it is an empty string instead of airbyte-test in | |
// order to avoid displaying airbyte-test in prod | |
return ""; | |
} | |
} |
import java.util.Optional; | ||
import java.util.function.Consumer; | ||
|
||
public interface MessageTracker<T> extends Consumer<T> { | ||
public interface MessageTracker<T> extends Consumer<T>, Application { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree the iface name should change.
Will follow up offline, but I'm am not understanding the granularity we are going for right now. The issue is focused on distinguishing source, destination, and platform logs from each other. This PR is focused on distinguishing worker logs from each other, and I'm a little less clear on why that is valuable.
What
Introduce a new interface which will allow to get an application name.
It will then be use in #5889 to log which application produce a log.