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

Extend semantic convetions for RPC #900

Merged

Conversation

matej-g
Copy link
Contributor

@matej-g matej-g commented Jul 5, 2020

Enhance the existing semantic conventions for RPC, in line with open-telemetry/opentelemetry-specification#604, i.e.:

  • Introduce rpc.system and rpc.method
  • Adapt rpc.service to include the full service name, including package where applicable
  • Adapt gRPC interceptor accordingly
  • Adjust gRPC interceptor tests

Related Issues

Resolves #893

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jul 5, 2020

CLA Check
The committers are authorized under a signed CLA.

CHANGELOG.md Outdated Show resolved Hide resolved
instrumentation/grpctrace/interceptor.go Outdated Show resolved Hide resolved
instrumentation/grpctrace/interceptor.go Show resolved Hide resolved
@matej-g
Copy link
Contributor Author

matej-g commented Jul 6, 2020

one more thing I'm wondering, should the leading slash be also trimmed for RPCServiceKey?

@MrAlias MrAlias added this to the Implement v0.6.0 Specification milestone Jul 7, 2020
Copy link
Contributor

@MrAlias MrAlias left a comment

Choose a reason for hiding this comment

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

one more thing I'm wondering, should the leading slash be also trimmed for RPCServiceKey?

I think the leading slash should probably addressed, but probably at the "SetName" level. I think it should probably be preserved at this level.

It looks like we use the FullMethod name when setting the name. This is introducing the leading slash. This is different than other language (Java IIRC does not have this). Probably worth tracking in an issue: #916

api/standard/trace.go Outdated Show resolved Hide resolved
MrAlias referenced this pull request in MrAlias/opentelemetry-go Jul 8, 2020
Span names MUST not contain the leading slash (`/`) that the grpc
package prepends to all `FullMethod` values. This replaces the
`serviceFromFullMethod` function with a parsing function. This parsing
function returns an span name adhering to the OpenTelemetry semantic
conventions as well as formatted span attributes.

Additionally, the service name needs to include the package if one
exists. This updates that attribute accordingly.

Once #900 is merged the method attributes can be added by uncommenting.

Resolves #916
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
@MrAlias MrAlias merged commit 1c9aab6 into open-telemetry:master Jul 8, 2020
MrAlias added a commit that referenced this pull request Jul 9, 2020
* Update grpctrace instrumentation span names

Span names MUST not contain the leading slash (`/`) that the grpc
package prepends to all `FullMethod` values. This replaces the
`serviceFromFullMethod` function with a parsing function. This parsing
function returns an span name adhering to the OpenTelemetry semantic
conventions as well as formatted span attributes.

Additionally, the service name needs to include the package if one
exists. This updates that attribute accordingly.

Once #900 is merged the method attributes can be added by uncommenting.

Resolves #916

* Update Changelog

* Update comment to plural

* Switch from regexp to string parsing

* Consolidate attributes before creating span

* Update Changelog with addition of rpc.method in grpctrace

* Fix test spanMap lookup key

* Update instrumentation/grpctrace/interceptor.go

Co-authored-by: ET <evantorrie@users.noreply.github.com>

* Unify on explicit typed return value

* Fix copy paste error

Co-authored-by: ET <evantorrie@users.noreply.github.com>
@MrAlias MrAlias mentioned this pull request Jul 9, 2020
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.

Extend semantic conventions for RPC in api/standard package
5 participants