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

failed to upload metrics: rpc error: code = Unimplemented desc = unknown service opentelemetry.proto.collector.metrics.v1.MetricsService #63

Open
armyhcz opened this issue Jan 3, 2025 · 1 comment

Comments

@armyhcz
Copy link

armyhcz commented Jan 3, 2025

failed to upload metrics

tracerProvider := provider.NewOpenTelemetryProvider(		
    provider.WithEnableMetrics(true),
)

then
log: failed to upload metrics: rpc error: code = Unimplemented desc = unknown service opentelemetry.proto.collector.metrics.v1.MetricsService

To Reproduce

  1. k8s deploy otel/opentelemetry-collector-contrib:0.116.1
  2. config.yml
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318

exporters:
  debug:
  zipkin:
    endpoint: "http://zipkin..svc.cluster.local:9411/api/v2/spans"
service:
  pipelines:
    traces:
      receivers: [otlp]
      exporters: [debug, zipkin]
tracerProvider := provider.NewOpenTelemetryProvider(
        provider.WithServiceName(serviceName),
        provider.WithExportEndpoint(env.GetEnv("OTEL_EXPORTER_OTLP_ENDPOINT", "otel-collector..svc.cluster.local:4317")),
        provider.WithInsecure(),
        provider.WithEnableTracing(true),
        provider.WithEnableMetrics(true),
        provider.WithEnableCompression(),
)
  1. Log: unknown service opentelemetry.proto.collector.metrics.v1.MetricsService

Expected behavior

http query messages are collected by zipkin, I want to fix this log

Hertz version:

v0.9.4

Environment:

GO111MODULE='on'
GOARCH='arm64'
GOBIN='/opt/data/go/bin'
GOENV='/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/opt/data/go/pkg/mod'
GOOS='darwin'
GOPATH='/opt/data/go'
GOPRIVATE=''
GOPROXY='https://goproxy.io,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.23.3'
GODEBUG=''
GOTELEMETRY='local'
GCCGO='gccgo'
GOARM64='v8.0'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/opt/data/go/src/*/*/*/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/t0/tdqlg_g95dg0_wd71xwn2nmr0000gn/T/go-build3253858403=/tmp/go-build -gno-record-gcc-switches -fno-common'
➜
@rogerogers
Copy link
Collaborator

参考下 https://github.com/cloudwego/hertz-examples/blob/main/opentelemetry/otel-collector-config.yaml
你的配置并没有配置metrics相关的

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

No branches or pull requests

2 participants