Skip to content

Conversation

@xiao-lix
Copy link
Contributor

No description provided.

@xiao-lix xiao-lix requested a review from hectorhdzg July 26, 2021 19:46
Comment on lines +21 to +22
const isHttp: boolean = (!!span.attributes[Constants.SpanAttribute.HttpStatusCode]) || (!!span.attributes[Constants.SpanAttribute.HttpUrl]);
const isGrpc: boolean = (!!span.attributes[Constants.SpanAttribute.GrpcStatusCode]);
Copy link
Contributor Author

@xiao-lix xiao-lix Jul 26, 2021

Choose a reason for hiding this comment

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

  • to check if it's http, check span[HTTP_STATUS_CODE] reference
  • to check if it's grpc, check span[RPC_GRPC_STATUS_CODE] reference

const name = `${method} ${pathname}`;
const dependencyTypeName = Constants.DependencyTypeName.Http;
const target = port ? `${host}:${port}`.toString() : host.toString();
const target = span.attributes[Constants.SpanAttribute.HttpUrl].toString() || undefined;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • for HTTP, target is [new URL(span[HTTP_URL])].hostname reference
  • for GRPC, target is span[GRPC_METHOD] reference
  • else, target is span[HTTP_URL] | undefined reference

Comment on lines +133 to +135
GrpcStatusCode: conventions.SemanticAttributes.RPC_GRPC_STATUS_CODE,
GrpcMethod: conventions.SemanticAttributes.RPC_METHOD, // rpc not grpc
GrpcService: conventions.SemanticAttributes.RPC_SERVICE, // rpc not grpc
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All GRPC related constants reference

Comment on lines +127 to +130
HttpMethod: conventions.SemanticAttributes.HTTP_METHOD,
HttpStatusCode: conventions.SemanticAttributes.HTTP_STATUS_CODE,
HttpUrl: conventions.SemanticAttributes.HTTP_URL,
HttpUserAgent: conventions.SemanticAttributes.HTTP_USER_AGENT,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All HTTP related constants reference

Copy link
Member

@hectorhdzg hectorhdzg left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants