-
Notifications
You must be signed in to change notification settings - Fork 39
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
Add metrics exporter #33
Conversation
exporters/metrics/src/main/java/com.google.cloud.opentelemetry.metric/MetricConfiguration.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment about adding missing property setters.
exporters/metrics/src/main/java/com.google.cloud.opentelemetry.metric/MetricConfiguration.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, just some clarifying / cleanup comments
@@ -29,6 +30,7 @@ subprojects { | |||
google_cloud_core : "com.google.cloud:google-cloud-core:${googleCloudVersion}", | |||
google_cloud_grpc : "com.google.api.grpc:grpc-google-cloud-trace-v2:${googleCloudVersion}", | |||
google_cloud_trace : "com.google.cloud:google-cloud-trace:${googleCloudVersion}", | |||
google_cloud_monitoring : "com.google.cloud:google-cloud-monitoring:${cloudMonitoringVersion}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are using {googleCloudVersion}
for both core and trace dependencies above, but not for Cloud Monitoring client? Might be worth checking if we should also use separate versioning for core and tracing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I used a separate version for cloud monitoring because the 1.0.2 version didn't have much and didn't work. I've added a separate cloudTracingVersion
for tracing, kept it to 1.0.2 for this PR though.
exporters/metrics/src/main/java/com.google.cloud.opentelemetry.metric/MetricExporter.java
Outdated
Show resolved
Hide resolved
exporters/metrics/src/main/java/com.google.cloud.opentelemetry.metric/MetricTranslator.java
Outdated
Show resolved
Hide resolved
exporters/metrics/src/main/java/com.google.cloud.opentelemetry.metric/MetricTranslator.java
Outdated
Show resolved
Hide resolved
exporters/metrics/src/main/java/com.google.cloud.opentelemetry.metric/MetricTranslator.java
Outdated
Show resolved
Hide resolved
exporters/metrics/src/main/java/com.google.cloud.opentelemetry.metric/MetricTranslator.java
Outdated
Show resolved
Hide resolved
exporters/metrics/src/main/java/com.google.cloud.opentelemetry.metric/MetricTranslator.java
Outdated
Show resolved
Hide resolved
exporters/metrics/src/main/java/com.google.cloud.opentelemetry.metric/MetricTranslator.java
Outdated
Show resolved
Hide resolved
exporters/metrics/src/main/java/com.google.cloud.opentelemetry.metric/MetricTranslator.java
Outdated
Show resolved
Hide resolved
exporters/metrics/src/main/java/com.google.cloud.opentelemetry.metric/MetricTranslator.java
Outdated
Show resolved
Hide resolved
exporters/metrics/src/main/java/com.google.cloud.opentelemetry.metric/MetricTranslator.java
Outdated
Show resolved
Hide resolved
exporters/metrics/src/main/java/com.google.cloud.opentelemetry.metric/MetricTranslator.java
Outdated
Show resolved
Hide resolved
!attributes.get("cloud.provider").getStringValue().equals("gcp")) { | ||
return null; | ||
} | ||
String resourceType = attributes.get("gcp.resource_type").getStringValue(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@james-bebbington @aabmass have we agreed to keep this attribute, or should we switch to semantic conventions?
I would suggest to just remove resource GCP mapping for now from the code, and add it later (we also need to add mapping for all other resource types defined in OpenCensus Go exporter for feature parity).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify, the question was whether we should infer resource type based on other attributes, like we did in open-telemetry/opentelemetry-collector#1462
exporters/metrics/src/main/java/com.google.cloud.opentelemetry.metric/MetricTranslator.java
Outdated
Show resolved
Hide resolved
exporters/metrics/src/main/java/com.google.cloud.opentelemetry.metric/MetricTranslator.java
Outdated
Show resolved
Hide resolved
exporters/metrics/src/main/java/com.google.cloud.opentelemetry.metric/MetricTranslator.java
Outdated
Show resolved
Hide resolved
exporters/metrics/src/main/java/com.google.cloud.opentelemetry.metric/MetricTranslator.java
Outdated
Show resolved
Hide resolved
exporters/metrics/src/main/java/com.google.cloud.opentelemetry.metric/MetricTranslator.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few final comments, and it's ready to merge.
exporters/metrics/src/main/java/com.google.cloud.opentelemetry.metric/MetricExporter.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just need to work out that 1ms interval spacing
This adds the metric exporter for Google cloud monitoring.
Unit tests here: zoercai#1
End to end tests (WIP) here: zoercai#2