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

refactor(opentelemetry-plugins): move common attributes to core #718

Closed
wants to merge 1 commit into from

Conversation

rubenvp8510
Copy link
Contributor

Signed-off-by: Ruben Vargas [email protected]

Which problem is this PR solving?

Fixes #522

@rubenvp8510 rubenvp8510 changed the title refactor(opentelemetry-plugins): move common attributes to Core refactor(opentelemetry-plugins): move common attributes to core Jan 22, 2020
@dyladan
Copy link
Member

dyladan commented Jan 22, 2020

Please sign the CLA

@@ -14,19 +14,36 @@
* limitations under the License.
*/

export enum AttributeNames {
export enum CommonAttributeNames {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add comments with links to the appropriate semantic convention specs?

export enum CommonAttributeNames {
  // Required on all spans
  COMPONENT = 'component',

  // HTTP Span attributes https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/data-http.md
  HTTP_METHOD = 'http.method',
  HTTP_URL = 'http.url',
  HTTP_TARGET = 'http.target',
  HTTP_HOST = 'http.host',
  HTTP_SCHEME = 'http.scheme',
  
... and so on

@rubenvp8510
Copy link
Contributor Author

I signed it

Copy link
Member

@dyladan dyladan left a comment

Choose a reason for hiding this comment

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

Think this is generally an improvement, but I think it raises a few other questions:

  1. should this be in core or types/api?
  2. is there a reason this is an enum and not just an object? objects would allow us to nest attributes and have for instance AttributeNames.db.required.type
  3. if we keep this as an enum, should it be a const enum? then it would compile away.

@open-telemetry/javascript-approvers WDYT?

Additionally, I would like to see jsdocs on each one explaining what it is, when it is required, and what its value should be. For instance, in http if you have http.url you don't need http.scheme, http.host, or http.target. Additionally, client and server spans have different required attributes.

@vmarchaud
Copy link
Member

@dyladan

  1. I believe this should belong to the core package since the BasePlugin is there
  2. I prefer to have a enum since currently there are no nested attributes in the spec i believe
  3. Sure i would prefer to have it only at compile time

Also agree that jsdoc would be better, an extract of the spec would be enough for me

@obecny
Copy link
Member

obecny commented Jun 26, 2020

should this be revisited now and either refactored or closed as we have opentelemetry-semantic-conventions now ?

@markwolff
Copy link
Member

should this be revisited now and either refactored or closed as we have opentelemetry-semantic-conventions now ?

@obecny it can be closed

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.

[Refactor][Plugins] Move common attributes to Core/Base
5 participants