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

MetricsReporter: possible outdate protobuf datatype #1814

Open
xuan-cao-swi opened this issue Feb 18, 2025 · 0 comments · May be fixed by #1816
Open

MetricsReporter: possible outdate protobuf datatype #1814

xuan-cao-swi opened this issue Feb 18, 2025 · 0 comments · May be fixed by #1816
Labels
bug Something isn't working

Comments

@xuan-cao-swi
Copy link
Contributor

Running the metrics exporter and received this issue when log_status is called.

E, [2025-02-18T16:51:36.131790 #19] ERROR -- : OpenTelemetry error: unexpected error decoding rpc.Status in OTLP::MetricsExporter#log_status - undefined method `type_name' for <Google::Protobuf::Any: type_url: "type.googleapis.com/google.rpc.BadRequest", value: "
>
.resourceMetrics.scopeMetricsPath contained no usable data
1
.resourceMetricsPath contained no usable data">:Google::Protobuf::Any

              klass_or_nil = ::Google::Protobuf::DescriptorPool.generated_pool.lookup(detail.type_name).msgclass
                                                                                            ^^^^^^^^^^ - /usr/local/bundle/gems/opentelemetry-exporter-otlp-metrics-0.3.0/lib/opentelemetry/exporter/otlp/metrics/util.rb:120:in `method_missing'

Not sure if this is caused by protobuf any type removed the type_name (https://cloud.google.com/ruby/docs/reference/google-cloud-container_analysis-v1/latest/Google-Protobuf-Any)

Current protobuf any have two values:

<Google::Protobuf::Any: type_url: "type.googleapis.com/google.rpc.BadRequest", value: ">

Currently possible workaround

require 'google/rpc/error_details_pb'
type_name = detail.type_url.split('/').last # => google.rpc.BadRequest
klass_or_nil=::Google::Protobuf::DescriptorPool.generated_pool.lookup(type_name)&.msgclass => Google::Rpc::BadRequest

Share details about your runtime

Operating system details: Debian GNU/Linux 11 (bullseye)
RUBY_ENGINE: "ruby"
RUBY_VERSION: "3.1.0"
RUBY_DESCRIPTION: "ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [aarch64-linux]"
OpenTelemetry::Exporter::OTLP::Metrics::VERSION: "0.3.0"

@xuan-cao-swi xuan-cao-swi added the bug Something isn't working label Feb 18, 2025
@xuan-cao-swi xuan-cao-swi linked a pull request Feb 19, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant