Skip to content
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

airbyte-server: tag span of additional OAuth routes #20610

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@ public OAuthConsentRead getSourceOAuthConsent(final SourceOauthConsentRequest so

public OAuthConsentRead getDestinationOAuthConsent(final DestinationOauthConsentRequest destinationOauthConsentRequest)
throws JsonValidationException, ConfigNotFoundException, IOException {
ApmTraceUtils.addTagsToTrace(Map.of(WORKSPACE_ID_KEY, destinationOauthConsentRequest.getWorkspaceId(), DESTINATION_DEFINITION_ID_KEY,
destinationOauthConsentRequest.getDestinationDefinitionId()));
final Map<String, Object> traceTags = Map.of(WORKSPACE_ID_KEY, destinationOauthConsentRequest.getWorkspaceId(), DESTINATION_DEFINITION_ID_KEY,
destinationOauthConsentRequest.getDestinationDefinitionId());
ApmTraceUtils.addTagsToTrace(traceTags);
ApmTraceUtils.addTagsToRootSpan(traceTags);

final StandardDestinationDefinition destinationDefinition =
configRepository.getStandardDestinationDefinition(destinationOauthConsentRequest.getDestinationDefinitionId());
Expand Down Expand Up @@ -162,8 +164,10 @@ public OAuthConsentRead getDestinationOAuthConsent(final DestinationOauthConsent

public Map<String, Object> completeSourceOAuth(final CompleteSourceOauthRequest completeSourceOauthRequest)
throws JsonValidationException, ConfigNotFoundException, IOException {
ApmTraceUtils.addTagsToTrace(Map.of(WORKSPACE_ID_KEY, completeSourceOauthRequest.getWorkspaceId(), SOURCE_DEFINITION_ID_KEY,
completeSourceOauthRequest.getSourceDefinitionId()));
final Map<String, Object> traceTags = Map.of(WORKSPACE_ID_KEY, completeSourceOauthRequest.getWorkspaceId(), SOURCE_DEFINITION_ID_KEY,
completeSourceOauthRequest.getSourceDefinitionId());
Comment on lines +167 to +168
Copy link
Contributor

Choose a reason for hiding this comment

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

should we have some sort of helper like getOAuthTraceTags or getDestinationTraceTags to make sure they're consistent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll definitely consider more helper if we trace more things in the future 😄

ApmTraceUtils.addTagsToTrace(traceTags);
ApmTraceUtils.addTagsToRootSpan(traceTags);

final StandardSourceDefinition sourceDefinition =
configRepository.getStandardSourceDefinition(completeSourceOauthRequest.getSourceDefinitionId());
Expand Down Expand Up @@ -210,8 +214,10 @@ public Map<String, Object> completeSourceOAuth(final CompleteSourceOauthRequest

public Map<String, Object> completeDestinationOAuth(final CompleteDestinationOAuthRequest completeDestinationOAuthRequest)
throws JsonValidationException, ConfigNotFoundException, IOException {
ApmTraceUtils.addTagsToTrace(Map.of(WORKSPACE_ID_KEY, completeDestinationOAuthRequest.getWorkspaceId(), DESTINATION_DEFINITION_ID_KEY,
completeDestinationOAuthRequest.getDestinationDefinitionId()));
final Map<String, Object> traceTags = Map.of(WORKSPACE_ID_KEY, completeDestinationOAuthRequest.getWorkspaceId(), DESTINATION_DEFINITION_ID_KEY,
completeDestinationOAuthRequest.getDestinationDefinitionId());
ApmTraceUtils.addTagsToTrace(traceTags);
ApmTraceUtils.addTagsToRootSpan(traceTags);

final StandardDestinationDefinition destinationDefinition =
configRepository.getStandardDestinationDefinition(completeDestinationOAuthRequest.getDestinationDefinitionId());
Expand Down