Skip to content

Conversation

@kotharironak
Copy link
Contributor

For RPC span, the span name is equivalent to Endpoint (URL) - https://github.com/open-telemetry/opentelemetry-specification/blob/3e380e249f60c3a5f68746f5e84d10195ba41a79/specification/trace/semantic_conventions/rpc.md#span-name

In cases if the convention is not followed, we would like to extend the platform to handle calc grpc request URL (& Endpoint) using a few other fallback attributes.

Secondly, we also want to enrich the URL based on client (Sent) or server (Recv) calls.

So, This PR,

  • add utility method for calc grpc request URL from spanName + fallback attributes
  • add GrpcAttribute enricher which adds two new attributes 1) URL 2) Endpoint
  • update spanEventView generator to use an enriched attribute for populating grpc request url

@codecov
Copy link

codecov bot commented Nov 11, 2021

Codecov Report

Merging #284 (98a40ed) into main (76c23fa) will increase coverage by 0.06%.
The diff coverage is 95.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #284      +/-   ##
============================================
+ Coverage     79.08%   79.14%   +0.06%     
- Complexity     1231     1237       +6     
============================================
  Files           110      111       +1     
  Lines          4862     4881      +19     
  Branches        440      443       +3     
============================================
+ Hits           3845     3863      +18     
  Misses          813      813              
- Partials        204      205       +1     
Flag Coverage Δ
unit 79.14% <95.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../enrichedspan/constants/EnrichedSpanConstants.java 50.00% <ø> (ø)
...er/enrichment/enrichers/GrpcAttributeEnricher.java 94.11% <94.11%> (ø)
...ewgenerator/generators/SpanEventViewGenerator.java 92.30% <100.00%> (+0.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 76c23fa...98a40ed. Read the comment docs.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.


GrpcAttributeEnricher {
class = "org.hypertrace.traceenricher.enrichment.enrichers.GrpcAttributeEnricher"
dependencies = ["SpanTypeAttributeEnricher", "ApiBoundaryTypeAttributeEnricher"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is PROTOCOL and enriched attribute?
If yes, are these 2 dependencies good enough for that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes PROTOCOL is enriched attributes, and these deps take care of both enriched attributes required by this enricher.
Ref :

public static final String HEAD_EVENT_ID = "head.event.id";
public static final String API_EXIT_CALLS_COUNT = "api.exit.calls.count";
public static final String UNIQUE_API_NODES_COUNT = "unique.apis.count";
public static final String GRPC_REQUEST_URL_FORMAT_DOTTED = "grpc.request.url.format.dotted";
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can get rid of the .format.dotted part in both the attributes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@kotharironak kotharironak merged commit 6d111a2 into main Nov 17, 2021
@kotharironak kotharironak deleted the add-support-for-grpc-path branch November 17, 2021 10:42
@github-actions
Copy link

Unit Test Results

  74 files  +1    74 suites  +1   58s ⏱️ -5s
389 tests  - 1  389 ✔️  - 1  0 💤 ±0  0 ❌ ±0 

Results for commit 6d111a2. ± Comparison against base commit 76c23fa.

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