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

Monitoring: Metrics don't appear under any resource type #79

Closed
davidwitten opened this issue May 29, 2020 · 8 comments
Closed

Monitoring: Metrics don't appear under any resource type #79

davidwitten opened this issue May 29, 2020 · 8 comments
Assignees

Comments

@davidwitten
Copy link
Contributor

davidwitten commented May 29, 2020

Is your feature request related to a problem? Please describe.

I was exporting my metrics to Google Cloud. When I previously used OpenCensus and the Stackdriver Exporter, I was able to see my metrics when I selected a resource type.
Screenshot 2020-05-29 at 6 02 42 PM

However, now I can only see data when I specify the "Global" resource type.
Screenshot 2020-05-29 at 5 26 46 PM - Display 2

Describe the solution you'd like
Within the Stackdriver exporter code, they specify the resource type.

Currently, this repository sets the resource to "Global" with a comment in the code here to wait until the OT API exists.

It seems that the OpenTelemetry resource API exists now, so I'll try to add this feature and make a PR with this change.

@mayurkale22
Copy link
Contributor

Exporters can get access to Resource field via MetricRecord. This has been added in SDK in open-telemetry/opentelemetry-js#1049. This feature is released in v0.8.1. I think it is good time to incorpoorate Resource into Monitoring exporter.

@mayurkale22
Copy link
Contributor

I can assign this issue to you, if you're working on it.

@davidwitten
Copy link
Contributor Author

Yeah, I'd be happy to work on this issue.

@davidwitten
Copy link
Contributor Author

Hi, just to make sure I'm doing it in a preferred way, within createTimeSeries, I'm calling detectResources, which will determine if it is an AWS EC2 instance or a GCP VM instance. Then, I convert it to the correct format for Google Cloud.

There is an option for the user to enter the resource themselves, so should I incorporate that somehow?

@james-bebbington
Copy link

I'd wait for @mayurkale22 to respond as well, but I believe you should primarily just be using the resource that the user has supplied themselves (in the MeterProvider constructor).

While we do also want to provide the option for the resource to be auto-detected, I'm hoping / expecting this will be included as a core SDK feature rather than needing to be implemented in each exporter, see: open-telemetry/oteps#111

@mayurkale22
Copy link
Contributor

I absolutely agree with @james-bebbington. The responsibility of the exporter is only to receive the Resource (auto-detected by SDK) and covert it into the appropriate format. Currently, the only SDK resource is attached to the MeterProvider[1] and TracerProvider[2].

[1] https://github.com/open-telemetry/opentelemetry-js/blob/master/packages/opentelemetry-metrics/src/Meter.ts#L52
[2] https://github.com/open-telemetry/opentelemetry-js/blob/master/packages/opentelemetry-tracing/src/BasicTracerProvider.ts#L40

I would suggest to open issue in https://github.com/open-telemetry/opentelemetry-js repo to attach auto-detected resource in SDK.

@davidwitten
Copy link
Contributor Author

davidwitten commented Jun 9, 2020

Thanks @james-bebbington and @mayurkale22! I just updated my PR to take the resource from the MetricProvider instead of automatically detecting it

@dashpole
Copy link
Contributor

[Triage] I believe this was accomplished by #85 above. Much has also changed since this issue was opened. Feel free to open a new issue if this is still a problem.

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

No branches or pull requests

5 participants