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

otlpreceiver is not throwing a valid gRPC Status for successful scenarios or authentication-related errors #7646

Closed
shalithakaru opened this issue May 9, 2023 · 0 comments · Fixed by #10670
Assignees
Labels
bug Something isn't working

Comments

@shalithakaru
Copy link

shalithakaru commented May 9, 2023

Describe the bug
OTLP receiver is not throwing a valid gRPC Status for successful scenarios or authentication-related errors.

Steps to reproduce

  1. Enable the OTLP receiver configuration as below for the Collector
    (Please note you need this extension to enable authentication with the receiver)
receivers:
  otlp:
    protocols:
      grpc:
        auth:
          authenticator: oidc
      http: 
        auth: 
          authenticator: oidc
  1. Send sample traces to the collector endpoints in each port using both HTTP and gRPC SDK implementations with a sample JWT tokens.
    OTLP/HTTP is 4318
    OTLP/gRPC is 4317

What did you expect to see?
gRPC Status:16 for unauthenticated requests and gRPC Status:0 for successful authentication.

What did you see instead?
HTTP will throw proper status codes like 401(Unauthorized) for errors and 200 for successful authentication.
But with gRPC, it will throw gRPC Status:2 for errors and nothing for successful authentication.

What version did you use?
Version: v0.76.1

What config did you use?
Config: N/A

Environment
N/A

Additional context
Temporary fix for error scenarios

errNoAudienceProvided = errors.New("no Audience provided for the OIDC configuration")
....

to

import (
        ....
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/status"
)

errNoAudienceProvided = status.Error(codes.Unauthenticated, "failed to verify the token")
....

Suggestion: I think it's better if we can fix interceptors in configgrpc similar to confighttp interceptor

I was not able to find a any solution for the successful scenario

@shalithakaru shalithakaru added the bug Something isn't working label May 9, 2023
@shalithakaru shalithakaru changed the title otlpreceiver OTLP receiver is not throwing a valid grpc-status for authentication-related errors or in successful scenario otlpreceiver is not throwing a valid grpc-status for authentication-related errors or in successful scenario May 9, 2023
@shalithakaru shalithakaru changed the title otlpreceiver is not throwing a valid grpc-status for authentication-related errors or in successful scenario otlpreceiver is not throwing a valid grpc-status for successful scenarios or authentication-related errors. May 9, 2023
@shalithakaru shalithakaru changed the title otlpreceiver is not throwing a valid grpc-status for successful scenarios or authentication-related errors. otlpreceiver is not throwing a valid gRPC Status for successful scenarios or authentication-related errors May 9, 2023
@jpkrohling jpkrohling self-assigned this Jul 19, 2024
jpkrohling added a commit to jpkrohling/opentelemetry-collector that referenced this issue Jul 19, 2024
Fixes open-telemetry#7646

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
mx-psi pushed a commit that referenced this issue Jul 24, 2024
Fixes #7646

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
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.

2 participants