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

Use resource service.name as zipkin service name #919

Closed
dyladan opened this issue Apr 1, 2020 · 11 comments · Fixed by #1138
Closed

Use resource service.name as zipkin service name #919

dyladan opened this issue Apr 1, 2020 · 11 comments · Fixed by #1138
Assignees
Labels

Comments

@dyladan
Copy link
Member

dyladan commented Apr 1, 2020

open-telemetry/opentelemetry-specification#472

Right now we get the service name from the config. While we can probably keep this as a manual override of sorts, we should infer the service name where we can.

@rezakrimi
Copy link
Contributor

Hey, I'm willing to work on this. As far as I understand, we can detect the resource type and generate a Resource object. But I haven't seen any of the SERVICE_RESOURCE attributes (which includes service.name) being set in the code.

So is it right to detect the resource and set the zipkin service name to something like
this._serviceName = config.serviceName || resource.service.name?

@dyladan
Copy link
Member Author

dyladan commented Jun 1, 2020

The resource comes attached to the first span. I would do something like this:

class ZipkinExporter
  public serviceName?: string;
  constructor(options) {
    // user can configure a service name
    if (typeof options.serviceName === "string")
      this.serviceName = options.serviceName;
    }
    // ...
  }

  public export(spans) {
    // if user has not configured service name, it comes from the first exported resource
    if (this.serviceName == null) {
      this.serviceName = spans[0].resource.labels["service.name"] ?? "Unnamed Service";
    }
    // ...
  }
}

@rezakrimi
Copy link
Contributor

Thanks for the help. I'll be working on it.

@rezakrimi
Copy link
Contributor

rezakrimi commented Jun 2, 2020

Is it okay to change the serviceName property of ZipkinExporter to be public?
I'm trying to write some tests cases to check its value.

@dyladan
Copy link
Member Author

dyladan commented Jun 2, 2020

In tests you can access private variables like this

exporter["_privateProperty"]

@rezakrimi
Copy link
Contributor

@dyladan I'm doing my internship at Google and I have linked my google account to my github account. But I'm still getting error for not signing CLA in my PR.

@dyladan
Copy link
Member Author

dyladan commented Jun 3, 2020

Maybe @mayurkale22 can help here (he is a google employee)

@mayurkale22
Copy link
Member

@dyladan I'm doing my internship at Google and I have linked my google account to my github account. But I'm still getting error for not signing CLA in my PR.

Post a comment ("I signed it") to the PR to recheck the signed CLA.

@rezakrimi
Copy link
Contributor

@dyladan I'm doing my internship at Google and I have linked my google account to my github account. But I'm still getting error for not signing CLA in my PR.

Post a comment ("I signed it") to the PR to recheck the signed CLA.

seems like it didn't work.

@mayurkale22
Copy link
Member

seems like it didn't work.

Not sure what went wrong, did you sign up as an individual (https://identity.linuxfoundation.org/?destination=node/285/individual-signup)?

@dyladan
Copy link
Member Author

dyladan commented Jun 4, 2020

Do the interns sign up as individuals? I would assume they sign up as employees. @rezakrimi your manager should probably know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants