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

add the option to enable server reflection on otlp grpc receiver #4951

Open
tvaintrob opened this issue Mar 3, 2022 · 7 comments
Open

add the option to enable server reflection on otlp grpc receiver #4951

tvaintrob opened this issue Mar 3, 2022 · 7 comments

Comments

@tvaintrob
Copy link
Contributor

Describe the solution you'd like
a configuration to enable server reflection on the grpc otlp receiver something like the following:

receivers:
  otlp:
    protocols:
      grpc:
        enable_reflection: true

Describe alternatives you've considered
thought about adding a new receiver plugin but seems like the better solution is to add the functionality to the default one

id be happy to implement this one myself and submit a PR

@tigrannajaryan
Copy link
Member

Please clarify the purpose of this feature. What does server reflection do?

@jpkrohling
Copy link
Member

The biggest advantage is listing the resources a server provides. It allows a tool like grpccurl to be more user-friendly. We'd likely not have this enabled in production, but I can see how this can help debug connectivity and configuration issues.

@dmitryax dmitryax added the priority:p3 Lowest label Mar 18, 2022
@kvc0
Copy link

kvc0 commented Mar 19, 2022

I'm trying to write a tool that sends messages directly to opentelemetry collector and I receive this when sending messages via your proto service definition:

(logged by my client - Channel established, request made it to otel collector, this is the response from otel collector)

{ code: Unimplemented, message: "unknown service opentelemetry.proto.metrics_service.MetricsService", metadata: MetadataMap { headers: {"content-type": "application/grpc"} }, source: None }

The very next thing I did to understand what the collector is looking for was to reach for grpcurl's list verb.

➜  ~ grpcurl -plaintext localhost:4317 list                        
Failed to list services: server does not support the reflection API

I still do not know what's wrong.

Here is how I'm running otel:

docker run -p 4317:4317 --name otel --rm otel/opentelemetry-collector

Not supporting reflection at all is quite hostile to those integrating with the collector. I actually thought the missing reflection was a bug!

@AlexDCraig
Copy link

Why is this not supported? Would love to be able to grpcurl this thing without it being a huge pain

@brandtkilian
Copy link

brandtkilian commented Nov 22, 2022

If that can be of any interest as a workaround, I am using grpcui, then I cloned opentelemetry-proto repository and I am using something along:

grpcui -plaintext -import-path /path/to/opentelemetry-proto/ -proto /path/to/opentelemetry-proto/opentelemetry/proto/collector/metrics/v1/metrics_service.proto 127.0.0.1:{your_otlp_grpc_port}

Then I can craft my export metrics test queries from a web ui.

As a side note, the -plaintext and -proto options of grpcui are really similar to the grpcurl ones so you might be able to replicate that with grpcurl easily.

reflection would be nice to have tho...

@K-MTG
Copy link

K-MTG commented Jul 31, 2023

@brandtkilian, would you be able to share the example export metrics test queries?

I'm getting a undefined is not an object (evaluating 'schema.requestType')

@Sispheor
Copy link

For the other Googlers who will passe around this issue, here is an example of metric export using grpcurl (using the provided metric example)

You need to download proto repo and then:

cat payload.json | \
grpcurl \
    --plaintext \
    -d @ \
    -proto protos/opentelemetry/proto/collector/metrics/v1/metrics_service.proto \
    -import-path protos\
    -vv \
    <ip_or_host>:4317 \
    opentelemetry.proto.collector.metrics.v1.MetricsService/Export

Output example:

Resolved method descriptor:
// For performance reasons, it is recommended to keep this RPC
// alive for the entire life of the application.
rpc Export ( .opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest ) returns ( .opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse );

Request metadata to send:
(empty)

Response headers received:
content-type: application/grpc

Estimated response size: 2 bytes

Response contents:
{
  "partialSuccess": {}
}

Response trailers received:
(empty)
Sent 1 request and received 1 response
Timing Data: 10.672835ms
  Dial: 1.240466ms
    BlockingDial: 1.229131ms
  InvokeRPC: 2.54183ms

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

10 participants