open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.02k stars 2.34k forks source link

Add osquery receiver in Custom Otel collector #34262

Closed saiganeshkABI closed 2 months ago

saiganeshkABI commented 2 months ago

Component(s)

receiver/osquery

What happened?

Description

Building an additional component to the Custom Otel Collector Unable to add the osquery receiver component to my Custom Otel Collector

Steps to Reproduce

Add the component in the builder-config.yaml gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/osqueryreceiver v0.105.0 Run the command: ./ocb --config builder-config.yaml --skip-strict-versioning (The skip version flag added as per the suggestion from the output of : ./ocb --config builder-config.yaml )

Expected Result

The component should be added successfully

Actual Result

The custom Otel Collector build is not successful, blocked with the following error

Collector version

0.104.0

Environment information

Environment

OS: Windows Compiler(if manually compiled): go version go1.22.1 windows/amd64

OpenTelemetry Collector configuration

No response

Log output

Error: failed to compile the OpenTelemetry Collector distribution: go subcommand failed with args '[build -trimpath -o otelcol-dev -ldflags=-s -w]': exit status 1, error message: # go.opentelemetry.io/collector/config/configgrpc
C:\Users\<UserID>\go\pkg\mod\go.opentelemetry.io\collector\config\configgrpc@v0.100.0\configgrpc.go:274:62: not enough arguments in call to gcs.Auth.GetClientAuthenticator
        have (map[component.ID]component.Component)
        want (context.Context, map[component.ID]component.Component)
C:\Users\<UserID>\go\pkg\mod\go.opentelemetry.io\collector\config\configgrpc@v0.100.0\configgrpc.go:390:57: not enough arguments in call to gss.Auth.GetServerAuthenticator
        have (map[component.ID]component.Component)
        want (context.Context, map[component.ID]component.Component)

Additional context

No response

github-actions[bot] commented 2 months ago

Pinging code owners:

smithclay commented 2 months ago

Hi @saiganeshkABI -- one important note about osquery receiver: it's just a scaffold under development. If you add it to your builder file, it will not do anything or be able to interact with osquery in the current state.

Can you attach your full builder-config.yaml?

saiganeshkABI commented 2 months ago

Hi @saiganeshkABI -- one important note about osquery receiver: it's just a scaffold under development. If you add it to your builder file, it will not do anything or be able to interact with osquery in the current state.

Can you attach your full builder-config.yaml?

Hi @smithclay , the above mentioned issue is resolved now by explicitly mentioning the otelcol_version and all the components as the same version. Thanks for your support. However, I am encountered with another issue with osquery receiver. Kindly help me out Config.yaml file:(The extension socket is based on the output from the query "select value from osquery_flags where name = 'extensions_socket';") receivers: osquery: extensions_socket: \.\pipe\shell.em queries:

Output: 2024-07-29T05:36:44.105Z info receiver@v0.104.0/receiver.go:315 Stability level of component is undefined {"kind": "receiver", "name": "osquery", "data_type": "logs"} Error: failed to build pipelines: failed to create "osquery" receiver for data type "logs": telemetry type is not supported 2024/07/29 05:36:44 collector server run finished with error: failed to build pipelines: failed to create "osquery" receiver for data type "logs": telemetry type is not supported

crobert-1 commented 2 months ago

Output: 2024-07-29T05:36:44.105Z info receiver@v0.104.0/receiver.go:315 Stability level of component is undefined {"kind": "receiver", "name": "osquery", "data_type": "logs"} Error: failed to build pipelines: failed to create "osquery" receiver for data type "logs": telemetry type is not supported 2024/07/29 05:36:44 collector server run finished with error: failed to build pipelines: failed to create "osquery" receiver for data type "logs": telemetry type is not supported

This is the same issue, as @smithclay pointed out, the component is still in development. In this case, it simply can't be used yet. The README describes functionality that is not yet implemented. It's being actively worked on and will be moved to alpha status once it's ready to be used.

saiganeshkABI commented 2 months ago

Thanks @smithclay for the clarification! Eagerly waiting for the development of this receiver. Do you mind suggesting any work arounds to monitor the windows services?